diff options
Diffstat (limited to 'drivers/net/sfc/falcon.c')
-rw-r--r-- | drivers/net/sfc/falcon.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index 5b9f2d9cc4ed..d5378e60fcdd 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c | |||
@@ -824,10 +824,6 @@ static void falcon_handle_rx_not_ok(struct efx_rx_queue *rx_queue, | |||
824 | rx_ev_pause_frm ? " [PAUSE]" : ""); | 824 | rx_ev_pause_frm ? " [PAUSE]" : ""); |
825 | } | 825 | } |
826 | #endif | 826 | #endif |
827 | |||
828 | if (unlikely(rx_ev_eth_crc_err && EFX_WORKAROUND_10750(efx) && | ||
829 | efx->phy_type == PHY_TYPE_SFX7101)) | ||
830 | tenxpress_crc_err(efx); | ||
831 | } | 827 | } |
832 | 828 | ||
833 | /* Handle receive events that are not in-order. */ | 829 | /* Handle receive events that are not in-order. */ |
@@ -1887,7 +1883,7 @@ static int falcon_reset_macs(struct efx_nic *efx) | |||
1887 | 1883 | ||
1888 | /* MAC stats will fail whilst the TX fifo is draining. Serialise | 1884 | /* MAC stats will fail whilst the TX fifo is draining. Serialise |
1889 | * the drain sequence with the statistics fetch */ | 1885 | * the drain sequence with the statistics fetch */ |
1890 | spin_lock(&efx->stats_lock); | 1886 | efx_stats_disable(efx); |
1891 | 1887 | ||
1892 | falcon_read(efx, ®, MAC0_CTRL_REG_KER); | 1888 | falcon_read(efx, ®, MAC0_CTRL_REG_KER); |
1893 | EFX_SET_OWORD_FIELD(reg, TXFIFO_DRAIN_EN_B0, 1); | 1889 | EFX_SET_OWORD_FIELD(reg, TXFIFO_DRAIN_EN_B0, 1); |
@@ -1917,7 +1913,7 @@ static int falcon_reset_macs(struct efx_nic *efx) | |||
1917 | udelay(10); | 1913 | udelay(10); |
1918 | } | 1914 | } |
1919 | 1915 | ||
1920 | spin_unlock(&efx->stats_lock); | 1916 | efx_stats_enable(efx); |
1921 | 1917 | ||
1922 | /* If we've reset the EM block and the link is up, then | 1918 | /* If we've reset the EM block and the link is up, then |
1923 | * we'll have to kick the XAUI link so the PHY can recover */ | 1919 | * we'll have to kick the XAUI link so the PHY can recover */ |
@@ -2277,6 +2273,10 @@ int falcon_switch_mac(struct efx_nic *efx) | |||
2277 | struct efx_mac_operations *old_mac_op = efx->mac_op; | 2273 | struct efx_mac_operations *old_mac_op = efx->mac_op; |
2278 | efx_oword_t nic_stat; | 2274 | efx_oword_t nic_stat; |
2279 | unsigned strap_val; | 2275 | unsigned strap_val; |
2276 | int rc = 0; | ||
2277 | |||
2278 | /* Don't try to fetch MAC stats while we're switching MACs */ | ||
2279 | efx_stats_disable(efx); | ||
2280 | 2280 | ||
2281 | /* Internal loopbacks override the phy speed setting */ | 2281 | /* Internal loopbacks override the phy speed setting */ |
2282 | if (efx->loopback_mode == LOOPBACK_GMAC) { | 2282 | if (efx->loopback_mode == LOOPBACK_GMAC) { |
@@ -2287,16 +2287,12 @@ int falcon_switch_mac(struct efx_nic *efx) | |||
2287 | efx->link_fd = true; | 2287 | efx->link_fd = true; |
2288 | } | 2288 | } |
2289 | 2289 | ||
2290 | WARN_ON(!mutex_is_locked(&efx->mac_lock)); | ||
2290 | efx->mac_op = (EFX_IS10G(efx) ? | 2291 | efx->mac_op = (EFX_IS10G(efx) ? |
2291 | &falcon_xmac_operations : &falcon_gmac_operations); | 2292 | &falcon_xmac_operations : &falcon_gmac_operations); |
2292 | if (old_mac_op == efx->mac_op) | ||
2293 | return 0; | ||
2294 | |||
2295 | WARN_ON(!mutex_is_locked(&efx->mac_lock)); | ||
2296 | |||
2297 | /* Not all macs support a mac-level link state */ | ||
2298 | efx->mac_up = true; | ||
2299 | 2293 | ||
2294 | /* Always push the NIC_STAT_REG setting even if the mac hasn't | ||
2295 | * changed, because this function is run post online reset */ | ||
2300 | falcon_read(efx, &nic_stat, NIC_STAT_REG); | 2296 | falcon_read(efx, &nic_stat, NIC_STAT_REG); |
2301 | strap_val = EFX_IS10G(efx) ? 5 : 3; | 2297 | strap_val = EFX_IS10G(efx) ? 5 : 3; |
2302 | if (falcon_rev(efx) >= FALCON_REV_B0) { | 2298 | if (falcon_rev(efx) >= FALCON_REV_B0) { |
@@ -2309,9 +2305,17 @@ int falcon_switch_mac(struct efx_nic *efx) | |||
2309 | BUG_ON(EFX_OWORD_FIELD(nic_stat, STRAP_PINS) != strap_val); | 2305 | BUG_ON(EFX_OWORD_FIELD(nic_stat, STRAP_PINS) != strap_val); |
2310 | } | 2306 | } |
2311 | 2307 | ||
2308 | if (old_mac_op == efx->mac_op) | ||
2309 | goto out; | ||
2312 | 2310 | ||
2313 | EFX_LOG(efx, "selected %cMAC\n", EFX_IS10G(efx) ? 'X' : 'G'); | 2311 | EFX_LOG(efx, "selected %cMAC\n", EFX_IS10G(efx) ? 'X' : 'G'); |
2314 | return falcon_reset_macs(efx); | 2312 | /* Not all macs support a mac-level link state */ |
2313 | efx->mac_up = true; | ||
2314 | |||
2315 | rc = falcon_reset_macs(efx); | ||
2316 | out: | ||
2317 | efx_stats_enable(efx); | ||
2318 | return rc; | ||
2315 | } | 2319 | } |
2316 | 2320 | ||
2317 | /* This call is responsible for hooking in the MAC and PHY operations */ | 2321 | /* This call is responsible for hooking in the MAC and PHY operations */ |