Re: pcmcia oops on 2.6.17-rc[12]

From: Linus Torvalds
Date: Mon May 15 2006 - 19:52:16 EST




On Mon, 15 May 2006, Linus Torvalds wrote:
>
> On Tue, 16 May 2006, Alan Cox wrote:
> >
> > It would certainly be a lot cleaner than this sort of code in the
> > pcmcia core right now. Want me to send a patch which only allows for
> > SA_SHIRQ and WARN_ON()'s for any driver not asking for shared IRQ ?
>
> I think it's too late for that in the current series, but yes, we could do
> it for 2.6.18.

Actually, thinking about it some more, what we _should_ do is to just make
any code that simply doesn't _work_ with shared interrupts have to use
SA_EXCLUSIVE.

And then, for a while, warn if we see a "request_irq()" call that has
neither SA_SHIRQ nor SA_EXCLUSIVE set. But this would be a pretty mild
warning, along the lines of

"%s getting non-SHIRQ irq. It _may_ or may not be shared in the future"

and eventually just stop caring, and making SA_SHIRQ have no meaning. It's
kind of pointless to ask all drivers to use SA_SHIRQ, when it really
should be the default.

Even the ISA drivers that currently do not have SA_SHIRQ won't generally
_break_ when/if they were to get a shared interrupt. The reason they don't
have SA_SHIRQ isn't generally that they really really want an exclusive
interrupt, but simply because they never had a reason to say SA_SHIRQ.

So a lack of SA_SHIRQ doesn't generally mean "I _need_ an exclusive
interrupt". It could equally well mean "I never bothered to even think
about whether I could share interrupts or not".

Making it an error to pass in 0 would be silly, because for old ISA
devices, most of the time they really just don't care.

What think you?

The SA_EXCLUSIVE flag is still needed, but it would be used by things that
literally cannot handle anything but an exclusive interrupt (eg vm86 mode
irq access), exactly because they do things like disable that particular
irq for long times, or because they don't have a status register to read
(eg, on x86, the timer interrupt really _is_ exclusive for that reason).

Most ISA drivers probably wouldn't care at all one way or the other, I
suspect. And it would be a waste of time to add SA_SHIRQ to them for no
actual real gain.

Comments?

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/