All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Lalancette <clalance@redhat.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH]: Really disable pirq's
Date: Wed, 14 Nov 2007 14:10:56 -0500	[thread overview]
Message-ID: <473B4840.4080502@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1333 bytes --]

All,
     I have a laptop here that has some interrupt trouble, unrelated to Xen (I
believe it's a bug in the ACPI tables, but I digress).  On the bare-metal
kernel, if 999,900 out of 100,000 interrupts go un-acknowledged to a particular
interrupt line, the kernel disables that interrupt line.  In the Xen kernel, the
same logic applies.  However, when the Xen kernel goes to disable the physical
interrupt, it only masks out the event channel:

static void disable_pirq(unsigned int irq)
{
        int evtchn = evtchn_from_irq(irq);

        if (VALID_EVTCHN(evtchn))
                mask_evtchn(evtchn);
}

And at this point, *all* interrupts on the affected machine seem to stop, not
just this physical IRQ line.  I believe the problem is that when we go to
disable a PIRQ, we actually need to get the HV to mask it out on the IOAPIC.
This patch does exactly that; on disable_pirq(), we actually just call out to
shutdown_pirq(), which ends up hypercalling and getting the HV to mask out the
interrupt.  On the other side, I needed to modify enable_pirq() to call out to
startup_pirq(), so that it would actually allocate the event channel.

With this patch in place, the affected laptop no longer hangs up when the kernel
decides to disable that particular interrupt line.

Signed-off-by: Chris Lalancette <clalance@redhat.com>

[-- Attachment #2: linux-2.6.18-evtchn-disable-pirq.patch --]
[-- Type: text/x-patch, Size: 587 bytes --]

--- linux-2.6.18.noarch/drivers/xen/core/evtchn.c.orig
+++ linux-2.6.18.noarch/drivers/xen/core/evtchn.c
@@ -629,20 +629,12 @@ static void shutdown_pirq(unsigned int i
 
 static void enable_pirq(unsigned int irq)
 {
-	int evtchn = evtchn_from_irq(irq);
-
-	if (VALID_EVTCHN(evtchn)) {
-		unmask_evtchn(evtchn);
-		pirq_unmask_notify(irq_to_pirq(irq));
-	}
+	startup_pirq(irq);
 }
 
 static void disable_pirq(unsigned int irq)
 {
-	int evtchn = evtchn_from_irq(irq);
-
-	if (VALID_EVTCHN(evtchn))
-		mask_evtchn(evtchn);
+	shutdown_pirq(irq);
 }
 
 static void ack_pirq(unsigned int irq)

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2007-11-14 19:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-14 19:10 Chris Lalancette [this message]
2007-11-15  6:01 ` [PATCH]: Really disable pirq's Jiang, Yunhong
2007-11-15 14:10   ` Chris Lalancette
2007-11-15 14:37     ` Keir Fraser
2007-11-16  3:44     ` Jiang, Yunhong
2007-11-16 17:34 ` Keir Fraser
2007-11-16 22:12   ` Chris Lalancette
2007-11-20 21:13   ` Chris Lalancette

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=473B4840.4080502@redhat.com \
    --to=clalance@redhat.com \
    --cc=xen-devel@lists.xensource.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.