Skip to contentSkip to conversation

net: phy: add workaround for issue where PHY driver doesn't bind to the device

PATCH In review Heiner Kallweit 3 participants 3 messages Nov 24, 2018 – Nov 28, 2018

Subsystems (3)
lore
Share & tools
lore

Heiner Kallweit

author maintainer
#0 lore raw

PATCH 1/1 net: phy: add workaround for issue where PHY driver doesn't bind to the device

After switching the r8169 driver to use phylib some user reported that their network is broken. This was caused by the genphy PHY driver being used instead of the dedicated PHY driver for the RTL8211B. Users reported that loading the Realtek PHY driver module upfront fixes the issue. See also this mail thread:
https://marc.info/?t=154279781800003&r=1&w=2
The issue is quite weird and the root cause seems to be somewhere in the base driver core. The patch works around the issue and may be removed once the actual issue is fixed.

The Fixes tag refers to the first reported occurrence of the issue. The issue itself may have been existing much longer and it may affect users of other network chips as well. Users typically will recognize this issue only if their PHY stops working when being used with the genphy driver.

Fixes f1e911d5d0df ("r8169: add basic phylib support")

---
I'm not sure how long it will take to find and fix the root cause of the issue. With this workaround affected users have a working network again from 4.19.5 at least.

---
 drivers/net/phy/phy_device.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/net/phy/phy_device.c +8 -0
index e06613f2d..0904002b1 100644
@@ -2255,6 +2255,14 @@ int phy_driver_register(struct phy_driver *new_driver, struct module *owner)
 	new_driver->mdiodrv.driver.remove = phy_remove;
 	new_driver->mdiodrv.driver.owner = owner;
 
+	/* The following works around an issue where the PHY driver doesn't bind
+	 * to the device, resulting in the genphy driver being used instead of
+	 * the dedicated driver. The root cause of the issue isn't known yet
+	 * and seems to be in the base driver core. Once this is fixed we may
+	 * remove this workaround.
+	 */
+	new_driver->mdiodrv.driver.probe_type = PROBE_FORCE_SYNCHRONOUS;
+
 	retval = driver_register(&new_driver->mdiodrv.driver);
 	if (retval) {
 		pr_err("%s: Error %d in registering driver\n",
Signature · 1 line
2.19.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Heiner Kallweit

After switching the r8169 driver to use phylib some user reported that their network is broken. This was caused by the genphy PHY driver being used instead of the dedicated PHY driver for the RTL8211B. Users reported that loading the Realtek PHY driver module upfront fixes the issue. See also this mail thread:
https://marc.info/?t=154279781800003&r=1&w=2
The issue is quite weird and the root cause seems to be somewhere in the base driver core. The patch works around the issue and may be removed once the actual issue is fixed.

The Fixes tag refers to the first reported occurrence of the issue. The issue itself may have been existing much longer and it may affect users of other network chips as well. Users typically will recognize this issue only if their PHY stops working when being used with the genphy driver.

Quoted 6 lines
Fixes f1e911d5d0df ("r8169: add basic phylib support")

---
I'm not sure how long it will take to find and fix the root cause of the issue. With this workaround affected users have a working network again from 4.19.5 at least.

Hi Heiner

Lets go with this for the moment. That gives us time to try to figure out what is going on to cause the wrong driver to be used for the r8169.

Andrew

maintainer
#2 lore raw
In reply to Heiner Kallweit

From: Heiner Kallweit <[email protected]>
Date: Fri, 23 Nov 2018 19:41:29 +0100

Quoted 10 lines

After switching the r8169 driver to use phylib some user reported that their network is broken. This was caused by the genphy PHY driver being used instead of the dedicated PHY driver for the RTL8211B. Users reported that loading the Realtek PHY driver module upfront fixes the issue. See also this mail thread:
https://marc.info/?t=154279781800003&r=1&w=2
The issue is quite weird and the root cause seems to be somewhere in the base driver core. The patch works around the issue and may be removed once the actual issue is fixed.

Quoted 8 lines

The Fixes tag refers to the first reported occurrence of the issue. The issue itself may have been existing much longer and it may affect users of other network chips as well. Users typically will recognize this issue only if their PHY stops working when being used with the genphy driver.

Fixes f1e911d5d0df ("r8169: add basic phylib support")

Applied and queued up for -stable.