pm_runtime_put_autosuspend in probe will call suspend to disable clks
automatically if CONFIG_PM is defined. (If CONFIG_PM is not defined,
its implementation will be empty, then suspend will not be called.)
Therefore, we can call pm_runtime_get_sync to resume it first to enable
clks, which matches the suspend. (Only when CONFIG_PM is defined, otherwise
pm_runtime_get_sync will also be empty, then resume will not be called.)
Then it is fine to disable clks without causing clock count mis-match.
Fixes: c43eab3eddb4 ("net: fec: add missed clk_disable_unprepare in remove")
Signed-off-by: Chuhong Yuan <redacted>
---
drivers/net/ethernet/freescale/fec_main.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
pm_runtime_put_autosuspend in probe will call suspend to disable clks
automatically if CONFIG_PM is defined. (If CONFIG_PM is not defined, its
implementation will be empty, then suspend will not be called.)
suspend -> runtime suspend
Therefore, we can call pm_runtime_get_sync to resume it first to enable clks,
resume -> runtime resume
which matches the suspend. (Only when CONFIG_PM is defined, otherwise
suspend -> runtime suspend
quoted hunk
pm_runtime_get_sync will also be empty, then resume will not be called.)
Then it is fine to disable clks without causing clock count mis-match.
Fixes: c43eab3eddb4 ("net: fec: add missed clk_disable_unprepare in
remove")
Signed-off-by: Chuhong Yuan <redacted>
---
drivers/net/ethernet/freescale/fec_main.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
pm_runtime_put_autosuspend in probe will call suspend to disable clks
automatically if CONFIG_PM is defined. (If CONFIG_PM is not defined,
its implementation will be empty, then suspend will not be called.)
Therefore, we can call pm_runtime_get_sync to resume it first to enable
clks, which matches the suspend. (Only when CONFIG_PM is defined, otherwise
pm_runtime_get_sync will also be empty, then resume will not be called.)
Then it is fine to disable clks without causing clock count mis-match.
Fixes: c43eab3eddb4 ("net: fec: add missed clk_disable_unprepare in remove")
Signed-off-by: Chuhong Yuan <redacted>
Please fix the commit message typos pointed out by Andy Duan and resubmit,
thank you.