From: sashiko-bot@kernel.org
To: "Coia Prant" <coiaprant@gmail.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH net-next v11 3/6] net: pcs: xpcs: add Rockchip RK3568 platform glue driver
Date: Fri, 09 Oct 2026 17:53:47 +0000 [thread overview]
Message-ID: <sashiko-outbox-165905@kernel.org> (raw)
In-Reply-To: <20261008175225.3375274-4-coiaprant@gmail.com>
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [Medium] pm: PD_PIPE powers off on suspend breaking MAC WoL
- [Medium] pm: missing pm_runtime_disable() on driver unbind
- [Medium] pm: missing pm_runtime_disable() on driver unbind
- [Low] pm: unbalanced pm_runtime_enable() due to missing pm_runtime_disable()
--
commit 10f6065a84e9613f4b783ffc88353c7a176a3fcd
Author: Coia Prant <coiaprant@gmail.com>
net: pcs: xpcs: add Rockchip RK3568 platform glue driver
The RK3568 SoC integrates a Synopsys DesignWare XPCS that is accessed
via APB3 memory-mapped registers. This driver provides the glue logic
to make the XPCS accessible to the generic pcs-xpcs core.
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
> index 0000000000000..698a43b753341
> --- /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);
> +}
> +
> +static int xpcs_rk_init_clk(struct dw_xpcs_rk *pxpcs)
> +{
> + struct device *dev = &pxpcs->pdev->dev;
> + unsigned long rate;
> + u64 mult;
> + int ret;
[ ... ]
> + pm_runtime_set_suspended(dev);
> + pm_runtime_enable(dev);
> +
> + ret = devm_add_action_or_reset(dev, xpcs_rk_exit_clk, pxpcs);
[Severity: Medium]
Will this leave the pm runtime disable_depth unbalanced when the driver is
unbound?
The driver calls pm_runtime_enable() in xpcs_rk_init_clk(), but the teardown
action xpcs_rk_exit_clk() doesn't call pm_runtime_disable() to unwind it.
Leaving runtime PM enabled after the device is unbound breaks the runtime PM
core's tracking and can trigger an "Unbalanced pm_runtime_enable!" warning
if the device is probed again.
Should devm_pm_runtime_enable() be used, or pm_runtime_disable() be
added to the cleanup function?
[ ... ]
> +static int xpcs_rk_system_suspend(struct device *dev)
> +{
> + /*
> + * Keep the PD_PIPE power domain on during system suspend.
> + *
> + * PD_PIPE is shared with SATA/PCIe and would be powered down by
> + * genpd once all its consumers are suspended, killing the SerDes
> + * and breaking MAC WoL. Mark the XPCS as part of the wakeup path
> + * so genpd keeps the domain on. Unconditional because the XPCS
> + * core has no callback to convey the MAC WoL state.
> + */
> + device_set_wakeup_path(dev);
[Severity: Medium]
Does genpd actually keep the power domain on when device_set_wakeup_path()
is called here?
The commit message notes this relies on the Rockchip power domain driver
setting GENPD_FLAG_ACTIVE_WAKEUP on PD_PIPE. However, looking at
drivers/pmdomain/rockchip/pm-domains.c:
rk3568_pm_domains[] {
...
[RK3568_PD_PIPE] = DOMAIN_RK3568("pipe", BIT(8), BIT(11), false, false),
...
}
The wakeup parameter is false, which means GENPD_FLAG_ACTIVE_WAKEUP is not
set. Because this flag is missing, won't genpd ignore the wakeup path and
power off the domain anyway, breaking MAC WoL?
> + return 0;
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261008175225.3375274-1-coiaprant@gmail.com?part=3
next prev parent reply other threads:[~2026-10-09 17:53 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-08 17:51 [PATCH net-next v11 0/6] net: pcs: add basic support for RK3568 XPCS Coia Prant
2026-10-08 17:51 ` Coia Prant
2026-10-08 17:51 ` [PATCH net-next v11 1/6] net: pcs: xpcs: add ANRESTART support for SGMII link recovery Coia Prant
2026-10-08 17:51 ` Coia Prant
2026-10-12 19:01 ` netdev-bot+sashiko
2026-10-12 19:01 ` netdev-bot+sashiko
2026-10-12 19:24 ` Coia Prant
2026-10-12 19:24 ` Coia Prant
2026-10-08 17:51 ` [PATCH net-next v11 2/6] dt-bindings: net: pcs: add rockchip,rk3568-xpcs support Coia Prant
2026-10-08 17:51 ` Coia Prant
2026-10-09 16:49 ` Rob Herring (Arm)
2026-10-09 16:49 ` Rob Herring (Arm)
2026-10-09 17:53 ` sashiko-bot
2026-10-12 19:01 ` netdev-bot+sashiko
2026-10-12 19:01 ` netdev-bot+sashiko
2026-10-08 17:51 ` [PATCH net-next v11 3/6] net: pcs: xpcs: add Rockchip RK3568 platform glue driver Coia Prant
2026-10-08 17:51 ` Coia Prant
2026-10-09 17:53 ` sashiko-bot [this message]
2026-10-12 19:01 ` netdev-bot+sashiko
2026-10-12 19:01 ` netdev-bot+sashiko
2026-10-08 17:51 ` [PATCH net-next v11 4/6] dt-bindings: net: rockchip-dwmac: document pcs-handle Coia Prant
2026-10-08 17:51 ` Coia Prant
2026-10-09 16:50 ` Rob Herring (Arm)
2026-10-09 16:50 ` Rob Herring (Arm)
2026-10-12 19:01 ` netdev-bot+sashiko
2026-10-12 19:01 ` netdev-bot+sashiko
2026-10-08 17:51 ` [PATCH net-next v11 5/6] net: stmmac: dwmac-rk: add SGMII support for RK3568 Coia Prant
2026-10-08 17:51 ` Coia Prant
2026-10-09 17:53 ` sashiko-bot
2026-10-12 19:01 ` netdev-bot+sashiko
2026-10-12 19:01 ` netdev-bot+sashiko
2026-10-08 17:52 ` [PATCH net-next v11 6/6] MAINTAINERS: add entry for Rockchip XPCS driver Coia Prant
2026-10-08 17:52 ` 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=sashiko-outbox-165905@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=coiaprant@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.