diff options
author | Tony Camuso <tcamuso@redhat.com> | 2015-05-06 09:09:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-05-09 16:44:46 -0400 |
commit | 240b23c4269777abba4eba43acd1f53ec530bb7d (patch) | |
tree | 21225a1a211387ffe696641bea113307b20ac5f5 /drivers/net/ethernet | |
parent | ccad725ccb068851fbce2022b2a51fa458d1eac1 (diff) |
netxen_nic: use spin_[un]lock_bh around tx_clean_lock (2)
This patch should have been part of the previous patch having the
same summary. See http://marc.info/?l=linux-kernel&m=143039470103795&w=2
Unfortunately, I didn't check to see where else this lock was used before
submitting that patch. This should take care of it for netxen_nic, as I
did a thorough search this time.
To recap from the original patch; although testing this driver with
DEBUG_LOCKDEP and DEBUG_SPINLOCK enabled did not produce any traces,
it would be more prudent in the case of tx_clean_lock to use _bh
versions of spin_[un]lock, since this lock is manipulated in both
the process and softirq contexts.
This patch was tested for functionality and regressions with netperf
and DEBUG_LOCKDEP and DEBUG_SPINLOCK enabled.
Signed-off-by: Tony Camuso <tcamuso@redhat.com>
Acked-By: Neil Horman <nhorman@tuxdriver.com>
Acked-By: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c index 8da7c3faf817..7b43a3b4abdc 100644 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c | |||
@@ -1764,7 +1764,7 @@ int netxen_process_cmd_ring(struct netxen_adapter *adapter) | |||
1764 | int done = 0; | 1764 | int done = 0; |
1765 | struct nx_host_tx_ring *tx_ring = adapter->tx_ring; | 1765 | struct nx_host_tx_ring *tx_ring = adapter->tx_ring; |
1766 | 1766 | ||
1767 | if (!spin_trylock(&adapter->tx_clean_lock)) | 1767 | if (!spin_trylock_bh(&adapter->tx_clean_lock)) |
1768 | return 1; | 1768 | return 1; |
1769 | 1769 | ||
1770 | sw_consumer = tx_ring->sw_consumer; | 1770 | sw_consumer = tx_ring->sw_consumer; |
@@ -1819,7 +1819,7 @@ int netxen_process_cmd_ring(struct netxen_adapter *adapter) | |||
1819 | */ | 1819 | */ |
1820 | hw_consumer = le32_to_cpu(*(tx_ring->hw_consumer)); | 1820 | hw_consumer = le32_to_cpu(*(tx_ring->hw_consumer)); |
1821 | done = (sw_consumer == hw_consumer); | 1821 | done = (sw_consumer == hw_consumer); |
1822 | spin_unlock(&adapter->tx_clean_lock); | 1822 | spin_unlock_bh(&adapter->tx_clean_lock); |
1823 | 1823 | ||
1824 | return done; | 1824 | return done; |
1825 | } | 1825 | } |