From: netdev-bot+sashiko@kernel.org
To: bartosz.golaszewski@oss.qualcomm.com
Cc: andersson@kernel.org, konradybcio@kernel.org, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, mcoquelin.stm32@gmail.com,
alexandre.torgue@foss.st.com, vkoul@kernel.org,
peppe.cavallaro@st.com, wens@kernel.org,
jernej.skrabec@gmail.com, neil.armstrong@linaro.org,
khilman@baylibre.com, jbrunet@baylibre.com, shawnguo@kernel.org,
festevam@gmail.com, jan.petrous@oss.nxp.com, s32@nxp.com,
mohd.anwar@oss.qualcomm.com, romain.gantois@bootlin.com,
geert+renesas@glider.be, magnus.damm@gmail.com,
mripard@kernel.org, christophe.roullier@foss.st.com,
brgl@kernel.org, radu@rendec.net, linux-arm-msm@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org, dfustini@tenstorrent.com,
linux-sunxi@lists.linux.dev, linux-amlogic@lists.infradead.org,
linux-mips@vger.kernel.org, imx@lists.linux.dev,
linux-renesas-soc@vger.kernel.org,
linux-rockchip@lists.infradead.org, sophgo@lists.linux.dev,
linux-riscv@lists.infradead.org, bartosz.golaszewski@linaro.org
Subject: Re: [PATCH net-next v15 5/9] net: stmmac: qcom-ethqos: set serdes mode before powerup
Date: Sun, 27 Sep 2026 16:29:12 +0000 [thread overview]
Message-ID: <179052655254.2160803.14087106323968541578@kernel.org> (raw)
In-Reply-To: <20260923-qcom-sa8255p-emac-v15-5-e82f33720737@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] In qcom_ethqos_serdes_powerup()
(drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c), the patch…
--
net: stmmac: qcom-ethqos: set serdes mode before powerup
This patch adds a call to phy_set_mode_ext() before phy_power_on() in
qcom_ethqos_serdes_powerup(). On SCMI systems the PHY driver needs it to
pick the right performance level, which sets the link speed. It prepares
for adding support for the firmware-managed EMAC on Qualcomm sa8255p.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> index ac7d6d3e205a1..47b70b5e706f2 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> @@ -601,10 +601,19 @@ static int qcom_ethqos_serdes_powerup(struct net_device *ndev, void *priv)
> if (ret)
> return ret;
>
> + ret = phy_set_mode_ext(ethqos->serdes_phy, PHY_MODE_ETHERNET,
> + ethqos->phy_mode);
> + if (ret)
> + goto err_out;
[Severity: Medium]
What happens here if ethqos->phy_mode is one of the RGMII variants?
qcom_ethqos_probe() accepts RGMII, RGMII_ID, RGMII_RXID and RGMII_TXID.
It installs serdes_powerup whenever a "serdes" PHY is found, whatever the
phy_mode is:
qcom_ethqos_probe() {
...
if (ethqos->serdes_phy) {
plat_dat->serdes_powerup = qcom_ethqos_serdes_powerup;
plat_dat->serdes_powerdown = qcom_ethqos_serdes_powerdown;
}
...
}
The qcom,ethqos binding allows this combination too. It has "phys: true"
and "phy-names: const: serdes", with no condition on phy-mode.
Both SerDes PHY drivers reject any submode other than SGMII, 1000BASEX
and 2500BASEX. In phy-qcom-sgmii-eth.c, qcom_dwmac_sgmii_phy_validate()
is called from qcom_dwmac_sgmii_phy_set_mode():
if (submode == PHY_INTERFACE_MODE_SGMII ||
submode == PHY_INTERFACE_MODE_1000BASEX ||
submode == PHY_INTERFACE_MODE_2500BASEX)
return 0;
return -EINVAL;
The new qcom_dwmac_sgmii_phy_scmi_validate() in
phy-qcom-sgmii-eth-scmi.c does the same.
Take a DT that sets phy-mode = "rgmii*" and also references an enabled
serdes PHY. With this patch, powerup would fail like this:
stmmac_open()
stmmac_legacy_serdes_power_up()
qcom_ethqos_serdes_powerup()
phy_set_mode_ext()
qcom_dwmac_sgmii_phy_set_mode()
qcom_dwmac_sgmii_phy_validate() returns -EINVAL
goto err_out -> phy_exit()
"SerDes powerup failed" is logged, and both stmmac_open() and
stmmac_resume() fail. Before this patch the same DT powered the SerDes
on without an error.
The other caller of this API in the same file already limits the call to
SerDes modes:
ethqos_mac_finish_serdes() {
...
if (interface == PHY_INTERFACE_MODE_SGMII ||
interface == PHY_INTERFACE_MODE_2500BASEX)
ret = phy_set_mode_ext(ethqos->serdes_phy, PHY_MODE_ETHERNET,
interface);
...
}
Later patches in the series don't change serdes_powerup. The patch that
updates phy_mode to the resolved interface in mac_finish() only touches
phy_mode inside mac_finish. mac_finish is only installed for SGMII and
2500BASEX, so an RGMII phy_mode would still reach this call at the end
of the series.
I checked the in-tree DTs. The boards that reference a serdes PHY
(lemans.dtsi and monaco.dtsi based) all use sgmii or 2500base-x. The
RGMII boards have no serdes PHY. So "harmless for existing users" holds
for in-tree users, and this only affects DTs the binding allows but that
aren't in the tree.
Should the call be guarded the same way as in ethqos_mac_finish_serdes()
(SGMII, 1000BASEX and 2500BASEX only)? Another option would be to
install serdes_powerup only for SerDes phy-modes in qcom_ethqos_probe(),
or to restrict the binding.
> +
> ret = phy_power_on(ethqos->serdes_phy);
> if (ret)
> - phy_exit(ethqos->serdes_phy);
> + goto err_out;
>
> + return 0;
> +
> +err_out:
> + phy_exit(ethqos->serdes_phy);
> return ret;
> }
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260923-qcom-sa8255p-emac-v15-0-e82f33720737%40oss.qualcomm.com
next prev parent reply other threads:[~2026-09-27 16:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 15:14 [PATCH net-next v15 0/9] net: stmmac: qcom-ethqos: add support for SCMI power domains Bartosz Golaszewski
2026-09-23 15:14 ` [PATCH net-next v15 1/9] net: phy: aquantia: fix system interface type not updated in forced mode Bartosz Golaszewski
2026-09-23 15:14 ` [PATCH net-next v15 2/9] dt-bindings: phy: document the serdes PHY on sa8255p Bartosz Golaszewski
2026-09-27 16:29 ` netdev-bot+sashiko
2026-09-23 15:14 ` [PATCH net-next v15 3/9] phy: qcom: add the SGMII SerDes PHY driver for SCMI systems Bartosz Golaszewski
2026-09-27 16:29 ` netdev-bot+sashiko
2026-09-23 15:14 ` [PATCH net-next v15 4/9] dt-bindings: net: qcom: document the ethqos device for SCMI-based systems Bartosz Golaszewski
2026-09-27 16:29 ` netdev-bot+sashiko
2026-09-23 15:14 ` [PATCH net-next v15 5/9] net: stmmac: qcom-ethqos: set serdes mode before powerup Bartosz Golaszewski
2026-09-27 16:29 ` netdev-bot+sashiko [this message]
2026-09-23 15:14 ` [PATCH net-next v15 6/9] net: stmmac: qcom-ethqos: update phy_mode to the resolved interface in mac_finish() Bartosz Golaszewski
2026-09-27 16:29 ` netdev-bot+sashiko
2026-09-23 15:14 ` [PATCH net-next v15 7/9] net: stmmac: qcom-ethqos: reuse the address of ethqos_emac_driver_data Bartosz Golaszewski
2026-09-23 15:14 ` [PATCH net-next v15 8/9] net: stmmac: qcom-ethqos: factor out linux-level setup into a separate function Bartosz Golaszewski
2026-09-27 16:29 ` netdev-bot+sashiko
2026-09-23 15:14 ` [PATCH net-next v15 9/9] net: stmmac: qcom-ethqos: add support for sa8255p Bartosz Golaszewski
2026-09-27 16:29 ` netdev-bot+sashiko
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=179052655254.2160803.14087106323968541578@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=alexandre.torgue@foss.st.com \
--cc=andersson@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=bartosz.golaszewski@linaro.org \
--cc=bartosz.golaszewski@oss.qualcomm.com \
--cc=brgl@kernel.org \
--cc=christophe.roullier@foss.st.com \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=dfustini@tenstorrent.com \
--cc=edumazet@google.com \
--cc=festevam@gmail.com \
--cc=geert+renesas@glider.be \
--cc=imx@lists.linux.dev \
--cc=jan.petrous@oss.nxp.com \
--cc=jbrunet@baylibre.com \
--cc=jernej.skrabec@gmail.com \
--cc=khilman@baylibre.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux-sunxi@lists.linux.dev \
--cc=magnus.damm@gmail.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=mohd.anwar@oss.qualcomm.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=peppe.cavallaro@st.com \
--cc=radu@rendec.net \
--cc=robh@kernel.org \
--cc=romain.gantois@bootlin.com \
--cc=s32@nxp.com \
--cc=shawnguo@kernel.org \
--cc=sophgo@lists.linux.dev \
--cc=vkoul@kernel.org \
--cc=wens@kernel.org \
/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®