Skip to content

Commit 5d872c9

Browse files
hkallweitkuba-moo
authored andcommitted
r8169: fix issue caused by buggy BIOS on certain boards with RTL8168d
On some boards with this chip version the BIOS is buggy and misses to reset the PHY page selector. This results in the PHY ID read accessing registers on a different page, returning a more or less random value. Fix this by resetting the page selector first. Fixes: f1e911d ("r8169: add basic phylib support") Cc: [email protected] Signed-off-by: Heiner Kallweit <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b32a09e commit 5d872c9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5164,6 +5164,15 @@ static int r8169_mdio_register(struct rtl8169_private *tp)
51645164
struct mii_bus *new_bus;
51655165
int ret;
51665166

5167+
/* On some boards with this chip version the BIOS is buggy and misses
5168+
* to reset the PHY page selector. This results in the PHY ID read
5169+
* accessing registers on a different page, returning a more or
5170+
* less random value. Fix this by resetting the page selector first.
5171+
*/
5172+
if (tp->mac_version == RTL_GIGA_MAC_VER_25 ||
5173+
tp->mac_version == RTL_GIGA_MAC_VER_26)
5174+
r8169_mdio_write(tp, 0x1f, 0);
5175+
51675176
new_bus = devm_mdiobus_alloc(&pdev->dev);
51685177
if (!new_bus)
51695178
return -ENOMEM;

0 commit comments

Comments
 (0)