LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [M68KNOMMU]: fix fec driver interrupt races
@ 2008-03-04 6:52 Greg Ungerer
2008-03-05 11:33 ` Jeff Garzik
0 siblings, 1 reply; 3+ messages in thread
From: Greg Ungerer @ 2008-03-04 6:52 UTC (permalink / raw)
To: torvalds; +Cc: gerg, linux-kernel
The FEC driver has a common interrupt handler for all interrupt event
types. It is raised on a number of distinct interrupt vectors.
This handler can't be re-entered while processing an interrupt, so
make sure all requested vectors are flagged as IRQF_DISABLED.
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
---
diff -Naurp linux-2.6.25-rc3/drivers/net/fec.c linux-2.6.25-rc3.foo/drivers/net/fec.c
--- linux-2.6.25-rc3/drivers/net/fec.c 2008-01-25 08:58:37.000000000 +1000
+++ linux-2.6.25-rc3.foo/drivers/net/fec.c 2008-03-04 16:38:31.000000000 +1000
@@ -1253,7 +1253,7 @@ static void __inline__ fec_request_intrs
/* Setup interrupt handlers. */
for (idp = id; idp->name; idp++) {
- if (request_irq(idp->irq, idp->handler, 0, idp->name, dev) != 0)
+ if (request_irq(idp->irq, idp->handler, IRQF_DISABLED, idp->name, dev) != 0)
printk("FEC: Could not allocate %s IRQ(%d)!\n", idp->name, idp->irq);
}
@@ -1382,7 +1382,7 @@ static void __inline__ fec_request_intrs
/* Setup interrupt handlers. */
for (idp = id; idp->name; idp++) {
- if (request_irq(b+idp->irq, fec_enet_interrupt, 0, idp->name, dev) != 0)
+ if (request_irq(b+idp->irq, fec_enet_interrupt, IRQF_DISABLED, idp->name, dev) != 0)
printk("FEC: Could not allocate %s IRQ(%d)!\n", idp->name, b+idp->irq);
}
@@ -1553,7 +1553,7 @@ static void __inline__ fec_request_intrs
/* Setup interrupt handlers. */
for (idp = id; idp->name; idp++) {
- if (request_irq(b+idp->irq,fec_enet_interrupt,0,idp->name,dev)!=0)
+ if (request_irq(b+idp->irq, fec_enet_interrupt, IRQF_DISABLED, idp->name,dev) != 0)
printk("FEC: Could not allocate %s IRQ(%d)!\n", idp->name, b+idp->irq);
}
@@ -1680,7 +1680,7 @@ static void __inline__ fec_request_intrs
/* Setup interrupt handlers. */
for (idp = id; idp->name; idp++) {
- if (request_irq(b+idp->irq,fec_enet_interrupt,0,idp->name,dev)!=0)
+ if (request_irq(b+idp->irq, fec_enet_interrupt, IRQF_DISABLED, idp->name,dev) != 0)
printk("FEC: Could not allocate %s IRQ(%d)!\n",
idp->name, b+idp->irq);
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [M68KNOMMU]: fix fec driver interrupt races
2008-03-04 6:52 [M68KNOMMU]: fix fec driver interrupt races Greg Ungerer
@ 2008-03-05 11:33 ` Jeff Garzik
2008-03-05 22:54 ` Greg Ungerer
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2008-03-05 11:33 UTC (permalink / raw)
To: Greg Ungerer; +Cc: torvalds, gerg, linux-kernel
Greg Ungerer wrote:
> The FEC driver has a common interrupt handler for all interrupt event
> types. It is raised on a number of distinct interrupt vectors.
> This handler can't be re-entered while processing an interrupt, so
> make sure all requested vectors are flagged as IRQF_DISABLED.
>
> Signed-off-by: Greg Ungerer <gerg@uclinux.org>
NAK -- add spinlocks to your interrupt handling like you are supposed to
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [M68KNOMMU]: fix fec driver interrupt races
2008-03-05 11:33 ` Jeff Garzik
@ 2008-03-05 22:54 ` Greg Ungerer
0 siblings, 0 replies; 3+ messages in thread
From: Greg Ungerer @ 2008-03-05 22:54 UTC (permalink / raw)
To: Jeff Garzik; +Cc: torvalds, linux-kernel
Hi Jeff,
Jeff Garzik wrote:
> Greg Ungerer wrote:
>> The FEC driver has a common interrupt handler for all interrupt event
>> types. It is raised on a number of distinct interrupt vectors.
>> This handler can't be re-entered while processing an interrupt, so
>> make sure all requested vectors are flagged as IRQF_DISABLED.
>>
>> Signed-off-by: Greg Ungerer <gerg@uclinux.org>
>
> NAK -- add spinlocks to your interrupt handling like you are supposed to
A better fix is to use the separate vectors, avoiding spinlocks
in most cases. But this is a simple immediate fix for 2.6.25.
The better solution is being worked on, but it needs some
reasonable testing before it is ready for inclusion, and that
won't be till post 2.6.25.
(This is a regression, fixes in the m68knommu interrupt subsystem
exposed this).
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Chief Software Dude EMAIL: gerg@snapgear.com
Secure Computing Corporation PHONE: +61 7 3435 2888
825 Stanley St, FAX: +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia WEB: http://www.SnapGear.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-03-05 23:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-04 6:52 [M68KNOMMU]: fix fec driver interrupt races Greg Ungerer
2008-03-05 11:33 ` Jeff Garzik
2008-03-05 22:54 ` Greg Ungerer
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).