All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 net-next] net: phy: mdio_bus: make mdiobus_scan also cover PHY that only talks C45
@ 2019-08-27  1:52 Voon Weifeng
  2019-08-26 18:27 ` Florian Fainelli
  2019-08-26 21:28 ` David Miller
  0 siblings, 2 replies; 11+ messages in thread
From: Voon Weifeng @ 2019-08-27  1:52 UTC (permalink / raw)
  To: David S. Miller, Maxime Coquelin
  Cc: netdev, linux-kernel, Jose Abreu, Andrew Lunn, Florian Fainelli,
	Heiner Kallweit, Ong Boon Leong, Voon Weifeng

From: Ong Boon Leong <boon.leong.ong@intel.com>

Make mdiobus_scan() to try harder to look for any PHY that only talks C45.

Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com>
Signed-off-by: Voon Weifeng <weifeng.voon@intel.com>

diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index bd04fe762056..30dbc48b4c7e 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -525,8 +525,12 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr)
 	int err;
 
 	phydev = get_phy_device(bus, addr, false);
-	if (IS_ERR(phydev))
-		return phydev;
+	if (IS_ERR(phydev)) {
+		/* Try C45 to ensure we don't miss PHY that only talks C45 */
+		phydev = get_phy_device(bus, addr, true);
+		if (IS_ERR(phydev))
+			return phydev;
+	}
 
 	/*
 	 * For DT, see if the auto-probed phy has a correspoding child
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-08-28 17:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-27  1:52 [PATCH v1 net-next] net: phy: mdio_bus: make mdiobus_scan also cover PHY that only talks C45 Voon Weifeng
2019-08-26 18:27 ` Florian Fainelli
2019-08-26 18:54   ` Andrew Lunn
2019-08-27 15:23     ` Voon, Weifeng
2019-08-27 15:37       ` Florian Fainelli
2019-08-27 15:49       ` Andrew Lunn
2019-08-28 15:41         ` Ong, Boon Leong
2019-08-28 17:00           ` Florian Fainelli
2019-08-28 17:36             ` Voon, Weifeng
2019-08-26 21:28 ` David Miller
2019-08-27 10:25   ` Voon, Weifeng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.