Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Jonas Gorski
Fri, 27 Nov 2026 14:26
Re: [PATCH net v2 1/2] bcm63xx_enet: Prevent unbalanced clk_disable_unprepare() call in bcm_enet_remove()
Author: Jonas Gorski
Date: Fri, 27 Nov 2026 14:26
Date: Fri, 27 Nov 2026 14:26
55 lines
14428 bytes
14428 bytes
On Fri, Nov 27, 2026 at 3:04 PM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 27 Nov 2026 11:52:23 +0100
>
> A clk_prepare_enable(priv->phy_clk) call was specified within an if branch
> in the implementation of the function “bcm_enet_probe” while
> a clk_disable_unprepare(priv->phy_clk) call was unconditionally performed
> in the implementation of the function “bcm_enet_remove”.
> Move this clk_disable_unprepare() call into a corresponding if branch.
>
> Fixes: 7e697ce99ceb09538cdc1dfa9ebb3db60236b0a7 ("bcm63xx_enet: use managed functions for clock/ioremap")
> Cc: stable@vger.kernel.org
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/net/ethernet/broadcom/bcm63xx_enet.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
> index f6595fdc888d..cc9a5cd2a2a3 100644
> --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
> +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
> @@ -1915,6 +1915,9 @@ static void bcm_enet_remove(struct platform_device *pdev)
> enet_writel(priv, 0, ENET_MIISC_REG);
>
> if (priv->has_phy) {
> + if (!priv->use_external_mii)
> + clk_disable_unprepare(priv->phy_clk);
> +
> mdiobus_unregister(priv->mii_bus);
> mdiobus_free(priv->mii_bus);
> } else {
> @@ -1927,7 +1930,6 @@ static void bcm_enet_remove(struct platform_device *pdev)
> }
>
> /* disable hw block clocks */
> - clk_disable_unprepare(priv->phy_clk);
clk_disable_unprepare() is NULL-safe, so it's fine to call it
unconditionally. This change fixes nothing, just adds potential
breakage (disabling the phy clock before unregistering the mdio bus
feels risky).
> clk_disable_unprepare(priv->mac_clk);
Best regards,
Jonas
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads