linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 1/1] net: stmmac: Fix clock handling on remove path
@ 2020-09-25  9:54 Wong Vee Khee
  2020-09-25 10:21 ` Andy Shevchenko
  2020-09-25 23:49 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Wong Vee Khee @ 2020-09-25  9:54 UTC (permalink / raw)
  To: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
	David S . Miller, Jakub Kicinski, Maxime Coquelin
  Cc: Mark Gross, Voon Wei Feng, Wong Vee Khee, netdev, linux-kernel,
	Seow Chen Yong, Vijaya Balan Sadhishkhanna, Ong Boon Leong,
	Andy Shevchenko, linux-stm32, linux-arm-kernel

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 <andriy.shevchenko@linux.intel.com>
Reviewed-by: Voon Weifeng <weifeng.voon@intel.com>
Signed-off-by: Wong Vee Khee <vee.khee.wong@intel.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
index 2ac9dfb3462c..9e6d60e75f85 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
@@ -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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net 1/1] net: stmmac: Fix clock handling on remove path
  2020-09-25  9:54 [PATCH net 1/1] net: stmmac: Fix clock handling on remove path Wong Vee Khee
@ 2020-09-25 10:21 ` Andy Shevchenko
  2020-09-25 23:49 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2020-09-25 10:21 UTC (permalink / raw)
  To: Wong Vee Khee
  Cc: Mark Gross, Alexandre Torgue, Voon Wei Feng, netdev,
	Linux Kernel Mailing List, linux-stm32, Seow Chen Yong,
	Jose Abreu, Vijaya Balan Sadhishkhanna, Maxime Coquelin,
	Jakub Kicinski, Ong Boon Leong, Giuseppe Cavallaro,
	Andy Shevchenko, David S . Miller, linux-arm Mailing List

On Fri, Sep 25, 2020 at 12:54 PM Wong Vee Khee <vee.khee.wong@intel.com> wrote:
>
> 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...

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Fixes: 09f012e64e4b ("stmmac: intel: Fix clock handling on error and remove paths")
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Voon Weifeng <weifeng.voon@intel.com>
> Signed-off-by: Wong Vee Khee <vee.khee.wong@intel.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
> index 2ac9dfb3462c..9e6d60e75f85 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
> @@ -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
>


-- 
With Best Regards,
Andy Shevchenko

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net 1/1] net: stmmac: Fix clock handling on remove path
  2020-09-25  9:54 [PATCH net 1/1] net: stmmac: Fix clock handling on remove path Wong Vee Khee
  2020-09-25 10:21 ` Andy Shevchenko
@ 2020-09-25 23:49 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-09-25 23:49 UTC (permalink / raw)
  To: vee.khee.wong
  Cc: mgross, alexandre.torgue, weifeng.voon, netdev, linux-kernel,
	chen.yong.seow, joabreu, sadhishkhanna.vijaya.balan,
	mcoquelin.stm32, kuba, boon.leong.ong, peppe.cavallaro,
	andriy.shevchenko, linux-stm32, linux-arm-kernel

From: Wong Vee Khee <vee.khee.wong@intel.com>
Date: Fri, 25 Sep 2020 17:54:06 +0800

> 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 <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Voon Weifeng <weifeng.voon@intel.com>
> Signed-off-by: Wong Vee Khee <vee.khee.wong@intel.com>

Applied, thanks.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-25 23:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-25  9:54 [PATCH net 1/1] net: stmmac: Fix clock handling on remove path Wong Vee Khee
2020-09-25 10:21 ` Andy Shevchenko
2020-09-25 23:49 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).