Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 341689
b: refs/heads/master
c: c2f3b8e
h: refs/heads/master
i:
  341687: e9adf70
v: v3
  • Loading branch information
Daniel Pieczko authored and Ben Hutchings committed Dec 1, 2012
1 parent bfd9ac3 commit 44e6281
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 525d9e824018cd7cc8d8d44832ddcd363abfe6e1
refs/heads/master: c2f3b8e3a44b6fe9e36704e30157ebe1a88c08b1
4 changes: 2 additions & 2 deletions trunk/drivers/net/ethernet/sfc/efx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2279,7 +2279,7 @@ int efx_reset(struct efx_nic *efx, enum reset_type method)
netif_info(efx, drv, efx->net_dev, "resetting (%s)\n",
RESET_TYPE(method));

netif_device_detach(efx->net_dev);
efx_device_detach_sync(efx);
efx_reset_down(efx, method);

rc = efx->type->reset(efx, method);
Expand Down Expand Up @@ -2758,7 +2758,7 @@ static int efx_pm_freeze(struct device *dev)
if (efx->state != STATE_DISABLED) {
efx->state = STATE_UNINIT;

netif_device_detach(efx->net_dev);
efx_device_detach_sync(efx);

efx_stop_all(efx);
efx_stop_interrupts(efx, false);
Expand Down
13 changes: 13 additions & 0 deletions trunk/drivers/net/ethernet/sfc/efx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
2 changes: 1 addition & 1 deletion trunk/drivers/net/ethernet/sfc/selftest.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
/* Detach the device so the kernel doesn't transmit during the
* loopback test and the watchdog timeout doesn't fire.
*/
netif_device_detach(efx->net_dev);
efx_device_detach_sync(efx);

if (efx->type->test_chip) {
rc_reset = efx->type->test_chip(efx, tests);
Expand Down

0 comments on commit 44e6281

Please sign in to comment.