Re: [PATCH net v4] net: fec: fix clock count mis-match

From: David Miller
Date: Tue Nov 19 2019 - 21:59:50 EST


From: Chuhong Yuan <hslester96@xxxxxxxxx>
Date: Wed, 20 Nov 2019 09:25:13 +0800

> pm_runtime_put_autosuspend in probe will call runtime suspend to
> disable clks automatically if CONFIG_PM is defined. (If CONFIG_PM
> is not defined, its implementation will be empty, then runtime
> suspend will not be called.)
>
> Therefore, we can call pm_runtime_get_sync to runtime resume it
> first to enable clks, which matches the runtime suspend. (Only when
> CONFIG_PM is defined, otherwise pm_runtime_get_sync will also be
> empty, then runtime 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 <hslester96@xxxxxxxxx>
> ---
> Changes in v4:
> - Fix some typos.

Applied, thanks.