Skip to contentSkip to conversation

net: stmmac: Fix clock handling on remove path

PATCH Applied Wong Vee Khee 3 participants 3 messages Sep 25, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: stmmac: Fix clock handling on remove path

While unloading the dwmac-intel driver, clk_disable_unprepare() is being called twice in stmmac_dvr_remove() and intel_eth_pci_remove(). This causes kernel panic on the second call.

Removing the second call of clk_disable_unprepare() in intel_eth_pci_remove().

Fixes 09f012e64e4b ("stmmac: intel: Fix clock handling on error and remove paths")
Cc Andy Shevchenko <[email protected]>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +0 -1
index 2ac9dfb3462c..9e6d60e75f85 100644
@@ -653,7 +653,6 @@ static void intel_eth_pci_remove(struct pci_dev *pdev)
 
 	pci_free_irq_vectors(pdev);
 
-	clk_disable_unprepare(priv->plat->stmmac_clk);
 	clk_unregister_fixed_rate(priv->plat->stmmac_clk);
 
 	pcim_iounmap_regions(pdev, BIT(0));
Signature · 1 line
2.17.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Wong Vee Khee

While unloading the dwmac-intel driver, clk_disable_unprepare() is being called twice in stmmac_dvr_remove() and intel_eth_pci_remove(). This causes kernel panic on the second call.

Removing the second call of clk_disable_unprepare() in intel_eth_pci_remove().

Thanks! I'm not sure how I missed this...

Quoted 23 lines
Fixes 09f012e64e4b ("stmmac: intel: Fix clock handling on error and remove paths")
Cc Andy Shevchenko <[email protected]>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +0 -2
index 2ac9dfb3462c..9e6d60e75f85 100644
@@ -653,7 +653,6 @@ static void intel_eth_pci_remove(struct pci_dev *pdev)
 
        pci_free_irq_vectors(pdev);
 
-       clk_disable_unprepare(priv->plat->stmmac_clk);
        clk_unregister_fixed_rate(priv->plat->stmmac_clk);
 
        pcim_iounmap_regions(pdev, BIT(0));
--

2.17.0

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer Applied
#2 lore raw
In reply to Wong Vee Khee

From: Wong Vee Khee <[email protected]>
Date: Fri, 25 Sep 2020 17:54:06 +0800

Quoted 11 lines

While unloading the dwmac-intel driver, clk_disable_unprepare() is being called twice in stmmac_dvr_remove() and intel_eth_pci_remove(). This causes kernel panic on the second call.

Removing the second call of clk_disable_unprepare() in intel_eth_pci_remove().

Fixes 09f012e64e4b ("stmmac: intel: Fix clock handling on error and remove paths")
Cc Andy Shevchenko <[email protected]>

Applied, thanks.