From: Jakub Kicinski <kuba@kernel.org>
To: bartosz.golaszewski@oss.qualcomm.com
Cc: Jakub Kicinski <kuba@kernel.org>,
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, 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 v14 01/10] net: phy: aquantia: fix system interface type not updated in forced mode
Date: Mon, 14 Sep 2026 16:14:47 -0700 [thread overview]
Message-ID: <20260914231447.702704-1-kuba@kernel.org> (raw)
In-Reply-To: <20260908-qcom-sa8255p-emac-v14-1-ec212b747a7d@oss.qualcomm.com>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
---
net: phy: aquantia: fix system interface type not updated in forced mode
This drops the phydev->autoneg == AUTONEG_DISABLE test from the early
return in aqr_gen1_read_status(), so that MDIO_PHYXS_VEND_IF_STATUS is
decoded into phydev->interface whenever the link is up. The commit is
marked for stable and carries Fixes: 110a2432c520 ("net: phy: aquantia:
add downshift support").
> diff --git a/drivers/net/phy/aquantia/aquantia_main.c b/drivers/net/phy/aquantia/aquantia_main.c
> index e95d391a6dc23..b720e4e9028cc 100644
> --- a/drivers/net/phy/aquantia/aquantia_main.c
> +++ b/drivers/net/phy/aquantia/aquantia_main.c
> @@ -544,7 +544,7 @@ static int aqr_gen1_read_status(struct phy_device *phydev)
> if (ret)
> return ret;
>
> - if (!phydev->link || phydev->autoneg == AUTONEG_DISABLE)
> + if (!phydev->link)
> return 0;
>
> /* The status register is not immediately correct on line side link up.
[Severity: Medium]
This early return was also gating the rest of aqr_gen1_read_status(), not
just the MDIO_PHYXS_VEND_IF_STATUS decode. With the autoneg test gone, the
tail of the function now runs in forced mode too:
drivers/net/phy/aquantia/aquantia_main.c:aqr_gen1_read_status() {
...
phydev->interface = aqr_translate_interface(phydev, interface);
/* Read rate from vendor register */
return aqr_gen1_read_rate(phydev);
}
aqr_gen1_read_rate() overwrites both speed and duplex unconditionally from
the autoneg MMD vendor register:
drivers/net/phy/aquantia/aquantia_main.c:aqr_gen1_read_rate() {
val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_STATUS1);
if (val < 0)
return val;
if (val & MDIO_AN_TX_VEND_STATUS1_FULL_DUPLEX)
phydev->duplex = DUPLEX_FULL;
else
phydev->duplex = DUPLEX_HALF;
switch (FIELD_GET(MDIO_AN_TX_VEND_STATUS1_RATE_MASK, val)) {
case MDIO_AN_TX_VEND_STATUS1_10BASET:
phydev->speed = SPEED_10;
...
default:
phydev->speed = SPEED_UNKNOWN;
}
}
In forced mode the speed and duplex were just established from the PMA by
aqr_read_status() -> genphy_c45_read_status() -> genphy_c45_read_pma(),
which reads the PMA MDIO_CTRL1 speed select and sets DUPLEX_FULL. Is
MDIO_AN_TX_VEND_STATUS1 still maintained by the firmware after
genphy_c45_an_disable_aneg() (called from genphy_c45_pma_setup_forced()
and aqr105_setup_forced())?
If it is not, a zeroed or stale rate field decodes as SPEED_10 with
DUPLEX_HALF, and an unrecognised code as SPEED_UNKNOWN, so a forced
1000BASE-T full duplex link would be reported to phylink at the wrong
rate and duplex. There is no validity qualifier and no "leave unchanged"
path in aqr_gen1_read_rate().
On gen2 parts a wrong or unknown speed also feeds the rate matching
lookup, which silently keeps the previous value when nothing matches:
drivers/net/phy/aquantia/aquantia_main.c:aqr_gen2_read_status() {
for (i = 0; i < AQR_NUM_GLOBAL_CFG; i++) {
struct aqr_global_syscfg *syscfg = &priv->global_cfg[i];
if (syscfg->speed != phydev->speed)
continue;
...
phydev->rate_matching = RATE_MATCH_PAUSE;
...
}
The guard being removed came from the Fixes: commit 110a2432c520, where it
was added to keep the autoneg vendor rate handling out of the forced path.
Would it work to move the AUTONEG_DISABLE check onto the
aqr_gen1_read_rate() call instead of deleting it, so the interface decode
is always done but speed and duplex keep coming from the PMA in forced
mode? Alternatively, could the commit message state that
MDIO_AN_TX_VEND_STATUS1 is valid with autoneg disabled, since the message
currently only argues this for MDIO_PHYXS_VEND_IF_STATUS:
MDIO_PHYXS_VEND_IF_STATUS is set by the PHY firmware based on the
negotiated link speed, not based on whether autoneg was used to reach
it.
This matters for the stable backport since the change is larger than the
one described.
_______________________________________________
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-14 23:16 UTC|newest]
Thread overview: 17+ 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-14 23:14 ` Jakub Kicinski [this message]
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
2026-09-14 23:16 ` Jakub Kicinski
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-14 23:16 ` Jakub Kicinski
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-14 23:16 ` Jakub Kicinski
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
2026-09-14 23:15 ` [PATCH net-next v14 00/10] net: stmmac: qcom-ethqos: add support for SCMI power domains Jakub Kicinski
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=20260914231447.702704-1-kuba@kernel.org \
--to=kuba@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=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®