igb: Enable media autosense for the i350.
Subsystems (2)
PATCH 1/2 igb: Enable media autosense for the i350.
From: Manfred Rudigier <[email protected]>
This patch enables the hardware feature "Media Auto Sense" also on the i350. It works in the same way as on the 82850 devices. Hardware designs using dual PHYs (fiber/copper) can enable this feature by setting the MAS enable bits in the NVM_COMPAT register (0x03) in the EEPROM.
--- drivers/net/ethernet/intel/igb/e1000_82575.c | 2 +- drivers/net/ethernet/intel/igb/igb_main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/igb/e1000_82575.c +1 -1
@@ -466,7 +466,7 @@ static s32 igb_init_mac_params_82575(struct e1000_hw *hw) ? igb_setup_copper_link_82575 : igb_setup_serdes_link_82575; -if (mac->type == e1000_82580) { +if (mac->type == e1000_82580 || mac->type == e1000_i350) {switch (hw->device_id) {/* feature not supported on these id's */ case E1000_DEV_ID_DH89XXCC_SGMII :
drivers/net/ethernet/intel/igb/igb_main.c +1 -1
@@ -2370,7 +2370,7 @@ void igb_reset(struct igb_adapter *adapter) adapter->ei.get_invariants (hw); adapter->flags &= ~IGB_FLAG_MEDIA_RESET ; } -if ((mac->type == e1000_82575) && +if ((mac->type == e1000_82575 || mac->type == e1000_i350) && (adapter->flags &IGB_FLAG_MAS_ENABLE )) {igb_enable_mas (adapter); }
PATCH 2/2 igb: Fix constant media auto sense switching when no cable is connected.
From: Manfred Rudigier <[email protected]>
At least on the i350 there is an annoying behavior that is maybe also present on 82580 devices, but was probably not noticed yet as MAS is not widely used.
If no cable is connected on both fiber/copper ports the media auto sense code will constantly swap between them as part of the watchdog task and produce many unnecessary kernel log messages.
The swap code responsible for this behavior (switching to fiber) should not be executed if the current media type is copper and there is no signal detected on the fiber port. In this case we can safely wait until the AUTOSENSE_EN bit is cleared.
--- drivers/net/ethernet/intel/igb/igb_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/igb/igb_main.c +2 -1
@@ -2064,7 +2064,8 @@ static void igb_check_swap_media(struct igb_adapter *adapter)if ((hw->phy.media_type == e1000_media_type_copper) && (!(connsw &E1000_CONNSW_AUTOSENSE_EN ))) { swap_now = true; - }else if (!(connsw &E1000_CONNSW_SERDESD )) { + }else if ((hw->phy.media_type != e1000_media_type_copper) && + !(connsw &E1000_CONNSW_SERDESD )) {/* copper signal takes time to appear */ if (adapter->copper_tries <4 ) { adapter->copper_tries++;
Brown
PATCH 2/2 igb: Fix constant media auto sense switching when no cable is connected.
Quoted 23 lines
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Jeff Kirsher
Sent: Thursday, August 15, 2019 1:55 PM
To: intel-wired-lan at lists.osuosl.org
Cc: Manfred Rudigier <[email protected]>
Subject: [Intel-wired-lan] [PATCH net 2/2] igb: Fix constant media auto sense switching when no cable is connected.From: Manfred Rudigier <[email protected]>
At least on the i350 there is an annoying behavior that is maybe also present on 82580 devices, but was probably not noticed yet as MAS is not widely used.
If no cable is connected on both fiber/copper ports the media auto sense code will constantly swap between them as part of the watchdog task and produce many unnecessary kernel log messages.
The swap code responsible for this behavior (switching to fiber) should not be executed if the current media type is copper and there is no signal detected on the fiber port. In this case we can safely wait until the
AUTOSENSE_ENbit is cleared.
Quoted 5 lines
Signed-off-by Manfred Rudigier <[email protected]>--- drivers/net/ethernet/intel/igb/igb_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Brown
PATCH 1/2 igb: Enable media autosense for the i350.
In reply to Jeff KirsherQuoted 15 lines
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Jeff Kirsher
Sent: Thursday, August 15, 2019 1:55 PM
To: intel-wired-lan at lists.osuosl.org
Cc: Manfred Rudigier <[email protected]>
Subject: [Intel-wired-lan] [PATCH net 1/2] igb: Enable media autosense for the i350.From: Manfred Rudigier <[email protected]>
This patch enables the hardware feature "Media Auto Sense" also on the i350. It works in the same way as on the 82850 devices. Hardware designs using dual PHYs (fiber/copper) can enable this feature by setting the MAS enable bits in the
NVM_COMPATregister (0x03) in the EEPROM.
Quoted 6 lines
Signed-off-by Manfred Rudigier <[email protected]>--- drivers/net/ethernet/intel/igb/e1000_82575.c | 2 +- drivers/net/ethernet/intel/igb/igb_main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)