lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 28 Oct 2008 12:41:24 -0700
From:	David Brownell <david-b@...bell.net>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Pierre Ossman <drzeus-mmc@...eus.cx>,
	lkml <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
	Russell King <rmk@....linux.org.uk>,
	Nicolas Ferre <nicolas.ferre@....atmel.com>,
	Andrew Victor <linux@...im.org.za>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [patch 2.6.28-rc2] at91_mci: workaround lockdep

On Tuesday 28 October 2008, Peter Zijlstra wrote:
> > > > Workaround: depend on LOCKDEP=n ... 
> > > 
> > > In all previous such cases it was deemed the IRQ handler should deal
> > > with whatever it gets.
> > 
> > In which case I'll wait until someone changes that IRQ handler (or that
> > ARM MM utility, or lockdep), and give up using AT91 platforms for sanity
> > testing kernel changes; lockdep is important, when it doesn't lie.
> > 
> > I do think that lockdep should warn when that it's ignoring such driver
> > requests, however.  I seem to have been tripping over it a lot lately,
> > and knowing that IRQ handlers were using strange modes would have saved
> > a bunch of time from being wasted.
> > 
> > Threaded IRQ handlers are going to need to rely even more on running
> > with IRQs enabled ... not to mention needing to sleep.  So it's clear
> > to me that there *are* lockdep issues yet to be addressed here.
> 
> Sure, care so send a patch fixing those? :-)

Here's one for the warning; that's the only one straightforward enough
to justify detouring from Real Work.  Plus, the IRQ threading patches
aren't that near a merge queue yet.  ;)

- Dave


========================== CUT HERE
From: David Brownell <dbrownell@...rs.sourceforge.net>

When lockdep turns on IRQF_DISABLED, emit a warning to make it
easier to track down problems this introduces in drivers that
expect handlers to run with IRQs enabled.

Signed-off-by: David Brownell <dbrownell@...rs.sourceforge.net>
---
 kernel/irq/manage.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -681,7 +681,11 @@ int request_irq(unsigned int irq, irq_ha
 	/*
 	 * Lockdep wants atomic interrupt handlers:
 	 */
-	irqflags |= IRQF_DISABLED;
+	if (!(irqflags & IRQF_DISABLED)) {
+		pr_warning("IRQ %d/%s: lockdep sets IRQF_DISABLED\n",
+				irq, devname);
+		irqflags |= IRQF_DISABLED;
+	}
 #endif
 	/*
 	 * Sanity-check: shared interrupts must pass in a real dev-ID,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ