2013-04-29 19:40:11

by Julien Grall

[permalink] [raw]
Subject: [PATCH] xen: clear IRQ_NOAUTOEN and IRQ_NOREQUEST when a VIRQ is bound

Reset the IRQ_NOAUTOEN and IRQ_NOREQUEST flags that are enabled by
default on ARM. If IRQ_NOAUTOEN is set, __setup_irq doesn't call
irq_startup, that is responsible for calling irq_unmask at startup time.
As a result event channels remain masked.

The clear is already made in bind_evtchn_to_irq with commit a8636c0 but was
missing in bind_virq_to_irq.

Signed-off-by: Julien Grall <[email protected]>
---
drivers/xen/events.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index d8cc812..b0ad226 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -994,6 +994,7 @@ int bind_virq_to_irq(unsigned int virq, unsigned int cpu)
WARN_ON(info == NULL || info->type != IRQT_VIRQ);
}

+ irq_clear_status_flags(irq, IRQ_NOREQUEST|IRQ_NOAUTOEN);
out:
mutex_unlock(&irq_mapping_update_lock);

--
1.7.10.4


2013-04-30 15:02:49

by Stefano Stabellini

[permalink] [raw]
Subject: Re: [PATCH] xen: clear IRQ_NOAUTOEN and IRQ_NOREQUEST when a VIRQ is bound

On Mon, 29 Apr 2013, Julien Grall wrote:
> Reset the IRQ_NOAUTOEN and IRQ_NOREQUEST flags that are enabled by
> default on ARM. If IRQ_NOAUTOEN is set, __setup_irq doesn't call
> irq_startup, that is responsible for calling irq_unmask at startup time.
> As a result event channels remain masked.
>
> The clear is already made in bind_evtchn_to_irq with commit a8636c0 but was
> missing in bind_virq_to_irq.
>
> Signed-off-by: Julien Grall <[email protected]>

As in the original commit, you should point out that this change does
not have any effects on x86 (where IRQ_NOREQUEST and IRQ_NOAUTOEN are
cleared by default).

At this point we might as well do this consistently everywhere we
allocate a new evtchn irq, including pirqs and ipis, even though we don't
actually use them on ARM.

If the call to irq_clear_status_flags can be moved earlier, a good place
for it could be xen_irq_init.


> drivers/xen/events.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/xen/events.c b/drivers/xen/events.c
> index d8cc812..b0ad226 100644
> --- a/drivers/xen/events.c
> +++ b/drivers/xen/events.c
> @@ -994,6 +994,7 @@ int bind_virq_to_irq(unsigned int virq, unsigned int cpu)
> WARN_ON(info == NULL || info->type != IRQT_VIRQ);
> }
>
> + irq_clear_status_flags(irq, IRQ_NOREQUEST|IRQ_NOAUTOEN);
> out:
> mutex_unlock(&irq_mapping_update_lock);

2013-04-30 15:15:40

by Julien Grall

[permalink] [raw]
Subject: Re: [PATCH] xen: clear IRQ_NOAUTOEN and IRQ_NOREQUEST when a VIRQ is bound

On 04/30/2013 04:02 PM, Stefano Stabellini wrote:

> On Mon, 29 Apr 2013, Julien Grall wrote:
>> Reset the IRQ_NOAUTOEN and IRQ_NOREQUEST flags that are enabled by
>> default on ARM. If IRQ_NOAUTOEN is set, __setup_irq doesn't call
>> irq_startup, that is responsible for calling irq_unmask at startup time.
>> As a result event channels remain masked.
>>
>> The clear is already made in bind_evtchn_to_irq with commit a8636c0 but was
>> missing in bind_virq_to_irq.
>>
>> Signed-off-by: Julien Grall <[email protected]>
>
> As in the original commit, you should point out that this change does
> not have any effects on x86 (where IRQ_NOREQUEST and IRQ_NOAUTOEN are
> cleared by default).
>
> At this point we might as well do this consistently everywhere we
> allocate a new evtchn irq, including pirqs and ipis, even though we don't
> actually use them on ARM.
>
> If the call to irq_clear_status_flags can be moved earlier, a good place
> for it could be xen_irq_init.


Thanks for the review. I will give a try and send a version with it if
the solution works.

--
Julien