Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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")
Signed-off-by: Kevin Mitchell <kevmitch@arista.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Kevin Mitchell and committed by
David S. Miller
942d2ad5 b8cedb70

+2 -1
+2 -1
drivers/net/ethernet/intel/igb/igb_main.c
··· 5505 5505 break; 5506 5506 } 5507 5507 5508 - if (adapter->link_speed != SPEED_1000) 5508 + if (adapter->link_speed != SPEED_1000 || 5509 + !hw->phy.ops.read_reg) 5509 5510 goto no_wait; 5510 5511 5511 5512 /* wait for Remote receiver status OK */