linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2] net: fec: add a check for CONFIG_PM to avoid clock count mis-match
@ 2019-11-12 11:28 Chuhong Yuan
  2019-11-12 19:13 ` David Miller
  2019-11-15 20:10 ` David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Chuhong Yuan @ 2019-11-12 11:28 UTC (permalink / raw)
  Cc: Fugang Duan, David S . Miller, netdev, linux-kernel, Chuhong Yuan

If CONFIG_PM is enabled, runtime pm will work and call runtime_suspend
automatically to disable clks.
Therefore, remove only needs to disable clks when CONFIG_PM is disabled.
Add this check to avoid clock count mis-match caused by double-disable.

Fixes: c43eab3eddb4 ("net: fec: add missed clk_disable_unprepare in remove")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
Changes in v2:
  - Add fixes tag.

 drivers/net/ethernet/freescale/fec_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index a9c386b63581..696550f4972f 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -3645,8 +3645,10 @@ fec_drv_remove(struct platform_device *pdev)
 		regulator_disable(fep->reg_phy);
 	pm_runtime_put(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
+#ifndef CONFIG_PM
 	clk_disable_unprepare(fep->clk_ahb);
 	clk_disable_unprepare(fep->clk_ipg);
+#endif
 	if (of_phy_is_fixed_link(np))
 		of_phy_deregister_fixed_link(np);
 	of_node_put(fep->phy_node);
-- 
2.23.0


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

end of thread, other threads:[~2019-11-18  6:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-12 11:28 [PATCH net v2] net: fec: add a check for CONFIG_PM to avoid clock count mis-match Chuhong Yuan
2019-11-12 19:13 ` David Miller
2019-11-13  1:50   ` [EXT] " Andy Duan
2019-11-15 20:10 ` David Miller
2019-11-16  6:57   ` [EXT] " Andy Duan
2019-11-16 14:00     ` Chuhong Yuan
2019-11-18  6:47       ` Andy Duan

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).