diff options
author | Manish Chopra <manish.chopra@qlogic.com> | 2014-09-30 09:56:35 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-30 22:22:43 +0200 |
commit | 0d36882013e61dc47aa835c4ec98b1fe776c9db8 (patch) | |
tree | d2bdf6d34aa1dae6b122364bdbd2b6a4e84e4bc9 /drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c | |
parent | ipv6: remove rt6i_genid (diff) | |
download | linux-0d36882013e61dc47aa835c4ec98b1fe776c9db8.tar.xz linux-0d36882013e61dc47aa835c4ec98b1fe776c9db8.zip |
netxen: Fix BUG "sleeping function called from invalid context"
o __netxen_nic_down() function might sleep while holding spinlock_t(tx_clean_lock).
Acquire this lock for only releasing TX buffers instead of taking it
for whole down path.
Reported-by: Mike Galbraith <umgwanakikbuti@gmail.com>
Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c')
-rw-r--r-- | drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c index 32058614151a..ae4ec7b3bfd3 100644 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c @@ -135,6 +135,7 @@ void netxen_release_tx_buffers(struct netxen_adapter *adapter) int i, j; struct nx_host_tx_ring *tx_ring = adapter->tx_ring; + spin_lock(&adapter->tx_clean_lock); cmd_buf = tx_ring->cmd_buf_arr; for (i = 0; i < tx_ring->num_desc; i++) { buffrag = cmd_buf->frag_array; @@ -158,6 +159,7 @@ void netxen_release_tx_buffers(struct netxen_adapter *adapter) } cmd_buf++; } + spin_unlock(&adapter->tx_clean_lock); } void netxen_free_sw_resources(struct netxen_adapter *adapter) |