summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/sfc/efx.h
diff options
context:
space:
mode:
authorDaniel Pieczko <dpieczko@solarflare.com>2012-10-17 16:21:23 +0400
committerBen Hutchings <bhutchings@solarflare.com>2012-12-01 06:37:35 +0400
commitc2f3b8e3a44b6fe9e36704e30157ebe1a88c08b1 (patch)
treea33870250f24b7b832a52bb039aee7f4b20d842b /drivers/net/ethernet/sfc/efx.h
parent525d9e824018cd7cc8d8d44832ddcd363abfe6e1 (diff)
downloadlinux-c2f3b8e3a44b6fe9e36704e30157ebe1a88c08b1.tar.xz
sfc: lock TX queues when calling netif_device_detach()
The assertion of netif_device_present() at the top of efx_hard_start_xmit() may fail if we don't do this. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/sfc/efx.h')
-rw-r--r--drivers/net/ethernet/sfc/efx.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/efx.h b/drivers/net/ethernet/sfc/efx.h
index f11170bc48bf..50247dfe8f57 100644
--- a/drivers/net/ethernet/sfc/efx.h
+++ b/drivers/net/ethernet/sfc/efx.h
@@ -163,4 +163,17 @@ extern void efx_link_status_changed(struct efx_nic *efx);
extern void efx_link_set_advertising(struct efx_nic *efx, u32);
extern void efx_link_set_wanted_fc(struct efx_nic *efx, u8);
+static inline void efx_device_detach_sync(struct efx_nic *efx)
+{
+ struct net_device *dev = efx->net_dev;
+
+ /* Lock/freeze all TX queues so that we can be sure the
+ * TX scheduler is stopped when we're done and before
+ * netif_device_present() becomes false.
+ */
+ netif_tx_lock(dev);
+ netif_device_detach(dev);
+ netif_tx_unlock(dev);
+}
+
#endif /* EFX_EFX_H */