Skip to contentSkip to conversation

igb: skip phy status check where unavailable

PATCH In review Kevin Mitchell 2 participants 3 messages Apr 29, 2022 – May 17, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igb: skip phy status check where unavailable

igb_read_phy_reg() will silently return, leaving phy_data untouched, if hw->ops.read_reg isn't set. Depending on the uninitialized value of phy_data, this led to the phy status check either succeeding immediately or looping continuously for 2 seconds before emitting a noisy err-level timeout. This message went out to the console even though there was no actual problem.

Instead, first check if there is read_reg function pointer. If not, proceed without trying to check the phy status register.

Fixes b72f3f72005d ("igb: When GbE link up, wait for Remote receiver status condition")
---
 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
index 34b33b21e0dc..68be2976f539 100644
@@ -5505,7 +5505,8 @@ static void igb_watchdog_task(struct work_struct *work)
 				break;
 			}
 
-			if (adapter->link_speed != SPEED_1000)
+			if (adapter->link_speed != SPEED_1000 ||
+			    !hw->phy.ops.read_reg)
 				goto no_wait;
 
 			/* wait for Remote receiver status OK */
Signature · 1 line
2.35.1
Tested-by on v1 1/1
#1 lore raw
Quoted 24 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Kevin Mitchell
Sent: Saturday, April 30, 2022 5:26 AM
Cc: [email protected]; [email protected]; linux- [email protected]; Takuma Ueba <[email protected]>; Jeff Kirsher <[email protected]>; [email protected]; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; David S. Miller <[email protected]>
Subject: [Intel-wired-lan] [PATCH] igb: skip phy status check where unavailable

igb_read_phy_reg() will silently return, leaving phy_data untouched, if hw->ops.read_reg isn't set. Depending on the uninitialized value of phy_data, this led to the phy status check either succeeding immediately or looping continuously for 2 seconds before emitting a noisy err-level timeout. This message went out to the console even though there was no actual problem.

Instead, first check if there is read_reg function pointer. If not, proceed without trying to check the phy status register.

Quoted 7 lines
Fixes b72f3f72005d ("igb: When GbE link up, wait for Remote receiver status

condition")

---
 drivers/net/ethernet/intel/igb/igb_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Tested-by on v1 1/1
#2 lore raw
In reply to Kevin Mitchell
Quoted 24 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Kevin Mitchell
Sent: Saturday, April 30, 2022 5:26 AM
Cc: [email protected]; [email protected]; linux- [email protected]; Takuma Ueba <[email protected]>; Jeff Kirsher <[email protected]>; [email protected]; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; David S. Miller <[email protected]>
Subject: [Intel-wired-lan] [PATCH] igb: skip phy status check where unavailable

igb_read_phy_reg() will silently return, leaving phy_data untouched, if hw->ops.read_reg isn't set. Depending on the uninitialized value of phy_data, this led to the phy status check either succeeding immediately or looping continuously for 2 seconds before emitting a noisy err-level timeout. This message went out to the console even though there was no actual problem.

Instead, first check if there is read_reg function pointer. If not, proceed without trying to check the phy status register.

Quoted 7 lines
Fixes b72f3f72005d ("igb: When GbE link up, wait for Remote receiver status

condition")

---
 drivers/net/ethernet/intel/igb/igb_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)