* [PATCH] genirq: Fix the case of irqflag with IRQF_SHARED and IRQF_NO_THREAD
@ 2012-11-13 17:02 Chuansheng Liu
0 siblings, 0 replies; only message in thread
From: Chuansheng Liu @ 2012-11-13 17:02 UTC (permalink / raw)
To: tglx; +Cc: linux-kernel
When one shared irq is requested as below:
req1: request_irq(irqnb, cb1, IRQF_SHARED, ...);
then:
req2: request_irq(irqnb, cb2, IRQF_SHARED|IRQF_NO_THREAD, ...);
Both req1 and req2 will be successful.
But if we passed threadirqs in commandline, and executing req1 and req2,
the req2 will fail. The reason is req1 without IRQF_NO_THREAD, then
the IRQF_ONESHOT will be added into flag, while req2 will has no IRQS_ONESHOT
flag, it cause type mismatch case for shared interrupt.
Here add the check of agreeing on NO_THREAD, to make sure the req1/req2
can work well for both scenerio.
Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
---
kernel/irq/manage.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 4c69326..dda0f26 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -971,7 +971,8 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
*/
if (!((old->flags & new->flags) & IRQF_SHARED) ||
((old->flags ^ new->flags) & IRQF_TRIGGER_MASK) ||
- ((old->flags ^ new->flags) & IRQF_ONESHOT))
+ ((old->flags ^ new->flags) & IRQF_ONESHOT) ||
+ ((old->flags ^ new->flags) & IRQF_NO_THREAD))
goto mismatch;
/* All handlers must agree on per-cpuness */
--
1.7.0.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-11-13 8:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-13 17:02 [PATCH] genirq: Fix the case of irqflag with IRQF_SHARED and IRQF_NO_THREAD Chuansheng Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).