Typically it helps to do a rmmod r8169 + modprobe r8169 to work around the BIOS bug.
Maybe also a PHY soft reset helps to make the PHY behave sanely again.
Can you test whether the following fixes the issue for you?
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 8b665f2ec..9b1ad5d45 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5104,6 +5104,17 @@ static int r8169_mdio_write_reg(struct mii_bus *mii_bus, int phyaddr,
return 0;
}
+ /* A BIOS bug causes few boards to report an invalid PHY ID otherwise */
+ if (tp->mac_version == RTL_GIGA_MAC_VER_25 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_26)
+ rtl_phy_soft_reset(tp);
+
ret = devm_mdiobus_register(new_bus);
if (ret)
return ret;
--
2.26.2
Typically it helps to do a rmmod r8169 + modprobe r8169 to work around the BIOS bug.
Maybe also a PHY soft reset helps to make the PHY behave sanely again.
Can you test whether the following fixes the issue for you?
diff --git a/drivers/ net/ethernet/ realtek/ r8169_main. c b/drivers/ net/ethernet/ realtek/ r8169_main. c .9b1ad5d45 100644 net/ethernet/ realtek/ r8169_main. c net/ethernet/ realtek/ r8169_main. c write_reg( struct mii_bus *mii_bus, int phyaddr,
index 8b665f2ec.
--- a/drivers/
+++ b/drivers/
@@ -5104,6 +5104,17 @@ static int r8169_mdio_
return 0;
}
+static void rtl_phy_ soft_reset( struct rtl8169_private *tp) register( struct rtl8169_private *tp) register( struct rtl8169_private *tp) read_reg; write_reg;
+{
+ int i = 30;
+
+ rtl_writephy(tp, MII_BMCR, BMCR_ANENABLE | BMCR_RESET);
+
+ do {
+ msleep(20);
+ } while (rtl_readphy(tp, MII_BMCR) & BMCR_RESET && --i);
+}
+
static int r8169_mdio_
{
struct pci_dev *pdev = tp->pci_dev;
@@ -5123,6 +5134,11 @@ static int r8169_mdio_
new_bus->read = r8169_mdio_
new_bus->write = r8169_mdio_
+ /* A BIOS bug causes few boards to report an invalid PHY ID otherwise */ MAC_VER_ 26) soft_reset( tp); register( new_bus) ;
+ if (tp->mac_version == RTL_GIGA_MAC_VER_25 ||
+ tp->mac_version == RTL_GIGA_
+ rtl_phy_
+
ret = devm_mdiobus_
if (ret)
return ret;
--
2.26.2