From: sashiko-bot@kernel.org
To: "Mohd Ayaan Anwar" <mohd.anwar@oss.qualcomm.com>
Cc: linux-phy@lists.infradead.org, neil.armstrong@linaro.org,
devicetree@vger.kernel.org, olteanv@gmail.com, vkoul@kernel.org,
robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 3/3] phy: qcom: sgmii-eth: add Nord USXGMII support
Date: Wed, 23 Sep 2026 00:12:25 +0000 [thread overview]
Message-ID: <20260923001226.3412A1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260923-nord_ethernet_serdes-v1-3-f8ac1c487882@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] phy: qcom: sgmii: incorrect hardware offsets written on mode change
--
commit eb8579d974b41d6c98fd95052875c10ccf3e31fa
Author: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
phy: qcom: sgmii-eth: add Nord USXGMII support
Nord uses a QMP v7 SerDes block which is an updated version of the
SGMII SerDes PHY IP. The driver currently handles SGMII and 2500BASE-X
configurations only. This patch adds support for configuring the SerDes
to operate at 10.3125 Gbaud, enabling USXGMII and 10GBASE-R PHY modes
for the Nord compatible.
> diff --git a/drivers/phy/qualcomm/phy-qcom-sgmii-eth.c b/drivers/phy/qualcomm/phy-qcom-sgmii-eth.c
> index 029dafacee785..3c68bfe0ea443 100644
> --- a/drivers/phy/qualcomm/phy-qcom-sgmii-eth.c
> +++ b/drivers/phy/qualcomm/phy-qcom-sgmii-eth.c
[ ... ]
> @@ -275,16 +419,19 @@ static int qcom_dwmac_sgmii_phy_calibrate(struct phy *phy)
> case PHY_INTERFACE_MODE_1000BASEX:
> /* 1.25Gbps mode */
> qcom_dwmac_sgmii_phy_init_1g(data->regmap);
> - break;
> + return qcom_dwmac_sgmii_phy_poll_sgmii_ready(dev, data->regmap);
> case PHY_INTERFACE_MODE_2500BASEX:
> /* 3.125Gbps mode */
> qcom_dwmac_sgmii_phy_init_2p5g(data->regmap);
> - break;
> + return qcom_dwmac_sgmii_phy_poll_sgmii_ready(dev, data->regmap);
> + case PHY_INTERFACE_MODE_USXGMII:
> + case PHY_INTERFACE_MODE_10GBASER:
> + /* 10.3125Gbps mode */
> + qcom_dwmac_sgmii_phy_init_10g(data->regmap);
> + return qcom_dwmac_sgmii_phy_poll_usxgmii_ready(dev, data->regmap);
[Severity: High]
Does this logic incorrectly route SGMII and 2500BASE-X requests directly to
V5 hardware initialization sequences, regardless of whether the underlying
hardware is V5 or V7?
If a MAC driver using phylink dynamically falls back to SGMII, 1000BASE-X, or
2500BASE-X on the Nord (v7) platform during link state changes (e.g., when
plugging in a different SFP module), it appears this will write completely
wrong offsets to the PHY SerDes block.
Similarly, if phylink falls back to USXGMII or 10GBASE-R on the sa8775p (v5)
platform, won't it run the V7 initialization sequence instead?
Writing incorrect register offsets into the hardware IP can lead to
unpredictable behavior or system crashes.
> default:
> return -EINVAL;
> }
> -
> - return qcom_dwmac_sgmii_phy_poll_sgmii_ready(dev, data->regmap);
> }
[ ... ]
> @@ -340,7 +487,9 @@ static int qcom_dwmac_sgmii_phy_validate(struct phy *phy, enum phy_mode mode,
>
> if (submode == PHY_INTERFACE_MODE_SGMII ||
> submode == PHY_INTERFACE_MODE_1000BASEX ||
> - submode == PHY_INTERFACE_MODE_2500BASEX)
> + submode == PHY_INTERFACE_MODE_2500BASEX ||
> + submode == PHY_INTERFACE_MODE_USXGMII ||
> + submode == PHY_INTERFACE_MODE_10GBASER)
> return 0;
[Severity: High]
Does this validation incorrectly advertise that all PHY interface modes
are supported by all hardware instances?
By returning 0 for all these modes, this allows phylink to believe the platform
supports them unconditionally.
This is what permits consumers to switch into incompatible modes during
standard PHY mode negotiation, ultimately triggering the incorrect hardware IP
initialization sequences in qcom_dwmac_sgmii_phy_calibrate() mentioned above.
>
> return -EINVAL;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260923-nord_ethernet_serdes-v1-0-f8ac1c487882@oss.qualcomm.com?part=3
next prev parent reply other threads:[~2026-09-23 0:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 0:04 [PATCH 0/3] phy: qcom: sgmii-eth: add Nord USXGMII support Mohd Ayaan Anwar
2026-09-23 0:04 ` [PATCH 1/3] dt-bindings: phy: qcom,sa8775p-dwmac-sgmii-phy: add Nord compatible Mohd Ayaan Anwar
2026-09-25 13:35 ` Lorenzo Bianconi
2026-09-25 13:59 ` Bartosz Golaszewski
2026-09-28 10:16 ` Krzysztof Kozlowski
2026-09-28 10:26 ` Krzysztof Kozlowski
2026-09-28 10:56 ` Mohd Ayaan Anwar
2026-09-28 11:02 ` Krzysztof Kozlowski
2026-09-23 0:04 ` [PATCH 2/3] phy: qcom: sgmii-eth: prepare for additional PHY modes Mohd Ayaan Anwar
2026-09-25 13:49 ` Lorenzo Bianconi
2026-09-23 0:04 ` [PATCH 3/3] phy: qcom: sgmii-eth: add Nord USXGMII support Mohd Ayaan Anwar
2026-09-23 0:12 ` sashiko-bot [this message]
2026-09-25 13:59 ` Lorenzo Bianconi
2026-09-23 8:58 ` [PATCH 0/3] " Zhangfei Gao
2026-09-28 10:19 ` Krzysztof Kozlowski
2026-09-29 10:49 ` Zhangfei Gao
2026-09-30 5:16 ` Krzysztof Kozlowski
2026-10-08 4:13 ` Zhangfei Gao
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=20260923001226.3412A1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=mohd.anwar@oss.qualcomm.com \
--cc=neil.armstrong@linaro.org \
--cc=olteanv@gmail.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vkoul@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