From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Rogier Wolff <R.E.Wolff@BitWizard.nl>
Cc: Jeff Garzik <jeff@garzik.org>,
alan@redhat.com, Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 05/15] drivers/char: minor irq handler cleanups
Date: Tue, 22 Apr 2008 20:46:08 +1000 [thread overview]
Message-ID: <1208861168.9640.109.camel@pasglop> (raw)
In-Reply-To: <20080422101326.GD23482@bitwizard.nl>
On Tue, 2008-04-22 at 12:13 +0200, Rogier Wolff wrote:
> > You should let the kernel generic code deal with the runaway
> interrupt,
> > it should be capable of doing so nowadays pretty reliably.
> >
> > free_irq() is definitely not going to be happy when it start messing
> > with /proc from an interrupt... It will at least give you a WARN_ON.
>
> The situation is NOT normal operation. It is an emergency measure in
> an attempt to prevent a full hang. It is great that other parts of the
> kernel also "shout" that something is wrong.
But free_irq at interrupt time has great chances of crashing the machine
or currupting data structures in subtle ways. You should -not- do that.
Either let the kernel handle the runaway interrupt, or eventually if you
want to be brutal, call disable_irq_nosync yourself, but not free_irq.
> Consider it similar to a "kernel null pointer dereference". Once that
> happens, all bets are off. In practise you've probably seen one, and
> you were able to continue to work. It is advisable to save everything
> you can, and reboot. This is similar.
It would be if you used something like disable_irq_nosync. Not free_irq.
The later is just bogus.
> The "generic code for runaway interrupts" didn't exist when this was
> written. If it exists, and works for the case that this was written
> for, then all is fine, and we can remove my code. As you can see, I
> copied over the code from one driver to the next after I got bitten
> again with the second driver. So having something generic is of course
> preferable. :-)
Well, if you know how to trigger the bug, it would be useful to verify
that the kernel generic code properly detects and masks the runaway
interrupt. If that works, then remove your code completely. If not, it
would be useful to figure out why :-) But either way, just replace it
with disable_irq_nosync.
Cheers,
Ben.
next prev parent reply other threads:[~2008-04-22 10:46 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-18 23:22 [PATCH 01/15] ARM minor irq handler cleanups Jeff Garzik
2008-04-18 23:22 ` [PATCH 02/15] [SPARC] " Jeff Garzik
2008-04-18 23:33 ` David Miller
2008-04-18 23:22 ` [PATCH 03/15] [BLACKFIN] " Jeff Garzik
2008-04-22 3:27 ` Bryan Wu
2008-04-18 23:22 ` [PATCH 04/15] [PPC] " Jeff Garzik
2008-04-19 14:57 ` Kumar Gala
2008-04-18 23:22 ` [PATCH 05/15] drivers/char: " Jeff Garzik
2008-04-19 6:00 ` Rogier Wolff
2008-04-22 8:05 ` Benjamin Herrenschmidt
2008-04-22 10:13 ` Rogier Wolff
2008-04-22 10:46 ` Benjamin Herrenschmidt [this message]
2008-04-19 16:16 ` Alan Cox
2008-04-21 1:38 ` Jeff Garzik
2008-04-18 23:22 ` [PATCH 06/15] [SCSI] " Jeff Garzik
2008-04-18 23:22 ` [PATCH 07/15] [SCSI] aha1542: " Jeff Garzik
2008-04-18 23:22 ` [PATCH 08/15] [ISDN] " Jeff Garzik
2008-04-18 23:22 ` [PATCH 09/15] [AVR32] remove unused 'irq' argument from local_timer_interrupt() Jeff Garzik
2008-04-18 23:22 ` [PATCH 10/15] [IA64] minor irq handler cleanups Jeff Garzik
2008-04-18 23:23 ` [PATCH 11/15] [RTC] " Jeff Garzik
2008-04-18 23:23 ` [PATCH 12/15] [MIPS] pmc-sierra/msp71xx/msp_hwbutton.c: " Jeff Garzik
2008-04-28 20:53 ` Ralf Baechle
2008-04-18 23:23 ` [PATCH 13/15] [X86] standard vm86 irq handler Jeff Garzik
2008-04-21 13:52 ` Ingo Molnar
2008-04-18 23:23 ` [PATCH 14/15] Canonicalize several irq handlers Jeff Garzik
2008-04-18 23:23 ` [PATCH 15/15] [INPUT, PCMCIA] avoid use of 'irq' function arg Jeff Garzik
2008-04-18 23:29 ` [PATCH 01/15] ARM minor irq handler cleanups Lennert Buytenhek
2008-04-19 0:25 ` Jeff Garzik
2008-04-19 16:14 ` Lennert Buytenhek
2008-04-18 23:44 ` Andrew Morton
2008-04-19 0:21 ` Jeff Garzik
2008-04-19 1:17 ` Andrew Morton
2008-04-20 22:17 ` Jeff Garzik
2008-04-20 22:40 ` Russell King
2008-04-20 22:49 ` Jeff Garzik
2008-04-19 8:17 ` Russell King
2008-04-19 8:28 ` Jeff Garzik
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=1208861168.9640.109.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=R.E.Wolff@BitWizard.nl \
--cc=akpm@linux-foundation.org \
--cc=alan@redhat.com \
--cc=jeff@garzik.org \
--cc=linux-kernel@vger.kernel.org \
/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