diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/sfc/falcon.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index ae7b0b48bfd1..d9412f83a78e 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c | |||
@@ -2283,16 +2283,12 @@ int falcon_switch_mac(struct efx_nic *efx) | |||
2283 | efx->link_fd = true; | 2283 | efx->link_fd = true; |
2284 | } | 2284 | } |
2285 | 2285 | ||
2286 | WARN_ON(!mutex_is_locked(&efx->mac_lock)); | ||
2286 | efx->mac_op = (EFX_IS10G(efx) ? | 2287 | efx->mac_op = (EFX_IS10G(efx) ? |
2287 | &falcon_xmac_operations : &falcon_gmac_operations); | 2288 | &falcon_xmac_operations : &falcon_gmac_operations); |
2288 | if (old_mac_op == efx->mac_op) | ||
2289 | return 0; | ||
2290 | |||
2291 | WARN_ON(!mutex_is_locked(&efx->mac_lock)); | ||
2292 | |||
2293 | /* Not all macs support a mac-level link state */ | ||
2294 | efx->mac_up = true; | ||
2295 | 2289 | ||
2290 | /* Always push the NIC_STAT_REG setting even if the mac hasn't | ||
2291 | * changed, because this function is run post online reset */ | ||
2296 | falcon_read(efx, &nic_stat, NIC_STAT_REG); | 2292 | falcon_read(efx, &nic_stat, NIC_STAT_REG); |
2297 | strap_val = EFX_IS10G(efx) ? 5 : 3; | 2293 | strap_val = EFX_IS10G(efx) ? 5 : 3; |
2298 | if (falcon_rev(efx) >= FALCON_REV_B0) { | 2294 | if (falcon_rev(efx) >= FALCON_REV_B0) { |
@@ -2305,8 +2301,13 @@ int falcon_switch_mac(struct efx_nic *efx) | |||
2305 | BUG_ON(EFX_OWORD_FIELD(nic_stat, STRAP_PINS) != strap_val); | 2301 | BUG_ON(EFX_OWORD_FIELD(nic_stat, STRAP_PINS) != strap_val); |
2306 | } | 2302 | } |
2307 | 2303 | ||
2304 | if (old_mac_op == efx->mac_op) | ||
2305 | return 0; | ||
2308 | 2306 | ||
2309 | EFX_LOG(efx, "selected %cMAC\n", EFX_IS10G(efx) ? 'X' : 'G'); | 2307 | EFX_LOG(efx, "selected %cMAC\n", EFX_IS10G(efx) ? 'X' : 'G'); |
2308 | /* Not all macs support a mac-level link state */ | ||
2309 | efx->mac_up = true; | ||
2310 | |||
2310 | return falcon_reset_macs(efx); | 2311 | return falcon_reset_macs(efx); |
2311 | } | 2312 | } |
2312 | 2313 | ||