From: Chuansheng Liu <chuansheng.liu@intel.com>
To: tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org, chuansheng.liu@intel.com
Subject: [PATCH] genirq: Give warning when setup an already-setup non-shared irq
Date: Thu, 10 Jan 2013 23:55:01 +0800 [thread overview]
Message-ID: <1357833301.21958.10.camel@cliu38-desktop-build> (raw)
Meet the case when the request_threaded_irq() with the same irq
is called twice continually, get the below mismatch info:
"IRQ handler type mismatch for IRQ 323"
Here give a right warning that like below:
"Trying to setup already-setup non-shared IRQ 323"
Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
---
kernel/irq/manage.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index e49a288..6802ce1 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -999,6 +999,16 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
old_ptr = &desc->action;
old = *old_ptr;
if (old) {
+ /* Give warning when setup an irq which has been setup
+ * already.
+ */
+ if (!(old->flags & IRQF_SHARED)) {
+ ret = -EINVAL;
+ WARN(1, "Trying to setup already-setup non-shared IRQ %d\n",
+ irq);
+ goto out_mask;
+ }
+
/*
* Can't share interrupts unless both agree to and are
* the same type (level, edge, polarity). So both flag
--
1.7.0.4
next reply other threads:[~2013-01-10 6:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-10 15:55 Chuansheng Liu [this message]
2013-01-14 11:16 ` Thomas Gleixner
2013-01-15 0:54 ` Liu, Chuansheng
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=1357833301.21958.10.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
all inboxes | Powered by JetHome®