From: Andrew Morton <akpm@digeo.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: felipe_alfaro@linuxmail.org, linux-kernel@vger.kernel.org
Subject: Re: 2.5.64-mm1: Badness in request_irq
Date: Thu, 6 Mar 2003 21:53:12 -0800 [thread overview]
Message-ID: <20030306215312.0c7ed05d.akpm@digeo.com> (raw)
In-Reply-To: <1047015055.1538.7.camel@ixodes.goop.org>
Jeremy Fitzhardinge <jeremy@goop.org> wrote:
>
> On Thu, 2003-03-06 at 06:18, Felipe Alfaro Solana wrote:
> > Hello,
> >
> > I have just installed and compiled 2.5.64-mm1 using gcc-3.2.2 and,
> > when booting the system, I have found the
> > following error on the kernel ring:
> >
> > Badness in request_irq at arch/i386/kernel/irq.c:475
> > Call Trace: [<c010afdd>] [<d08b3d3a>] [<d08b18c0>] [<d08b42c8>] [<d08b024e>] [<d08b42b0>]
> > [<d08b49c0>] [<d08b49e8>] [<c0191d6e>] [<d08b496c>] [<d08b49e8>] [<c01947f5>] [<d08b49e8>]
> > [<c019491c>] [<d08b49e8>] [<d08b4a04>] [<c0194c10>] [<d08b49e8>] [<d08bb160>] [<c0194fff>]
> > [<d08b49e8>] [<c0191eab>] [<d08b49e8>] [<d08a0019>] [<d08b49c0>] [<d08bb160>] [<c01302cd>]
> > [<c010969e>]
>
> I'm getting this as well on both my desktop and laptop machines.
>
Yeah, sorry. Any request_irq(SA_INTERRUPT|SA_SHIRQ) call will do this.
The problem is that when an SA_INTERRUPT handler shares with a
non-SA_INTERRUPT one, the result is basically meaningless. The SA_INTERRUPT
handler may (or may not) get executed with interrupts off.
So the intent was to drop a warning saying "hey, someone is being silly
here".
And it _is_ silly, because what the caller is saying is "I want my handler to
run with interrupts disabled, but I am also prepared to share the IRQ with
damn near any other interrupt handler in the kernel".
That warning has to go. My current thinking is as follows:
- Each time a handler is registered or removed from the chain, we walk the
IRQ chain and propogate some accumulated info into the controlling
irq_desc_t.
- If all handlers in the chain are SA_INTERRUPT then the entire chain is
run with irqs disabled.
- If _any_ handler is !SA_INTERRUPT then all handlers are run with IRQs
enabled.
This gives sane and documentable semantics. It also means that any
SA_INTERRUPT handler which is also SA_SHIRQ _must_ be prepared to be called
with irq's enabled. That is already the case: it is merely being formalised.
If a handler MUST be run with interrupts disabled (for atomicity reasons,
say) then it cannot share. That's the caller's responsibility.
(One might argue that if any handlers in the chain are SA_INTERRUPT then all
handlers should run with irq's off. Problem is, the !SA_INTERRUPT handlers
could easily be doing foo_lock_irq()/foo_unlock_irq(), because they think
they were called with irq's enabled).
It's all a bit murky.
next prev parent reply other threads:[~2003-03-07 5:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-06 14:18 Felipe Alfaro Solana
2003-03-07 5:30 ` Jeremy Fitzhardinge
2003-03-07 5:53 ` Andrew Morton [this message]
2003-03-07 13:01 ` Alan Cox
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=20030306215312.0c7ed05d.akpm@digeo.com \
--to=akpm@digeo.com \
--cc=felipe_alfaro@linuxmail.org \
--cc=jeremy@goop.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
all inboxes | Powered by JetHome®