diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2011-05-16 13:51:24 -0400 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2011-05-16 18:34:28 -0400 |
commit | e4abce8538496ba90cb89909894ea42e00f96a7d (patch) | |
tree | 738f4849e775c789efb3a6cb74d24125b752ee9d /drivers/net/sfc/selftest.c | |
parent | 602a5322a7a1b6b005cb50d423939bb7a8782838 (diff) |
sfc: Use netif_device_{detach,attach}() around reset and self-test
We need to keep the TX queues stopped throughout a reset, without
triggering the TX watchdog and regardless of the link state. The
proper way to do this is to use netif_device_{detach,attach}() just as
we do around suspend/resume, rather than the current bodge of faking
link-down.
Since we also need to do this during an offline self-test and we
perform a reset during that, add these function calls outside of
efx_reset_down() and efx_reset_up().
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/sfc/selftest.c')
-rw-r--r-- | drivers/net/sfc/selftest.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/sfc/selftest.c b/drivers/net/sfc/selftest.c index 50ad3bcaf68..822f6c2a6a7 100644 --- a/drivers/net/sfc/selftest.c +++ b/drivers/net/sfc/selftest.c | |||
@@ -695,12 +695,12 @@ int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests, | |||
695 | /* Offline (i.e. disruptive) testing | 695 | /* Offline (i.e. disruptive) testing |
696 | * This checks MAC and PHY loopback on the specified port. */ | 696 | * This checks MAC and PHY loopback on the specified port. */ |
697 | 697 | ||
698 | /* force the carrier state off so the kernel doesn't transmit during | 698 | /* Detach the device so the kernel doesn't transmit during the |
699 | * the loopback test, and the watchdog timeout doesn't fire. Also put | 699 | * loopback test and the watchdog timeout doesn't fire. |
700 | * falcon into loopback for the register test. | ||
701 | */ | 700 | */ |
701 | netif_device_detach(efx->net_dev); | ||
702 | |||
702 | mutex_lock(&efx->mac_lock); | 703 | mutex_lock(&efx->mac_lock); |
703 | efx->port_inhibited = true; | ||
704 | if (efx->loopback_modes) { | 704 | if (efx->loopback_modes) { |
705 | /* We need the 312 clock from the PHY to test the XMAC | 705 | /* We need the 312 clock from the PHY to test the XMAC |
706 | * registers, so move into XGMII loopback if available */ | 706 | * registers, so move into XGMII loopback if available */ |
@@ -750,12 +750,11 @@ int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests, | |||
750 | /* restore the PHY to the previous state */ | 750 | /* restore the PHY to the previous state */ |
751 | mutex_lock(&efx->mac_lock); | 751 | mutex_lock(&efx->mac_lock); |
752 | efx->phy_mode = phy_mode; | 752 | efx->phy_mode = phy_mode; |
753 | efx->port_inhibited = false; | ||
754 | efx->loopback_mode = loopback_mode; | 753 | efx->loopback_mode = loopback_mode; |
755 | __efx_reconfigure_port(efx); | 754 | __efx_reconfigure_port(efx); |
756 | mutex_unlock(&efx->mac_lock); | 755 | mutex_unlock(&efx->mac_lock); |
757 | 756 | ||
758 | netif_tx_wake_all_queues(efx->net_dev); | 757 | netif_device_attach(efx->net_dev); |
759 | 758 | ||
760 | return rc_test; | 759 | return rc_test; |
761 | } | 760 | } |