From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753585AbYJ0ViW (ORCPT ); Mon, 27 Oct 2008 17:38:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752127AbYJ0ViG (ORCPT ); Mon, 27 Oct 2008 17:38:06 -0400 Received: from smtp115.sbc.mail.sp1.yahoo.com ([69.147.64.88]:42581 "HELO smtp115.sbc.mail.sp1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751474AbYJ0ViF (ORCPT ); Mon, 27 Oct 2008 17:38:05 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=pacbell.net; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:Subject:Date:User-Agent:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-Disposition:Message-Id; b=CsH9J8xWUuP6NxRlorwWVAC6TFOdR643+lLOj5yd2EFD2/Qh5/x5FQupNCN+WX0JWxWRDOk0uWKpF+7tzYUcdbzLQDsl+hiabCx6nq1SIktfUgsW+2Z/CBWn7p47TvKmxjrrcNmbLbalRctsfdjhDleht4Hs+v7ARUIzPUsk8g8= ; X-YMail-OSG: JWQ9e5kVM1n0Nizv.aIZbWadTCPT1m5090PXiiMQvEGNeiJqqUX0qu2PnOx8KKAFtFyaAm06nmI9mzB4FMmdimWKolQOpdexsE9nBYzj2vOX.JjVFiXnqZbOqN3CrmzE86H1c7VlNhH7OTPUEH1V.1ax X-Yahoo-Newman-Property: ymail-3 From: David Brownell To: lkml Subject: [patch/RESEND 2.6.28-rc2] genirq: warn when IRQF_DISABLED may be ignored Date: Mon, 27 Oct 2008 13:48:53 -0700 User-Agent: KMail/1.9.10 Cc: Thomas Gleixner , Ingo Molnar MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200810271348.53492.david-b@pacbell.net> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Brownell We periodically waste time tracking down problems from the genirq framework not respecting IRQF_DISABLED for some shared IRQ cases. Linus views this as "will not fix", but we're still left with the bugs caused by this misbehavior. This patch adds a nag message in request_irq(), so that drivers can fix their IRQ handlers to avoid this problem. Note that developers will never see the relevant bugs when they run with LOCKDEP, so it's no wonder these bugs are hard to find. (That also means LOCKDEP is overlooking some IRQ-related bugs involving IRQ handlers that don't set IRQF_DISABLED...) Signed-off-by: David Brownell --- kernel/irq/manage.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -635,6 +635,18 @@ int request_irq(unsigned int irq, irq_ha 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: