From: sashiko-bot@kernel.org
To: "Bartosz Golaszewski" <bartosz.golaszewski@oss.qualcomm.com>
Cc: wsa+renesas@sang-engineering.com, devicetree@vger.kernel.org,
robh@kernel.org, linux-amlogic@lists.infradead.org,
linux-sunxi@lists.linux.dev, neil.armstrong@linaro.org,
conor+dt@kernel.org, Frank.Li@kernel.org, imx@lists.linux.dev
Subject: Re: [PATCH net-next v12 2/7] phy: qcom: add the SGMII SerDes PHY driver for SCMI systems
Date: Tue, 07 Jul 2026 14:11:36 +0000 [thread overview]
Message-ID: <20260707141136.AAE031F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260706-qcom-sa8255p-emac-v12-2-e3ab1ecf2901@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The `set_mode` callback fails to dynamically apply the new performance state to the PM domain when the PHY is already active.
- [High] Incorrect ordering of `dev_pm_genpd_set_performance_state()` around runtime PM functions causes hardware under-voltage.
--
commit d60c07674fdf361d41a55e9d09fbdf040bae5797
Author: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
phy: qcom: add the SGMII SerDes PHY driver for SCMI systems
This commit implements support for the firmware-managed SGMII/SerDes PHY
present on Qualcomm platforms. It introduces a separate driver for the SCMI
system variant as it shares almost no code with the HLOS-managed version.
> 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..8ee62189556fe
> --- /dev/null
> +++ b/drivers/phy/qualcomm/phy-qcom-sgmii-eth-scmi.c
[ ... ]
> +static int qcom_dwmac_sgmii_phy_scmi_power_on(struct phy *phy)
> +{
> + struct qcom_dwmac_sgmii_phy_scmi *priv = phy_get_drvdata(phy);
> + struct device *dev = phy->dev.parent;
> + int ret;
> +
> + ret = pm_runtime_resume_and_get(dev);
> + if (ret)
> + return ret;
> +
> + ret = dev_pm_genpd_set_performance_state(dev, priv->perf_state);
[Severity: High]
Should dev_pm_genpd_set_performance_state() be called before
pm_runtime_resume_and_get()?
If pm_runtime_resume_and_get() runs first, it appears the genpd runtime
resume handler will power on the domain at its previous performance state (0)
before the driver raises it. Could this starve the hardware during power-on?
> + if (ret) {
> + pm_runtime_put(dev);
> + return ret;
> + }
> +
> + usleep_range(5000, 10000);
> +
> + return 0;
> +}
> +
> +static int qcom_dwmac_sgmii_phy_scmi_power_off(struct phy *phy)
> +{
> + struct device *dev = phy->dev.parent;
> +
> + dev_pm_genpd_set_performance_state(dev, 0);
> + pm_runtime_put(dev);
[Severity: High]
Does dropping the performance state before putting the device cause a voltage
drop while the hardware is still active?
Since pm_runtime_put() is asynchronous, the hardware might still be actively
powered when dev_pm_genpd_set_performance_state(dev, 0) drops the state. Could
this ordering violate hardware voltage requirements?
> +
> + return 0;
> +}
[ ... ]
> +static int qcom_dwmac_sgmii_phy_scmi_set_mode(struct phy *phy, enum phy_mode mode,
> + int submode)
> +{
> + struct qcom_dwmac_sgmii_phy_scmi *priv = phy_get_drvdata(phy);
> + int ret;
> +
> + ret = qcom_dwmac_sgmii_phy_scmi_validate(phy, mode, submode, NULL);
> + if (ret)
> + return ret;
> +
> + priv->perf_state = (submode == PHY_INTERFACE_MODE_2500BASEX) ?
> + SPEED_2500 : SPEED_1000;
> +
> + return 0;
> +}
[Severity: High]
Does this code need to apply the new performance state to the active PM domain
if the PHY is already powered on?
When the MAC driver dynamically changes the link speed while the interface is
up, updating only priv->perf_state without calling
dev_pm_genpd_set_performance_state() might leave the hardware operating at an
incorrect voltage state.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260706-qcom-sa8255p-emac-v12-0-e3ab1ecf2901@oss.qualcomm.com?part=2
next prev parent reply other threads:[~2026-07-07 14:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 13:20 [PATCH net-next v12 0/7] net: stmmac: qcom-ethqos: add support for SCMI power domains Bartosz Golaszewski
2026-07-06 13:20 ` [PATCH net-next v12 1/7] dt-bindings: phy: document the serdes PHY on sa8255p Bartosz Golaszewski
2026-07-07 14:11 ` sashiko-bot
2026-07-06 13:20 ` [PATCH net-next v12 2/7] phy: qcom: add the SGMII SerDes PHY driver for SCMI systems Bartosz Golaszewski
2026-07-06 17:10 ` Uwe Kleine-König
2026-07-07 14:11 ` sashiko-bot [this message]
2026-07-06 13:20 ` [PATCH net-next v12 3/7] dt-bindings: net: qcom: document the ethqos device for SCMI-based systems Bartosz Golaszewski
2026-07-07 14:11 ` sashiko-bot
2026-07-06 13:20 ` [PATCH net-next v12 4/7] net: stmmac: qcom-ethqos: set serdes mode before powerup Bartosz Golaszewski
2026-07-07 14:11 ` sashiko-bot
2026-07-06 13:20 ` [PATCH net-next v12 5/7] net: stmmac: qcom-ethqos: reuse the address of ethqos_emac_driver_data Bartosz Golaszewski
2026-07-06 13:20 ` [PATCH net-next v12 6/7] net: stmmac: qcom-ethqos: factor out linux-level setup into a separate function Bartosz Golaszewski
2026-07-06 13:20 ` [PATCH net-next v12 7/7] net: stmmac: qcom-ethqos: add support for sa8255p Bartosz Golaszewski
2026-07-07 14:11 ` sashiko-bot
2026-07-07 7:48 ` [PATCH net-next v12 0/7] net: stmmac: qcom-ethqos: add support for SCMI power domains 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=20260707141136.AAE031F00A3A@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