summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorSebastian Reichel <sebastian.reichel@collabora.com>2025-10-14 17:49:34 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-29 14:07:03 +0100
commit9f2db04c21cffbc023c4e26853a000fa75d06cb3 (patch)
treed137c1ff302d1ad757ebbaa47718b897a94f65af /drivers/net
parent42ed0784d11adebf748711e503af0eb9f1e6d81d (diff)
downloadlinux-9f2db04c21cffbc023c4e26853a000fa75d06cb3.tar.gz
linux-9f2db04c21cffbc023c4e26853a000fa75d06cb3.tar.bz2
linux-9f2db04c21cffbc023c4e26853a000fa75d06cb3.zip
net: stmmac: dwmac-rk: Fix disabling set_clock_selection
commit 7f864458e9a6d2000b726d14b3d3a706ac92a3b0 upstream. On all platforms set_clock_selection() writes to a GRF register. This requires certain clocks running and thus should happen before the clocks are disabled. This has been noticed on RK3576 Sige5, which hangs during system suspend when trying to suspend the second network interface. Note, that suspending the first interface works, because the second device ensures that the necessary clocks for the GRF are enabled. Cc: stable@vger.kernel.org Fixes: 2f2b60a0ec28 ("net: ethernet: stmmac: dwmac-rk: Add gmac support for rk3588") Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20251014-rockchip-network-clock-fix-v1-1-c257b4afdf75@collabora.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index d920a50dd16c..bab315517bad 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -1565,14 +1565,15 @@ static int gmac_clk_enable(struct rk_priv_data *bsp_priv, bool enable)
}
} else {
if (bsp_priv->clk_enabled) {
+ if (bsp_priv->ops && bsp_priv->ops->set_clock_selection) {
+ bsp_priv->ops->set_clock_selection(bsp_priv,
+ bsp_priv->clock_input, false);
+ }
+
clk_bulk_disable_unprepare(bsp_priv->num_clks,
bsp_priv->clks);
clk_disable_unprepare(bsp_priv->clk_phy);
- if (bsp_priv->ops && bsp_priv->ops->set_clock_selection)
- bsp_priv->ops->set_clock_selection(bsp_priv,
- bsp_priv->clock_input, false);
-
bsp_priv->clk_enabled = false;
}
}