]> git.baikalelectronics.ru Git - kernel.git/commit
igb: skip phy status check where unavailable
authorKevin Mitchell <kevmitch@arista.com>
Tue, 17 May 2022 18:01:05 +0000 (11:01 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 May 2022 13:00:51 +0000 (14:00 +0100)
commit276a83f44035af00218341064504cc4902c62be4
tree8756518dee9f8bf1479973a589738d84d2056aac
parentca27cc3e47f53f58e6115d3686887040916a44d9
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: 2929c377ead7 ("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>
drivers/net/ethernet/intel/igb/igb_main.c