net: stmmac: Fix clock handling on remove path
Subsystems (4)
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().
--- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +0 -1
@@ -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
Quoted 7 lines · Wong Vee Khee
While unloading the dwmac-intel driver,
clk_disable_unprepare()is being called twice instmmac_dvr_remove()andintel_eth_pci_remove(). This causes kernel panic on the second call.Removing the second call of
clk_disable_unprepare()inintel_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]>Reviewed-by Voon Weifeng <[email protected]>Signed-off-by Wong Vee Khee <[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@@ -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
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 instmmac_dvr_remove()andintel_eth_pci_remove(). This causes kernel panic on the second call.Removing the second call of
clk_disable_unprepare()inintel_eth_pci_remove().Fixes 09f012e64e4b ("stmmac: intel: Fix clock handling on error and remove paths")Cc Andy Shevchenko <[email protected]>Reviewed-by Voon Weifeng <[email protected]>Signed-off-by Wong Vee Khee <[email protected]>
Applied, thanks.