diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-03-04 09:52:52 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-04 17:40:22 -0800 |
commit | 115122afc5e34499a0edfd2b057e9c352fa7c78f (patch) | |
tree | d0c7b0a69ca579749a4ee6a2d252d24969b68201 /drivers/net/sfc | |
parent | a7ef59332b33cb1924ea76cce2aa620a32bb0d7a (diff) |
sfc: Clean up properly on reset failure paths
If MAC switching fails, stop the port properly.
If PHY reinitialisation fails, clear the port_initialized flag.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r-- | drivers/net/sfc/efx.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c index 45df110f833..8fa68d82c02 100644 --- a/drivers/net/sfc/efx.c +++ b/drivers/net/sfc/efx.c @@ -557,6 +557,8 @@ static void efx_link_status_changed(struct efx_nic *efx) } +static void efx_fini_port(struct efx_nic *efx); + /* This call reinitialises the MAC to pick up new PHY settings. The * caller must hold the mac_lock */ void __efx_reconfigure_port(struct efx_nic *efx) @@ -592,8 +594,8 @@ void __efx_reconfigure_port(struct efx_nic *efx) fail: EFX_ERR(efx, "failed to reconfigure MAC\n"); - efx->phy_op->fini(efx); - efx->port_initialized = false; + efx->port_enabled = false; + efx_fini_port(efx); } /* Reinitialise the MAC to pick up new PHY settings, even if the port is @@ -1667,7 +1669,8 @@ int efx_reset_up(struct efx_nic *efx, enum reset_type method, rc = efx->phy_op->init(efx); if (rc) ok = false; - } else + } + if (!ok) efx->port_initialized = false; } |