mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -rt] genirq: IRQF_NODELAY must be consistent between shared irqs
@ 2011-01-17 14:33 Yong Zhang
  2011-01-18  7:26 ` Yong Zhang
  0 siblings, 1 reply; 2+ messages in thread
From: Yong Zhang @ 2011-01-17 14:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner

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().

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH -rt] genirq: IRQF_NODELAY must be consistent between shared irqs
  2011-01-17 14:33 [PATCH -rt] genirq: IRQF_NODELAY must be consistent between shared irqs Yong Zhang
@ 2011-01-18  7:26 ` Yong Zhang
  0 siblings, 0 replies; 2+ messages in thread
From: Yong Zhang @ 2011-01-18  7:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-18  7:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-17 14:33 [PATCH -rt] genirq: IRQF_NODELAY must be consistent between shared irqs Yong Zhang
2011-01-18  7:26 ` Yong Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®