]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:21:50 +0000 (14:21 -0300)
commitece4d8727b45c521a1d4ca597e1873814d186001
treea9859289c1c3fdefc244686cceac147942e03966
parenteaed32b04ec886162c21aa2a91efdb536351e780
net: fec: fix clock count mis-match

BugLink: https://bugs.launchpad.net/bugs/1855787
commit a31eda65ba210741b598044d045480494d0ed52a upstream.

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@gmail.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/ethernet/freescale/fec_main.c