LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] pcmcia: irq probe can be done without risking an IRQ storm
@ 2007-04-05 13:09 Alan Cox
2007-04-26 4:18 ` Andrew Morton
0 siblings, 1 reply; 4+ messages in thread
From: Alan Cox @ 2007-04-05 13:09 UTC (permalink / raw)
To: akpm, linux-kernel
Nowdays you can ask for an IRQ to be allocated but not enabled, when
PCMCIA was written this was not true and this feature is thus not used
Signed-off-by: Alan Cox <alan@redhat.com>
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.21-rc5-mm4/drivers/pcmcia/pcmcia_resource.c linux-2.6.21-rc5-mm4/drivers/pcmcia/pcmcia_resource.c
--- linux.vanilla-2.6.21-rc5-mm4/drivers/pcmcia/pcmcia_resource.c 2007-04-03 16:52:14.000000000 +0100
+++ linux-2.6.21-rc5-mm4/drivers/pcmcia/pcmcia_resource.c 2007-04-03 17:10:42.000000000 +0100
@@ -810,8 +810,11 @@
type = IRQF_SHARED;
if (req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)
type = IRQF_SHARED;
#ifdef CONFIG_PCMCIA_PROBE
+ if (!(req->Attributes & IRQ_HANDLE_PRESENT))
+ type |= IRQ_NOAUTOEN;
+
if (s->irq.AssignedIRQ != 0) {
/* If the interrupt is already assigned, it must be the same */
irq = s->irq.AssignedIRQ;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pcmcia: irq probe can be done without risking an IRQ storm
2007-04-05 13:09 [PATCH] pcmcia: irq probe can be done without risking an IRQ storm Alan Cox
@ 2007-04-26 4:18 ` Andrew Morton
2007-04-26 17:31 ` Thomas Gleixner
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2007-04-26 4:18 UTC (permalink / raw)
To: Alan Cox; +Cc: linux-kernel
On Thu, 5 Apr 2007 14:09:36 +0100 Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> Nowdays you can ask for an IRQ to be allocated but not enabled, when
> PCMCIA was written this was not true and this feature is thus not used
>
> Signed-off-by: Alan Cox <alan@redhat.com>
>
> diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.21-rc5-mm4/drivers/pcmcia/pcmcia_resource.c linux-2.6.21-rc5-mm4/drivers/pcmcia/pcmcia_resource.c
> --- linux.vanilla-2.6.21-rc5-mm4/drivers/pcmcia/pcmcia_resource.c 2007-04-03 16:52:14.000000000 +0100
> +++ linux-2.6.21-rc5-mm4/drivers/pcmcia/pcmcia_resource.c 2007-04-03 17:10:42.000000000 +0100
> @@ -810,8 +810,11 @@
> type = IRQF_SHARED;
> if (req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)
> type = IRQF_SHARED;
> #ifdef CONFIG_PCMCIA_PROBE
> + if (!(req->Attributes & IRQ_HANDLE_PRESENT))
> + type |= IRQ_NOAUTOEN;
> +
> if (s->irq.AssignedIRQ != 0) {
> /* If the interrupt is already assigned, it must be the same */
> irq = s->irq.AssignedIRQ;
alpha:
drivers/pcmcia/pcmcia_resource.c: In function 'pcmcia_request_irq':
drivers/pcmcia/pcmcia_resource.c:816: error: 'IRQ_NOAUTOEN' undeclared (first use in this function)
drivers/pcmcia/pcmcia_resource.c:816: error: (Each undeclared identifier is reported only once
drivers/pcmcia/pcmcia_resource.c:816: error: for each function it appears in.)
Problem is, IRQ_NOAUTOEN is a generic-irq thing, so architectures which
don't use generic-irqs break. And it's defined in linux/irq.h which
(stupidly) cannot be included in generic code.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pcmcia: irq probe can be done without risking an IRQ storm
2007-04-26 4:18 ` Andrew Morton
@ 2007-04-26 17:31 ` Thomas Gleixner
2007-04-26 19:06 ` Thomas Gleixner
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Gleixner @ 2007-04-26 17:31 UTC (permalink / raw)
To: Andrew Morton; +Cc: Alan Cox, linux-kernel
On Wed, 2007-04-25 at 21:18 -0700, Andrew Morton wrote:
> On Thu, 5 Apr 2007 14:09:36 +0100 Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
>
> > Nowdays you can ask for an IRQ to be allocated but not enabled, when
> > PCMCIA was written this was not true and this feature is thus not used
> >
> > Signed-off-by: Alan Cox <alan@redhat.com>
> >
> > diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.21-rc5-mm4/drivers/pcmcia/pcmcia_resource.c linux-2.6.21-rc5-mm4/drivers/pcmcia/pcmcia_resource.c
> > --- linux.vanilla-2.6.21-rc5-mm4/drivers/pcmcia/pcmcia_resource.c 2007-04-03 16:52:14.000000000 +0100
> > +++ linux-2.6.21-rc5-mm4/drivers/pcmcia/pcmcia_resource.c 2007-04-03 17:10:42.000000000 +0100
> > @@ -810,8 +810,11 @@
> > type = IRQF_SHARED;
> > if (req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)
> > type = IRQF_SHARED;
> > #ifdef CONFIG_PCMCIA_PROBE
> > + if (!(req->Attributes & IRQ_HANDLE_PRESENT))
> > + type |= IRQ_NOAUTOEN;
> > +
> > if (s->irq.AssignedIRQ != 0) {
> > /* If the interrupt is already assigned, it must be the same */
> > irq = s->irq.AssignedIRQ;
>
> alpha:
>
> drivers/pcmcia/pcmcia_resource.c: In function 'pcmcia_request_irq':
> drivers/pcmcia/pcmcia_resource.c:816: error: 'IRQ_NOAUTOEN' undeclared (first use in this function)
> drivers/pcmcia/pcmcia_resource.c:816: error: (Each undeclared identifier is reported only once
> drivers/pcmcia/pcmcia_resource.c:816: error: for each function it appears in.)
>
> Problem is, IRQ_NOAUTOEN is a generic-irq thing, so architectures which
> don't use generic-irqs break. And it's defined in linux/irq.h which
> (stupidly) cannot be included in generic code.
Hrmpf. We need a IRQF_NOAUTOEN, which can be handed to reqeust_irq().
I cook a patch.
tglx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pcmcia: irq probe can be done without risking an IRQ storm
2007-04-26 17:31 ` Thomas Gleixner
@ 2007-04-26 19:06 ` Thomas Gleixner
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2007-04-26 19:06 UTC (permalink / raw)
To: Andrew Morton; +Cc: Alan Cox, linux-kernel, Ingo Molnar
On Thu, 2007-04-26 at 19:31 +0200, Thomas Gleixner wrote:
> > > #ifdef CONFIG_PCMCIA_PROBE
> > > + if (!(req->Attributes & IRQ_HANDLE_PRESENT))
> > > + type |= IRQ_NOAUTOEN;
> > > +
> > > if (s->irq.AssignedIRQ != 0) {
> > > /* If the interrupt is already assigned, it must be the same */
> > > irq = s->irq.AssignedIRQ;
> >
> > alpha:
> >
> > drivers/pcmcia/pcmcia_resource.c: In function 'pcmcia_request_irq':
> > drivers/pcmcia/pcmcia_resource.c:816: error: 'IRQ_NOAUTOEN' undeclared (first use in this function)
> > drivers/pcmcia/pcmcia_resource.c:816: error: (Each undeclared identifier is reported only once
> > drivers/pcmcia/pcmcia_resource.c:816: error: for each function it appears in.)
> >
> > Problem is, IRQ_NOAUTOEN is a generic-irq thing, so architectures which
> > don't use generic-irqs break. And it's defined in linux/irq.h which
> > (stupidly) cannot be included in generic code.
>
> Hrmpf. We need a IRQF_NOAUTOEN, which can be handed to reqeust_irq().
>
> I cook a patch.
Not that simple. For non shared interrupts it is straight forward, but
for shared ones we have to decide, whether we
A) reject the request
B) disable the interrupt and rely on the caller, that it reenables it
C) ignore it
sorted by ugliness order :)
A) is definitely the most safe bet, but B) might work as well.
tglx
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-04-26 19:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-05 13:09 [PATCH] pcmcia: irq probe can be done without risking an IRQ storm Alan Cox
2007-04-26 4:18 ` Andrew Morton
2007-04-26 17:31 ` Thomas Gleixner
2007-04-26 19:06 ` Thomas Gleixner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).