]> git.baikalelectronics.ru Git - kernel.git/commit
net: fec: fix clock count mis-match
authorChuhong Yuan <hslester96@gmail.com>
Wed, 20 Nov 2019 01:25:13 +0000 (09:25 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Nov 2019 02:58:54 +0000 (18:58 -0800)
commit850d04ac63a83da4bf4745221c4a83f25c81b17b
tree9992c4ca8df0523497f8b8cb757a50a502d1a332
parent81430f06a999c7b50ee96d90f4dac70a6755b3b3
net: fec: fix clock count mis-match

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: 52077e46413b ("net: fec: add missed clk_disable_unprepare in remove")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c