Skip to content

Commit

Permalink
net: bcmgenet: Ensure MDIO unregistration has clocks enabled
Browse files Browse the repository at this point in the history
With support for Ethernet PHY LEDs having been added, while
unregistering a MDIO bus and its child device liks PHYs there may be
"late" accesses to the MDIO bus. One typical use case is setting the PHY
LEDs brightness to OFF for instance.

We need to ensure that the MDIO bus controller remains entirely
functional since it runs off the main GENET adapter clock.

Cc: [email protected]
Link: https://lore.kernel.org/all/[email protected]/
Fixes: 9a4e796 ("net: bcmgenet: utilize generic Broadcom UniMAC MDIO controller driver")
Signed-off-by: Florian Fainelli <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
ffainelli authored and kuba-moo committed Jun 24, 2023
1 parent 6f68fc3 commit 1b5ea7f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/broadcom/genet/bcmmii.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,5 +673,7 @@ void bcmgenet_mii_exit(struct net_device *dev)
if (of_phy_is_fixed_link(dn))
of_phy_deregister_fixed_link(dn);
of_node_put(priv->phy_dn);
clk_prepare_enable(priv->clk);
platform_device_unregister(priv->mii_pdev);
clk_disable_unprepare(priv->clk);
}

0 comments on commit 1b5ea7f

Please sign in to comment.