WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH]: Really disable pirq's

To: Chris Lalancette <clalance@xxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH]: Really disable pirq's
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Fri, 16 Nov 2007 17:34:51 +0000
Delivery-date: Fri, 16 Nov 2007 09:35:56 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <473B4840.4080502@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acgodv3WPDQ7t5RqEdywRgAX8io7RQ==
Thread-topic: [Xen-devel] [PATCH]: Really disable pirq's
User-agent: Microsoft-Entourage/11.3.6.070618
Chris,

Could you try the alternative attached patch? It's not been build or run
tested, but hopefully you can see the gist of what's going on. Basically, in
case the irq is edge-triggered, I want to have an 'edge in hand' before we
actually shutdown the irq.

 -- Keir

On 14/11/07 19:10, "Chris Lalancette" <clalance@xxxxxxxxxx> wrote:

> 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@xxxxxxxxxx>
> --- 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)
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel

Attachment: pirq_disable.patch
Description: Binary data

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