Linux-PHY Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Coia Prant" <coiaprant@gmail.com>
Cc: robh@kernel.org, devicetree@vger.kernel.org,
	linux-phy@lists.infradead.org, olteanv@gmail.com,
	wsa+renesas@sang-engineering.com, vkoul@kernel.org,
	neil.armstrong@linaro.org, conor+dt@kernel.org
Subject: Re: [PATCH net-next v10 07/11] net: pcs: xpcs: add Rockchip RK3568 platform glue driver
Date: Wed, 23 Sep 2026 20:05:23 +0000	[thread overview]
Message-ID: <20260923200523.E766D1F00898@smtp.kernel.org> (raw)
In-Reply-To: <20260922200336.2201212-8-coiaprant@gmail.com>

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@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

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

  reply	other threads:[~2026-09-23 20:05 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22 20:03 [PATCH net-next v10 00/11] net: pcs: add basic support for RK3568 XPCS Coia Prant
2026-09-22 20:03 ` [PATCH net-next v10 01/11] net: stmmac: move XPCS lifetime management to platform drivers Coia Prant
2026-09-25  2:03   ` netdev-bot+sashiko
2026-09-22 20:03 ` [PATCH net-next v10 02/11] dt-bindings: phy: rockchip: naneng-combphy: add rockchip,sgmii-mac-sel property Coia Prant
2026-09-25  2:03   ` netdev-bot+sashiko
2026-09-22 20:03 ` [PATCH net-next v10 03/11] phy: rockchip: naneng-combphy: add SGMII MAC selection for RK3568 Coia Prant
2026-10-05 20:59   ` Jakub Kicinski
2026-10-05 21:15     ` Coia Prant
2026-10-05 21:43       ` Vinod Koul
2026-10-05 22:01         ` Coia Prant
2026-10-05 21:44       ` Jakub Kicinski
2026-10-05 22:04         ` Coia Prant
2026-09-22 20:03 ` [PATCH net-next v10 04/11] dt-bindings: net: pcs: add rockchip,rk3568-xpcs support Coia Prant
2026-09-22 20:03 ` [PATCH net-next v10 05/11] arm64: dts: rockchip: rk3568: add XPCS and fixed-clock nodes Coia Prant
2026-09-23 20:05   ` sashiko-bot
2026-09-24  5:19     ` Coia Prant
2026-09-25  2:03   ` netdev-bot+sashiko
2026-09-22 20:03 ` [PATCH net-next v10 06/11] net: pcs: xpcs: add ANRESTART support for SGMII link recovery Coia Prant
2026-09-25  2:03   ` netdev-bot+sashiko
2026-09-22 20:03 ` [PATCH net-next v10 07/11] net: pcs: xpcs: add Rockchip RK3568 platform glue driver Coia Prant
2026-09-23 20:05   ` sashiko-bot [this message]
2026-09-24  5:12     ` Coia Prant
2026-09-25  2:03   ` netdev-bot+sashiko
2026-09-25  4:52     ` Coia Prant
2026-09-22 20:03 ` [PATCH net-next v10 08/11] dt-bindings: net: rockchip-dwmac: document pcs-handle Coia Prant
2026-09-22 20:03 ` [PATCH net-next v10 09/11] net: stmmac: dwmac-rk: add SGMII support for RK3568 Coia Prant
2026-09-25  2:03   ` netdev-bot+sashiko
2026-09-25  4:31     ` Coia Prant
2026-09-22 20:03 ` [PATCH net-next v10 10/11] arm64: dts: rockchip: rk3568-photonicat: enable SGMII LAN port Coia Prant
2026-09-25  2:03   ` netdev-bot+sashiko
2026-09-22 20:03 ` [PATCH net-next v10 11/11] MAINTAINERS: add entry for Rockchip XPCS driver Coia Prant
2026-09-23  2:50 ` [PATCH net-next v10 00/11] net: pcs: add basic support for RK3568 XPCS Jakub Kicinski
2026-09-23 12:40   ` Coia Prant
2026-10-05 20:58 ` Jakub Kicinski
2026-10-05 21:13   ` Coia Prant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260923200523.E766D1F00898@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=coiaprant@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox