From: sashiko-bot@kernel.org
To: "Bartosz Golaszewski" <bartosz.golaszewski@oss.qualcomm.com>
Cc: conor+dt@kernel.org, Frank.Li@kernel.org, imx@lists.linux.dev,
devicetree@vger.kernel.org, wsa+renesas@sang-engineering.com,
linux-amlogic@lists.infradead.org, neil.armstrong@linaro.org,
robh@kernel.org, linux-sunxi@lists.linux.dev
Subject: Re: [PATCH net-next v14 03/10] phy: qcom: add the SGMII SerDes PHY driver for SCMI systems
Date: Wed, 09 Sep 2026 17:09:16 +0000 [thread overview]
Message-ID: <20260909170916.8ABD81F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260908-qcom-sa8255p-emac-v14-3-ec212b747a7d@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] The driver's devres teardown sequence cancels an asynchronous suspend of the platform device, leaving the device permanently active.
- [High] Missing cleanup of the genpd performance state on driver unbind leaves a persistent power vote on the PM domain.
- [Low] The driver forcefully selects the user-visible PM subsystem from a leaf hardware driver, overriding user configuration.
--
commit dae3dafc17dff2635ed1048ccc9e18ab67fdf8a3
Author: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Subject: phy: qcom: add the SGMII SerDes PHY driver for SCMI systems
This commit adds a new firmware-managed variant of the Qualcomm DWMAC SGMII
SerDes/PHY driver. It introduces a separate driver from the HLOS-managed
variant since they share little code.
> diff --git a/drivers/phy/qualcomm/Kconfig b/drivers/phy/qualcomm/Kconfig
> index d910a5d1a1ac3..677662f642e42 100644
> --- a/drivers/phy/qualcomm/Kconfig
> +++ b/drivers/phy/qualcomm/Kconfig
[ ... ]
> +config PHY_QCOM_SGMII_ETH_SCMI
> + tristate "Qualcomm DWMAC SGMII SerDes/PHY driver (firmware managed)"
> + depends on OF && (ARCH_QCOM || COMPILE_TEST)
> + select GENERIC_PHY
> + select PM
> + select PM_GENERIC_DOMAINS
[Severity: Low]
Is it intended to forcefully select the user-visible PM subsystem from a leaf
hardware driver?
Leaf drivers typically use "depends on" for user-visible features like PM
to avoid overriding user configurations.
> + help
> + Enable this to support the internal SerDes/SGMII PHY on Qualcomm
> + chipsets where the SerDes hardware (clocks and registers) is owned
> + by the firmware.
> diff --git a/drivers/phy/qualcomm/phy-qcom-sgmii-eth-scmi.c b/drivers/phy/qualcomm/phy-qcom-sgmii-eth-scmi.c
> new file mode 100644
> index 0000000000000..ae961975dcd87
> --- /dev/null
> +++ b/drivers/phy/qualcomm/phy-qcom-sgmii-eth-scmi.c
[ ... ]
> +static int qcom_dwmac_sgmii_phy_scmi_set_mode(struct phy *phy, enum phy_mode mode,
> + int submode)
> +{
> + struct device *dev = phy->dev.parent;
> + unsigned int perf_state;
> + int ret;
> +
> + ret = qcom_dwmac_sgmii_phy_scmi_validate(phy, mode, submode, NULL);
> + if (ret)
> + return ret;
> +
> + perf_state = (submode == PHY_INTERFACE_MODE_2500BASEX) ?
> + SPEED_2500 : SPEED_1000;
> +
> + return dev_pm_genpd_set_performance_state(dev, perf_state);
[Severity: High]
If the genpd performance state is dynamically set to a value greater than 0
here, where does it get reset to 0?
Without a teardown path (such as a .remove callback or a dedicated devres
action) to explicitly reset the performance state, the PM domain hardware
might remain forced at a high performance state permanently after driver
unbind, wasting power. The genpd core does not automatically drop dynamically
set performance states on unbind.
> +}
[ ... ]
> +static void qcom_dwmac_sgmii_phy_scmi_runtime_disable(void *data)
> +{
> + struct device *dev = data;
> +
> + pm_runtime_disable(dev);
[Severity: High]
Will this devres teardown sequence cancel the asynchronous suspend of the
platform device?
In the devres unwinding sequence, phy_destroy() unregisters the PHY child,
which causes the PM core to queue an asynchronous pm_request_idle() for the
parent platform device.
If qcom_dwmac_sgmii_phy_scmi_runtime_disable() executes pm_runtime_disable()
immediately after, it aborts the pending idle request. This leaves the
platform device permanently locked in the active state. Could this be avoided
by ensuring the device suspends synchronously before disabling runtime PM?
> +}
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260908-qcom-sa8255p-emac-v14-0-ec212b747a7d@oss.qualcomm.com?part=3
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2026-09-09 17:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 14:57 [PATCH net-next v14 00/10] net: stmmac: qcom-ethqos: add support for SCMI power domains Bartosz Golaszewski
2026-09-08 14:57 ` [PATCH net-next v14 01/10] net: phy: aquantia: fix system interface type not updated in forced mode Bartosz Golaszewski
2026-09-08 14:57 ` [PATCH net-next v14 02/10] dt-bindings: phy: document the serdes PHY on sa8255p Bartosz Golaszewski
2026-09-08 14:57 ` [PATCH net-next v14 03/10] phy: qcom: add the SGMII SerDes PHY driver for SCMI systems Bartosz Golaszewski
2026-09-09 17:09 ` sashiko-bot [this message]
2026-09-08 14:57 ` [PATCH net-next v14 04/10] dt-bindings: net: qcom: document the ethqos device for SCMI-based systems Bartosz Golaszewski
2026-09-08 14:57 ` [PATCH net-next v14 05/10] net: stmmac: qcom-ethqos: set serdes mode before powerup Bartosz Golaszewski
2026-09-08 14:57 ` [PATCH net-next v14 06/10] net: stmmac: qcom-ethqos: update phy_mode to the resolved interface in mac_finish() Bartosz Golaszewski
2026-09-08 14:57 ` [PATCH net-next v14 07/10] net: stmmac: qcom-ethqos: fix SGMII loopback not set on resume after speed change Bartosz Golaszewski
2026-09-08 14:57 ` [PATCH net-next v14 08/10] net: stmmac: qcom-ethqos: reuse the address of ethqos_emac_driver_data Bartosz Golaszewski
2026-09-08 14:57 ` [PATCH net-next v14 09/10] net: stmmac: qcom-ethqos: factor out linux-level setup into a separate function Bartosz Golaszewski
2026-09-08 14:57 ` [PATCH net-next v14 10/10] net: stmmac: qcom-ethqos: add support for sa8255p Bartosz Golaszewski
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=20260909170916.8ABD81F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=bartosz.golaszewski@oss.qualcomm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=imx@lists.linux.dev \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=neil.armstrong@linaro.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--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
all inboxes | Powered by JetHome®