Skip to content

Commit 04f41c6

Browse files
Saravana Kannangregkh
authored andcommitted
net: mdiobus: Set FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD for mdiobus parents
There are many instances of PHYs that depend on a switch to supply a resource (Eg: interrupts). Switches also expects the PHYs to be probed by their specific drivers as soon as they are added. If that doesn't happen, then the switch would force the use of generic PHY drivers for the PHY even if the PHY might have specific driver available. fw_devlink=on by design can cause delayed probes of PHY. To avoid, this we need to set the FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD for the switch's fwnode before the PHYs are added. The most generic way to do this is to set this flag for the parent of MDIO busses which is typically the switch. For more context: https://lore.kernel.org/lkml/[email protected]/#t Fixes: ea718c6 ("Revert "Revert "driver core: Set fw_devlink=on by default""") Suggested-by: Andrew Lunn <[email protected]> Signed-off-by: Saravana Kannan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5501765 commit 04f41c6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/phy/mdio_bus.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,10 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner)
525525
NULL == bus->read || NULL == bus->write)
526526
return -EINVAL;
527527

528+
if (bus->parent && bus->parent->of_node)
529+
bus->parent->of_node->fwnode.flags |=
530+
FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD;
531+
528532
BUG_ON(bus->state != MDIOBUS_ALLOCATED &&
529533
bus->state != MDIOBUS_UNREGISTERED);
530534

0 commit comments

Comments
 (0)