aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_init.c
diff options
context:
space:
mode:
authorDhananjay Phadke <dhananjay@netxen.com>2009-07-17 11:27:07 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-20 11:23:31 -0400
commitb2af9cb06d4de1b507ec0fd779ec2ecedee1480a (patch)
tree15967d7eaee2636e6c29d15d96dd57e99c0a6ee9 /drivers/net/netxen/netxen_nic_init.c
parentcf981ffb31e8f41f4899a56560f81322f94f22d1 (diff)
netxen: fix deadlock on dev close
netxen: fix deadlock on dev close The tx ring accounting fix in commit cb2107be43d2fc5eadec58b92b ("netxen: fix tx ring accounting") introduced intermittent deadlock when inteface is going down. This was possibly combined effect of speculative tx pause, calling netif_tx_lock instead of queue lock and unclean synchronization with napi which could end up unmasking interrupt. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_init.c')
-rw-r--r--drivers/net/netxen/netxen_nic_init.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index b899bd51fcd8..5d3343ef3d86 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -214,6 +214,7 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter)
214 adapter->tx_ring = tx_ring; 214 adapter->tx_ring = tx_ring;
215 215
216 tx_ring->num_desc = adapter->num_txd; 216 tx_ring->num_desc = adapter->num_txd;
217 tx_ring->txq = netdev_get_tx_queue(netdev, 0);
217 218
218 cmd_buf_arr = vmalloc(TX_BUFF_RINGSIZE(tx_ring)); 219 cmd_buf_arr = vmalloc(TX_BUFF_RINGSIZE(tx_ring));
219 if (cmd_buf_arr == NULL) { 220 if (cmd_buf_arr == NULL) {
@@ -1400,10 +1401,10 @@ int netxen_process_cmd_ring(struct netxen_adapter *adapter)
1400 smp_mb(); 1401 smp_mb();
1401 1402
1402 if (netif_queue_stopped(netdev) && netif_carrier_ok(netdev)) { 1403 if (netif_queue_stopped(netdev) && netif_carrier_ok(netdev)) {
1403 netif_tx_lock(netdev); 1404 __netif_tx_lock(tx_ring->txq, smp_processor_id());
1404 if (netxen_tx_avail(tx_ring) > TX_STOP_THRESH) 1405 if (netxen_tx_avail(tx_ring) > TX_STOP_THRESH)
1405 netif_wake_queue(netdev); 1406 netif_wake_queue(netdev);
1406 netif_tx_unlock(netdev); 1407 __netif_tx_unlock(tx_ring->txq);
1407 } 1408 }
1408 } 1409 }
1409 /* 1410 /*