mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Hemanth Selam <hemanth.selam@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Jonas Gorski <jonas.gorski@gmail.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Christophe Jaillet <christophe.jaillet@wanadoo.fr>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Frank Li <Frank.Li@kernel.org>,
	Julia Lawall <Julia.Lawall@inria.fr>
Subject: [PATCH net v2 1/2] bcm63xx_enet: Prevent unbalanced clk_disable_unprepare() call in bcm_enet_remove()
Date: Fri, 27 Nov 2026 15:03:52 +0100	[thread overview]
Message-ID: <0302adc3-dbf2-4e62-ac9b-8923ac285506@web.de> (raw)
In-Reply-To: <7d7b20e7-6749-46c4-a6f8-462f83cd27e3@web.de>

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(priv->mac_clk);
 
 	free_netdev(dev);
-- 
2.56.1


  reply	other threads:[~2026-11-27 14:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 14:01 [PATCH v2 2/2] bcm63xx_enet: Adjustments for clock management Markus Elfring
2026-11-27 14:03 ` Markus Elfring [this message]
2026-11-27 14:14   ` [PATCH net v2 1/2] bcm63xx_enet: Prevent unbalanced clk_disable_unprepare() call in bcm_enet_remove() netdev-bot+sinfo
2026-11-27 14:26   ` Jonas Gorski
2026-11-27 14:33     ` [v2 " Markus Elfring
2026-11-27 14:07 ` [PATCH net v2 2/2] bcm63xx_enet: Use devm_clk_get_enabled() in two probe functions Markus Elfring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0302adc3-dbf2-4e62-ac9b-8923ac285506@web.de \
    --to=markus.elfring@web.de \
    --cc=Frank.Li@kernel.org \
    --cc=Julia.Lawall@inria.fr \
    --cc=andrew+netdev@lunn.ch \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=hemanth.selam@gmail.com \
    --cc=horms@kernel.org \
    --cc=jonas.gorski@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®