lkml.org 
[lkml]   [2011]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH -rt] genirq: IRQF_NODELAY must be consistent between shared irqs
From
On Mon, Jan 17, 2011 at 10:33 PM, Yong Zhang <yong.zhang0@gmail.com> wrote:
> IRQF_NODELAY can not be messed up for shared irqs, because if
> one of the regestered irq can be threaded, irq_desc->status will
> set with IRQ_ONESHOT. Thus when irq is triggered, the
> none-threaded one will warn with warn_no_thread().

Precisely, this occurs when we first register a threaded action,
then register another one with IRQF_NODELAY. When irq
for the second one is coming, warn_no_thread() will yell on
it.

Thanks,
Yong

>
> So let __setup_irq fail if IRQF_NODELAY is not consistent between
> them.
>
> Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> ---
>  kernel/irq/manage.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
> index cda70cb..7ce9050 100644
> --- a/kernel/irq/manage.c
> +++ b/kernel/irq/manage.c
> @@ -797,10 +797,11 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
>                 * Can't share interrupts unless both agree to and are
>                 * the same type (level, edge, polarity). So both flag
>                 * fields must have IRQF_SHARED set and the bits which
> -                * set the trigger type must match.
> +                * set the trigger type and IRQF_NODELAY must match.
>                 */
>                if (!((old->flags & new->flags) & IRQF_SHARED) ||
> -                   ((old->flags ^ new->flags) & IRQF_TRIGGER_MASK)) {
> +                   ((old->flags ^ new->flags) & (IRQF_TRIGGER_MASK |
> +                                                 IRQF_NODELAY))) {
>                        old_name = old->name;
>                        goto mismatch;
>                }
> --
> 1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-01-18 08:29    [W:0.028 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site