Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752527AbZK0VKH (ORCPT ); Fri, 27 Nov 2009 16:10:07 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751971AbZK0VKH (ORCPT ); Fri, 27 Nov 2009 16:10:07 -0500 Received: from metis.ext.pengutronix.de ([92.198.50.35]:47006 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750956AbZK0VKG (ORCPT ); Fri, 27 Nov 2009 16:10:06 -0500 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: linux-kernel@vger.kernel.org Cc: David Brownell , Andrew Morton , Peter Zijlstra , Ingo Molnar , Nicolas Pitre , Eric Miao , John Stultz , Rusty Russell , linux-arm-kernel@lists.infradead.org Subject: [PATCH] warn about shared irqs requesting IRQF_DISABLED registered with setup_irq Date: Fri, 27 Nov 2009 22:10:06 +0100 Message-Id: <1259356206-14843-1-git-send-email-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 1.6.5.2 In-Reply-To: <20091127195857.GB28193@n2100.arm.linux.org.uk> References: <20091127195857.GB28193@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:6f8:1178:2:215:17ff:fe12:23b0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2709 Lines: 77 IRQF_DISABLED is not guaranteed on shared irqs. There is already a warning in place for irqs registered with request_irq (introduced in 470c66239ef03). Move it to __setup_irq, this way it triggers for both request_irq and setup_irq. One irq that is now warned about is the timer tick on at91 (ARCH=arm). Signed-off-by: Uwe Kleine-König Cc: David Brownell Cc: Andrew Morton Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Nicolas Pitre Cc: Eric Miao Cc: John Stultz Cc: Rusty Russell Cc: Remy Bohmer , Cc: Hugh Dickins , Cc: Andrea Gallo , Cc: Thomas Gleixner , Cc: linux-arm-kernel@lists.infradead.org --- kernel/irq/manage.c | 26 +++++++++++++------------- 1 files changed, 13 insertions(+), 13 deletions(-) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index bde4c66..59f4b54 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -613,6 +613,19 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) int nested, shared = 0; int ret; + /* + * handle_IRQ_event() always ignores IRQF_DISABLED except for + * the _first_ irqaction (sigh). That can cause oopsing, but + * the behavior is classified as "will not fix" so we need to + * start nudging drivers away from using that idiom. + */ + if ((new->flags & (IRQF_SHARED|IRQF_DISABLED)) == + (IRQF_SHARED|IRQF_DISABLED)) { + pr_warning( + "IRQ %d/%s: IRQF_DISABLED is not guaranteed on shared IRQs\n", + irq, new->name); + } + if (!desc) return -EINVAL; @@ -1008,19 +1021,6 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler, struct irq_desc *desc; int retval; - /* - * handle_IRQ_event() always ignores IRQF_DISABLED except for - * the _first_ irqaction (sigh). That can cause oopsing, but - * the behavior is classified as "will not fix" so we need to - * start nudging drivers away from using that idiom. - */ - if ((irqflags & (IRQF_SHARED|IRQF_DISABLED)) == - (IRQF_SHARED|IRQF_DISABLED)) { - pr_warning( - "IRQ %d/%s: IRQF_DISABLED is not guaranteed on shared IRQs\n", - irq, devname); - } - #ifdef CONFIG_LOCKDEP /* * Lockdep wants atomic interrupt handlers: -- 1.6.5.2 -- 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/