aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2013-03-04 20:03:47 -0500
committerBen Hutchings <bhutchings@solarflare.com>2013-03-06 12:57:24 -0500
commit35205b211c8d17a8a0b5e8926cb7c73e9a7ef1ad (patch)
treeec2e3823eb0aa38d914acdf4d1c4aa752f2a8b49
parent29c69a4882641285a854d6d03ca5adbba68c0034 (diff)
sfc: Disable soft interrupt handling during efx_device_detach_sync()
efx_device_detach_sync() locks all TX queues before marking the device detached and thus disabling further TX scheduling. But it can still be interrupted by TX completions which then result in TX scheduling in soft interrupt context. This will deadlock when it tries to acquire a TX queue lock that efx_device_detach_sync() already acquired. To avoid deadlock, we must use netif_tx_{,un}lock_bh(). Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r--drivers/net/ethernet/sfc/efx.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/sfc/efx.h b/drivers/net/ethernet/sfc/efx.h
index 50247dfe8f57..d2f790df6dcb 100644
--- a/drivers/net/ethernet/sfc/efx.h
+++ b/drivers/net/ethernet/sfc/efx.h
@@ -171,9 +171,9 @@ static inline void efx_device_detach_sync(struct efx_nic *efx)
171 * TX scheduler is stopped when we're done and before 171 * TX scheduler is stopped when we're done and before
172 * netif_device_present() becomes false. 172 * netif_device_present() becomes false.
173 */ 173 */
174 netif_tx_lock(dev); 174 netif_tx_lock_bh(dev);
175 netif_device_detach(dev); 175 netif_device_detach(dev);
176 netif_tx_unlock(dev); 176 netif_tx_unlock_bh(dev);
177} 177}
178 178
179#endif /* EFX_EFX_H */ 179#endif /* EFX_EFX_H */