aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcnet32.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-01-07 23:53:33 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-09 02:30:12 -0500
commitd1d08d1265810ef1f165864850416dcbc9725ee7 (patch)
tree9c053e8822e33ff719da72df620f1335207ab73d /drivers/net/pcnet32.c
parent1706287f6eb58726a9a0e5cbbde87f49757615e3 (diff)
[NET]: Fix drivers to handle napi_disable() disabling interrupts.
When we add the generic napi_disable_pending() breakout logic to net_rx_action() it means that napi_disable() can cause NAPI poll interrupt events to be disabled. And this is exactly what we want. If a napi_disable() is pending, and we are looping in the ->poll(), we want ->poll() event interrupts to stay disabled and we want to complete the NAPI poll ASAP. When ->poll() break out during device down was being handled on a per-driver basis, often these drivers would turn interrupts back on when '!netif_running()' was detected. And this would just cause a reschedule of the NAPI ->poll() in the interrupt handler before the napi_disable() could get in there and grab the NAPI_STATE_SCHED bit. The vast majority of drivers don't care if napi_disable() might have the side effect of disabling NAPI ->poll() event interrupts. In all such cases, when a napi_disable() is performed, the driver just disabled interrupts or is about to. However there were three exceptions to this in PCNET32, R8169, and SKY2. To fix those cases, at the subsequent napi_enable() points, I added code to ensure that the ->poll() interrupt events are enabled in the hardware. Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Don Fry <pcnet32@verizon.net>
Diffstat (limited to 'drivers/net/pcnet32.c')
-rw-r--r--drivers/net/pcnet32.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index ff92aca0a7b3..90498ffe26f2 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -455,9 +455,14 @@ static void pcnet32_netif_start(struct net_device *dev)
455{ 455{
456#ifdef CONFIG_PCNET32_NAPI 456#ifdef CONFIG_PCNET32_NAPI
457 struct pcnet32_private *lp = netdev_priv(dev); 457 struct pcnet32_private *lp = netdev_priv(dev);
458 ulong ioaddr = dev->base_addr;
459 u16 val;
458#endif 460#endif
459 netif_wake_queue(dev); 461 netif_wake_queue(dev);
460#ifdef CONFIG_PCNET32_NAPI 462#ifdef CONFIG_PCNET32_NAPI
463 val = lp->a.read_csr(ioaddr, CSR3);
464 val &= 0x00ff;
465 lp->a.write_csr(ioaddr, CSR3, val);
461 napi_enable(&lp->napi); 466 napi_enable(&lp->napi);
462#endif 467#endif
463} 468}