[PATCH net-next v10 07/11] net: pcs: xpcs: add Rockchip RK3568 platform glue driver
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Wed Sep 23 13:05:23 PDT 2026
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] pm: unbalanced pm_runtime_enable on teardown
--
commit 43d28493f3eec64a96af219e5448ffe0efe56d58
Author: Coia Prant <coiaprant at gmail.com>
net: pcs: xpcs: add Rockchip RK3568 platform glue driver
This commit introduces a new platform glue driver for the Synopsys DesignWare
XPCS on Rockchip RK3568 SoCs. It implements an MDIO bus that translates
requests to APB3 memory-mapped registers. It also adds necessary clock and
power domain management for the device.
Link: https://dl.radxa.com/rock3/docs/hw/datasheet/Rockchip%20RK3568%20TRM%20Part1%20V1.1-20210301.pdf (Page 59, CRU_CLKSEL_CON29)
Link: https://dl.radxa.com/rock3/docs/hw/datasheet/Rockchip%20RK3568%20TRM%20Part2%20V1.1-20210301.pdf (Page 2078)
> diff --git a/drivers/net/pcs/pcs-xpcs-rk.c b/drivers/net/pcs/pcs-xpcs-rk.c
> new file mode 100644
> index 0000000000000..35ee980a759e5
> --- /dev/null
> +++ b/drivers/net/pcs/pcs-xpcs-rk.c
[ ... ]
> +static void xpcs_rk_exit_clk(void *data)
> +{
> + struct dw_xpcs_rk *pxpcs = data;
> + struct device *dev = &pxpcs->pdev->dev;
> +
> + pm_runtime_force_suspend(dev);
> + clk_disable_unprepare(pxpcs->eee_clk);
> +}
[Severity: Medium]
Could this lead to an unbalanced pm_runtime_enable?
In xpcs_rk_init_clk(), pm_runtime_enable(dev) is called, and this function
xpcs_rk_exit_clk() is registered as the devm teardown action. However,
pm_runtime_disable(dev) is not called here.
If the driver is unbound via sysfs or fails to probe later in the sequence,
the teardown action runs but leaves PM runtime enabled. This can trigger
kernel warnings about an unbalanced pm_runtime_enable and break subsequent
device binding PM state.
> +
> +static int xpcs_rk_init_clk(struct dw_xpcs_rk *pxpcs)
> +{
[ ... ]
> + ret = clk_prepare_enable(pxpcs->eee_clk);
> + if (ret) {
> + dev_err(dev, "Failed to enable EEE clock\n");
> + return ret;
> + }
> +
> + pm_runtime_set_suspended(dev);
> + pm_runtime_enable(dev);
> +
> + ret = devm_add_action_or_reset(dev, xpcs_rk_exit_clk, pxpcs);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260922200336.2201212-1-coiaprant@gmail.com?part=7
More information about the linux-phy
mailing list