mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Suresh Siddha <suresh.b.siddha@intel.com>
To: "Maciej W. Rozycki" <macro@linux-mips.org>,
	hpa@zytor.com, mingo@elte.hu, tglx@linutronix.de,
	ebiederm@xmission.com, garyhade@us.ibm.com
Cc: linux-kernel@vger.kernel.org, Suresh Siddha <suresh.b.siddha@intel.com>
Subject: [patch 3/4] x86, ioapic: document another case when level irq is seen as an edge
Date: Tue, 01 Dec 2009 15:31:17 -0800	[thread overview]
Message-ID: <20091201233335.143970505@sbs-t61.sc.intel.com> (raw)
In-Reply-To: <20091201233334.975416130@sbs-t61.sc.intel.com>

[-- Attachment #1: fix_comments_io_apic.patch --]
[-- Type: text/plain, Size: 2517 bytes --]

In the case when cpu goes offline, fixup_irqs() will forward any unhandled
interrupt on the offlined cpu to the new cpu destination that is handling the
corresponding interrupt. This interrupt forwarding is done via IPI's. Hence, in
this case also level-triggered io-apic interrupt will be seen as an edge
interrupt in the cpu's APIC IRR. Document this scenario in the code which
handles this case by doing an explicit EOI to the io-apic to clear remote IRR
of the io-apic RTE.

Requested-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---
 arch/x86/kernel/apic/io_apic.c |   21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

Index: tip/arch/x86/kernel/apic/io_apic.c
===================================================================
--- tip.orig/arch/x86/kernel/apic/io_apic.c
+++ tip/arch/x86/kernel/apic/io_apic.c
@@ -2586,6 +2586,19 @@ static void ack_apic_level(unsigned int 
 	 * level-triggered interrupt.  We mask the source for the time of the
 	 * operation to prevent an edge-triggered interrupt escaping meanwhile.
 	 * The idea is from Manfred Spraul.  --macro
+	 *
+	 * Also in the case when cpu goes offline, fixup_irqs() will forward
+	 * any unhandled interrupt on the offlined cpu to the new cpu
+	 * destination that is handling the corresponding interrupt. This
+	 * interrupt forwarding is done via IPI's. Hence, in this case also
+	 * level-triggered io-apic interrupt will be seen as an edge
+	 * interrupt in the IRR. And we can't rely on the cpu's EOI
+	 * to be broadcasted to the IO-APIC's which will clear the remoteIRR
+	 * corresponding to the level-triggered interrupt. Hence on IO-APIC's
+	 * supporting EOI register, we do an explicit EOI to clear the
+	 * remote IRR and on IO-APIC's which don't have an EOI register,
+	 * we use the above logic (mask+edge followed by unmask+level) from
+	 * Manfred Spraul to clear the remote IRR.
 	 */
 	cfg = desc->chip_data;
 	i = cfg->vector;
@@ -2597,7 +2610,13 @@ static void ack_apic_level(unsigned int 
 	 */
 	ack_APIC_irq();
 
-	/* Tail end of version 0x11 I/O APIC bug workaround */
+	/*
+	 * Tail end of clearing remote IRR bit (either by delivering the EOI
+	 * message via io-apic EOI register write or simulating it using
+	 * mask+edge followed by unnask+level logic) manually when the
+	 * level triggered interrupt is seen as the edge triggered interrupt
+	 * at the cpu.
+	 */
 	if (!(v & (1 << (i & 0x1f)))) {
 		atomic_inc(&irq_mis_count);
 



  parent reply	other threads:[~2009-12-02  0:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-01 23:31 [patch 1/4] x86, io-apic: move the effort of clearing remoteIRR explicitly before migrating the irq Suresh Siddha
2009-12-01 23:31 ` [patch 2/4] x86, ioapic: fix the EOI register detection mechanism Suresh Siddha
2009-12-02 10:43   ` [tip:x86/apic] x86, ioapic: Fix " tip-bot for Suresh Siddha
2009-12-01 23:31 ` Suresh Siddha [this message]
2009-12-02 10:43   ` [tip:x86/apic] x86, ioapic: Document another case when level irq is seen as an edge tip-bot for Suresh Siddha
2009-12-01 23:31 ` [patch 4/4] x86: remove unnecessary mdelay() from cpu_disable_common() Suresh Siddha
2009-12-02 10:44   ` [tip:x86/apic] x86: Remove " tip-bot for Suresh Siddha
2009-12-02 10:43 ` [tip:x86/apic] x86, io-apic: Move the effort of clearing remoteIRR explicitly before migrating the irq tip-bot for Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091201233335.143970505@sbs-t61.sc.intel.com \
    --to=suresh.b.siddha@intel.com \
    --cc=ebiederm@xmission.com \
    --cc=garyhade@us.ibm.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@linux-mips.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®