linux_dsm_epyc7002/drivers/net/ethernet/micrel
Lennert Buytenhek 4945106d21 ksz884x: fix receive polling race condition
The ksz884x driver does receive processing in a custom tasklet, and
seems to be assuming that since it takes its private interface spinlock
with spin_lock_irq(), it won't be running concurrently with its own
interrupt handler, as it cannot be preempted by it, but since its
interrupt handler doesn't do any locking whatsoever, the receive
processing tasklet and interrupt handler can end up running concurrently
on different CPUs.

As a result of this, the ksz884x receive path ends up locking up fairly
easily, when the receive processing tasklet's reenabling of receive
interrupts (due to it being done with polling the receive ring) races
with the interrupt handler's disabling of receive interrupts (due to a
new receive interrupt coming in) resulting in the receive interrupt
being masked but the receive processing tasklet not being scheduled.

Fix this by making the ksz884x interrupt handler take its private
interface spinlock.  This requires upgrading the spin_lock() in the
transmit cleanup tasklet to a spin_lock_irq(), as otherwise the IRQ
handler can preempt transmit cleanup and deadlock the system, but
with those two changes, no more receive lockups have been observed.

Reported-by: Chris Healy <cphealy@gmail.com>
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>

----
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-12-19 12:44:45 -08:00
..
Kconfig drivers: misc: Remove MISC_DEVICES config option 2012-01-24 16:24:02 -08:00
ks8695net.c net/micrel: remove __dev* attributes 2012-12-03 11:16:54 -08:00
ks8695net.h ks8*/ksz8*: Move the Micrel drivers 2011-08-12 00:22:18 -07:00
ks8842.c net/micrel: remove __dev* attributes 2012-12-03 11:16:54 -08:00
ks8851_mll.c net/micrel: remove __dev* attributes 2012-12-03 11:16:54 -08:00
ks8851.c net/micrel: remove __dev* attributes 2012-12-03 11:16:54 -08:00
ks8851.h drivers/net: fix up stale paths from driver reorg 2012-01-30 12:54:40 -05:00
ksz884x.c ksz884x: fix receive polling race condition 2012-12-19 12:44:45 -08:00
Makefile ks8*/ksz8*: Move the Micrel drivers 2011-08-12 00:22:18 -07:00