From: sashiko-bot@kernel.org
To: "Bartosz Golaszewski" <bartosz.golaszewski@oss.qualcomm.com>
Cc: linux-sunxi@lists.linux.dev, imx@lists.linux.dev,
neil.armstrong@linaro.org, linux-amlogic@lists.infradead.org,
robh@kernel.org, wsa+renesas@sang-engineering.com,
devicetree@vger.kernel.org, Frank.Li@kernel.org,
conor+dt@kernel.org
Subject: Re: [PATCH net-next v12 4/7] net: stmmac: qcom-ethqos: set serdes mode before powerup
Date: Tue, 07 Jul 2026 14:11:38 +0000 [thread overview]
Message-ID: <20260707141138.D76F61F00A3E@smtp.kernel.org> (raw)
In-Reply-To: <20260706-qcom-sa8255p-emac-v12-4-e3ab1ecf2901@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Calling phy_set_mode_ext() with statically cached ethqos->phy_mode ignores dynamic phylink interface changes, leading to incorrect PHY performance state.
--
commit 1aa35b54e2c1e3097800bf61ac8665f69589631f
Author: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
net: stmmac: qcom-ethqos: set serdes mode before powerup
Call phy_set_mode_ext() before phy_power_on() in
qcom_ethqos_serdes_powerup(). This is done ahead of 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
> --- 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);
[Severity: High]
Does this ignore dynamic phylink interface changes by always using the
statically cached ethqos->phy_mode?
At probe, ethqos->phy_mode is statically assigned from the device tree.
On interface up, stmmac_open() calls qcom_ethqos_serdes_powerup(), which
calls phy_set_mode_ext() and then phy_power_on().
Later, when phylink resolves the link and dynamically switches the interface,
it calls ethqos_mac_finish_serdes() which calls phy_set_mode_ext() with the
new dynamically negotiated interface mode. However, because the PHY is already
powered on, the SCMI PHY driver caches the new performance state but never
applies it to the hardware.
If the user subsequently toggles the interface (ip link set eth0 down/up),
qcom_ethqos_serdes_powerup() is called again. Will this pass the stale, static
ethqos->phy_mode instead of the current phylink mode, thereby reverting the PHY
to the wrong configuration and applying the wrong performance state?
> + if (ret)
> + goto err_out;
> +
> 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://sashiko.dev/#/patchset/20260706-qcom-sa8255p-emac-v12-0-e3ab1ecf2901@oss.qualcomm.com?part=4
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
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 [this message]
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=20260707141138.D76F61F00A3E@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