diff mbox series

[net] r8169: fix wrong PHY ID issue with RTL8168dp

Message ID 651a11c7-005b-3b62-61a2-496e91048b9d@gmail.com
State Accepted
Delegated to: David Miller
Headers show
Series [net] r8169: fix wrong PHY ID issue with RTL8168dp | expand

Commit Message

Heiner Kallweit Oct. 31, 2019, 11:10 p.m. UTC
As reported in [0] at least one RTL8168dp version has problems
establishing a link. This chip version has an integrated RTL8211b PHY,
however the chip seems to report a wrong PHY ID, resulting in a wrong
PHY driver (for Generic Realtek PHY) being loaded.
Work around this issue by adding a hook to r8168dp_2_mdio_read()
for returning the correct PHY ID.

[0] https://bbs.archlinux.org/viewtopic.php?id=246508

Fixes: 242cd9b5866a ("r8169: use phy_resume/phy_suspend")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
On kernel 4.19 the patch will not apply because source file
was renamed later from r8169.c to r8169_main.c.
Changing name of file to be patched should be sufficient.
---
 drivers/net/ethernet/realtek/r8169_main.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

David Miller Nov. 1, 2019, 10:10 p.m. UTC | #1
From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Fri, 1 Nov 2019 00:10:21 +0100

> As reported in [0] at least one RTL8168dp version has problems
> establishing a link. This chip version has an integrated RTL8211b PHY,
> however the chip seems to report a wrong PHY ID, resulting in a wrong
> PHY driver (for Generic Realtek PHY) being loaded.
> Work around this issue by adding a hook to r8168dp_2_mdio_read()
> for returning the correct PHY ID.
> 
> [0] https://bbs.archlinux.org/viewtopic.php?id=246508
> 
> Fixes: 242cd9b5866a ("r8169: use phy_resume/phy_suspend")
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Applied and queued up for -stable, thanks.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index dfd92f61e..0704f8bd1 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -1023,6 +1023,10 @@  static int r8168dp_2_mdio_read(struct rtl8169_private *tp, int reg)
 {
 	int value;
 
+	/* Work around issue with chip reporting wrong PHY ID */
+	if (reg == MII_PHYSID2)
+		return 0xc912;
+
 	r8168dp_2_mdio_start(tp);
 
 	value = r8169_mdio_read(tp, reg);