From 6e28dfc6bcae6193e0716eca9e034f015ee84701 Mon Sep 17 00:00:00 2001 From: Fugang Duan Date: Thu, 4 May 2017 18:20:23 +0800 Subject: MLK-14805 Revert "MLK-14470 net: fec: let shared mii bus always be active" This reverts commit a87bb06a0bc7 that breaks busfreq test case. Signed-off-by: Fugang Duan --- drivers/net/ethernet/freescale/fec_main.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'drivers/net/ethernet/freescale/fec_main.c') diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index ca2874ba38f2..51a0401f0dbf 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -2918,12 +2918,9 @@ fec_enet_open(struct net_device *ndev) return ret; pinctrl_pm_select_default_state(&fep->pdev->dev); - if (!(fep->mii_bus_share && fep->mii_bus_active)) { - fep->mii_bus_active = true;; - ret = fec_enet_clk_enable(ndev, true); - if (ret) - goto clk_enable; - } + ret = fec_enet_clk_enable(ndev, true); + if (ret) + goto clk_enable; /* I should reset the ring buffers here, but I don't yet know * a simple way to do that. @@ -2971,11 +2968,10 @@ err_enet_alloc: if (!fep->mii_bus_share) fec_enet_clk_enable(ndev, false); clk_enable: - if (!fep->mii_bus_share) { - pm_runtime_mark_last_busy(&fep->pdev->dev); - pm_runtime_put_autosuspend(&fep->pdev->dev); + pm_runtime_mark_last_busy(&fep->pdev->dev); + pm_runtime_put_autosuspend(&fep->pdev->dev); + if (!fep->mii_bus_share) pinctrl_pm_select_sleep_state(&fep->pdev->dev); - } return ret; } @@ -3000,10 +2996,7 @@ fec_enet_close(struct net_device *ndev) fec_enet_update_ethtool_stats(ndev); - if (!fep->mii_bus_share) { - fec_enet_clk_enable(ndev, false); - fep->mii_bus_active = false; - } + fec_enet_clk_enable(ndev, false); pm_qos_remove_request(&fep->pm_qos_req); pinctrl_pm_select_sleep_state(&fep->pdev->dev); pm_runtime_mark_last_busy(&fep->pdev->dev); -- cgit v1.2.3