[PATCH net] net: stmmac: rk: put the PHY clock on remove
Russell King (Oracle)
linux at armlinux.org.uk
Thu Aug 7 12:15:13 PDT 2025
On Thu, Aug 07, 2025 at 07:33:59PM +0100, Simon Horman wrote:
> On Thu, Aug 07, 2025 at 09:48:30AM +0100, Russell King (Oracle) wrote:
> > The PHY clock (bsp_priv->clk_phy) is obtained using of_clk_get(), which
> > doesn't take part in the devm release. Therefore, when a device is
> > unbound, this clock needs to be explicitly put. Fix this.
> >
> > Fixes: fecd4d7eef8b ("net: stmmac: dwmac-rk: Add integrated PHY support")
> > Signed-off-by: Russell King (Oracle) <rmk+kernel at armlinux.org.uk>
> > ---
> > Spotted this resource leak while making other changes to dwmac-rk.
> > Would be great if the dwmac-rk maintainers can test it.
> >
> > drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
> > index 79b92130a03f..4a315c87c4d0 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
> > @@ -1770,6 +1770,9 @@ static void rk_gmac_remove(struct platform_device *pdev)
> > stmmac_dvr_remove(&pdev->dev);
> >
> > rk_gmac_powerdown(bsp_priv);
> > +
> > + if (plat->phy_node && bsp_priv->integrated_phy)
> > + clk_put(bsp_priv->clk_phy);
>
> Hi Russell,
>
> Something seems a little off here.
> I don't see plat in this context in net.
Already have a fix for it, thanks anyway. Today ended up going awol
due to dentistry stuff. :(
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
More information about the linux-arm-kernel
mailing list