From: Greg Kroah-Hartman Date: Wed, 4 Dec 2019 07:15:54 +0000 (+0100) Subject: 5.3-stable patches X-Git-Tag: v5.4.2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=14c94088374365da6b35a63536c406bd575196bc;p=thirdparty%2Fkernel%2Fstable-queue.git 5.3-stable patches added patches: net-fec-fix-clock-count-mis-match.patch --- diff --git a/queue-5.3/net-fec-fix-clock-count-mis-match.patch b/queue-5.3/net-fec-fix-clock-count-mis-match.patch new file mode 100644 index 00000000000..27e178979ba --- /dev/null +++ b/queue-5.3/net-fec-fix-clock-count-mis-match.patch @@ -0,0 +1,68 @@ +From a31eda65ba210741b598044d045480494d0ed52a Mon Sep 17 00:00:00 2001 +From: Chuhong Yuan +Date: Wed, 20 Nov 2019 09:25:13 +0800 +Subject: net: fec: fix clock count mis-match + +From: Chuhong Yuan + +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 +Acked-by: Fugang Duan +Signed-off-by: David S. Miller +Cc: Nobuhiro Iwamatsu +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/freescale/fec_main.c | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +--- a/drivers/net/ethernet/freescale/fec_main.c ++++ b/drivers/net/ethernet/freescale/fec_main.c +@@ -3580,6 +3580,11 @@ fec_drv_remove(struct platform_device *p + struct net_device *ndev = platform_get_drvdata(pdev); + struct fec_enet_private *fep = netdev_priv(ndev); + struct device_node *np = pdev->dev.of_node; ++ int ret; ++ ++ ret = pm_runtime_get_sync(&pdev->dev); ++ if (ret < 0) ++ return ret; + + cancel_work_sync(&fep->tx_timeout_work); + fec_ptp_stop(pdev); +@@ -3587,15 +3592,17 @@ fec_drv_remove(struct platform_device *p + fec_enet_mii_remove(fep); + if (fep->reg_phy) + regulator_disable(fep->reg_phy); +- pm_runtime_put(&pdev->dev); +- pm_runtime_disable(&pdev->dev); +- clk_disable_unprepare(fep->clk_ahb); +- clk_disable_unprepare(fep->clk_ipg); ++ + if (of_phy_is_fixed_link(np)) + of_phy_deregister_fixed_link(np); + of_node_put(fep->phy_node); + free_netdev(ndev); + ++ clk_disable_unprepare(fep->clk_ahb); ++ clk_disable_unprepare(fep->clk_ipg); ++ pm_runtime_put_noidle(&pdev->dev); ++ pm_runtime_disable(&pdev->dev); ++ + return 0; + } + diff --git a/queue-5.3/series b/queue-5.3/series index 15d12c85fa8..f3a9b6696d7 100644 --- a/queue-5.3/series +++ b/queue-5.3/series @@ -133,3 +133,4 @@ ext4-add-more-paranoia-checking-in-ext4_expand_extra_isize-handling.patch hid-core-check-whether-usage-page-item-is-after-usage-id-items.patch platform-x86-hp-wmi-fix-acpi-errors-caused-by-too-small-buffer.patch platform-x86-hp-wmi-fix-acpi-errors-caused-by-passing-0-as-input-size.patch +net-fec-fix-clock-count-mis-match.patch