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

[PATCH] x86: Fix S3 resume for HPET MSI IRQ case (RE: [Xen-devel] x86 HP

To: "Gang Wei" <gang.wei@xxxxxxxxx>
Subject: [PATCH] x86: Fix S3 resume for HPET MSI IRQ case (RE: [Xen-devel] x86 HPET MSI IRQs vs resume from S3)
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Mon, 14 Feb 2011 09:59:54 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <keir@xxxxxxx>
Delivery-date: Mon, 14 Feb 2011 02:03:08 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <F26D193E20BBDC42A43B611D1BDEDE71259FDE5AD6@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4D42992E020000780002F1E4@xxxxxxxxxxxxxxxxxx> <F26D193E20BBDC42A43B611D1BDEDE71259FDE5AD6@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>>> On 14.02.11 at 10:30, "Wei, Gang" <gang.wei@xxxxxxxxx> wrote:
> x86: Fix S3 resume for HPET MSI IRQ case
> 
> Jan Beulich found that for S3 resume on platforms without ARAT feature but 
> with MSI capable HPET, request_irq() will be called in hpet_setup_msi_irq() 
> for irq already setup(no release_irq() called during S3 suspend), so that 
> always falling back to using legacy_hpet_event.
> 
> Fix it by conditional calling request_irq() for 4.1. Planned to split the S3 
> resume path from booting path post 4.1, as Jan suggested.
> 
> Signed-off-by: Wei Gang <gang.wei@xxxxxxxxx>

Acked-by: Jan Beulich <jbeulich@xxxxxxxxxx>

> diff -r 67f2fed57034 xen/arch/x86/hpet.c
> --- a/xen/arch/x86/hpet.c       Fri Feb 11 18:22:37 2011 +0000
> +++ b/xen/arch/x86/hpet.c       Tue Feb 15 14:48:54 2011 +0800
> @@ -367,12 +367,20 @@ static int hpet_setup_msi_irq(unsigned i
>      int ret;
>      struct msi_msg msg;
>      struct hpet_event_channel *ch = &hpet_events[irq_to_channel(irq)];
> -
> -    irq_desc[irq].handler = &hpet_msi_type;
> -    ret = request_irq(irq, hpet_interrupt_handler,
> -                      0, "HPET", ch);
> -    if ( ret < 0 )
> -        return ret;
> +    irq_desc_t *desc = irq_to_desc(irq);
> +
> +    if ( desc->handler == &no_irq_type )
> +    {
> +        desc->handler = &hpet_msi_type;
> +        ret = request_irq(irq, hpet_interrupt_handler,
> +                          0, "HPET", ch);
> +        if ( ret < 0 )
> +            return ret;
> +    }
> +    else if ( desc->handler != &hpet_msi_type )
> +    {
> +        return -EINVAL;
> +    }
>  
>      msi_compose_msg(NULL, irq, &msg);
>      hpet_msi_write(irq, &msg);
> 
> Jimmy
> 
> Jan Beulich wrote on 2011-01-28:
>> Going through hpet_broadcast_init(), I see that hpet_setup_msi_irq()
>> gets called during resume, thus causing setup_irq() to be called. I'm
>> failing to spot the corresponding release_irq(), and hence I can't see
>> how this whole code path is supposed to work during resume (other than
>> always falling back to using legacy_hpet_event). Instead I'm wondering
>> whether in the resume case only msi_compose_msg()/
>> hpet_msi_write() should be called for each IRQ used rather than the
>> whole hpet_broadcast_init().




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

<Prev in Thread] Current Thread [Next in Thread>