From: Chuansheng Liu <chuansheng.liu@intel.com>
To: tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] genirq: Fix the case of irqflag with IRQF_SHARED and IRQF_NO_THREAD
Date: Wed, 14 Nov 2012 01:02:55 +0800 [thread overview]
Message-ID: <1352826175.15558.1662.camel@cliu38-desktop-build> (raw)
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
reply other threads:[~2012-11-13 8:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1352826175.15558.1662.camel@cliu38-desktop-build \
--to=chuansheng.liu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).