Skip to content

Commit 2ba6c07

Browse files
Todd FujinakaJeff Kirsher
authored andcommitted
igb: Fix i354 88E1112 PHY on RCC boards using AutoMediaDetect
e1000_check_for_link_media_swap() checks PHY page 0 for copper and PHY page 1 for "other" (fiber) link. The switch back from page 1 to page 0 happened too soon, before e1000_check_for_link_82575() is executed, and link on fiber (other) was never detected. Check for link while still on the proper PHY page. Signed-off-by: Todd Fujinaka <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 3b7884f commit 2ba6c07

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

drivers/net/ethernet/intel/igb/e1000_82575.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@ static s32 igb_check_for_link_media_swap(struct e1000_hw *hw)
139139
if (ret_val)
140140
return ret_val;
141141

142-
/* reset page to 0 */
143-
ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 0);
144-
if (ret_val)
145-
return ret_val;
146142

147143
if (data & E1000_M88E1112_STATUS_LINK)
148144
port = E1000_MEDIA_PORT_OTHER;
@@ -151,8 +147,20 @@ static s32 igb_check_for_link_media_swap(struct e1000_hw *hw)
151147
if (port && (hw->dev_spec._82575.media_port != port)) {
152148
hw->dev_spec._82575.media_port = port;
153149
hw->dev_spec._82575.media_changed = true;
150+
}
151+
152+
if (port == E1000_MEDIA_PORT_COPPER) {
153+
/* reset page to 0 */
154+
ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 0);
155+
if (ret_val)
156+
return ret_val;
157+
igb_check_for_link_82575(hw);
154158
} else {
155-
ret_val = igb_check_for_link_82575(hw);
159+
igb_check_for_link_82575(hw);
160+
/* reset page to 0 */
161+
ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 0);
162+
if (ret_val)
163+
return ret_val;
156164
}
157165

158166
return 0;

0 commit comments

Comments
 (0)