Skip to content

Commit 7f86445

Browse files
srekuba-moo
authored andcommitted
net: stmmac: dwmac-rk: Fix disabling set_clock_selection
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: 2f2b60a ("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>
1 parent bf29555 commit 7f86445

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,14 +1446,15 @@ static int gmac_clk_enable(struct rk_priv_data *bsp_priv, bool enable)
14461446
}
14471447
} else {
14481448
if (bsp_priv->clk_enabled) {
1449+
if (bsp_priv->ops && bsp_priv->ops->set_clock_selection) {
1450+
bsp_priv->ops->set_clock_selection(bsp_priv,
1451+
bsp_priv->clock_input, false);
1452+
}
1453+
14491454
clk_bulk_disable_unprepare(bsp_priv->num_clks,
14501455
bsp_priv->clks);
14511456
clk_disable_unprepare(bsp_priv->clk_phy);
14521457

1453-
if (bsp_priv->ops && bsp_priv->ops->set_clock_selection)
1454-
bsp_priv->ops->set_clock_selection(bsp_priv,
1455-
bsp_priv->clock_input, false);
1456-
14571458
bsp_priv->clk_enabled = false;
14581459
}
14591460
}

0 commit comments

Comments
 (0)