From: netdev-bot+sashiko@kernel.org
To: cristian.ciocaltea@collabora.com
Cc: ansuelsmth@gmail.com, andrew@lunn.ch, hkallweit1@gmail.com,
linux@armlinux.org.uk, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, kernel@collabora.com,
netdev@vger.kernel.org
Subject: Re: [PATCH net 05/14] net: phy: as21xxx: Correct the 10M speed status value
Date: Tue, 01 Dec 2026 01:50:51 +0000 [thread overview]
Message-ID: <179608985188.3146.1203400149585184164@kernel.org> (raw)
In-Reply-To: <20261130-as21xxx-fixes-v1-5-1bd2eae6ccbc@collabora.com>
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 2 · Low: 1
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] This patch only works together with the commit before it,
"net: phy: as21xxx: Use the correct mask for the speed status".
- [Medium] (Baseline decision: discard, because it is resolved later in
the series; kept here only because requires_validation=true.) The…
- [Low] The commit message says the failing switch is in
`aeon_read_status()`.
--
net: phy: as21xxx: Correct the 10M speed status value
This commit changes VEND1_SPEED_10 from 0x0 to 0x40, the value the PHY
reports for a 10M link. The commit message says the wrong value was
hidden because the speed status was masked with VEND1_SPEED_STATUS
instead of VEND1_SPEED_MASK.
> Attempting to force a 10M link would therefore match no case of the
> switch in aeon_read_status() and make it fail with -EINVAL, generating
> the following splat:
[Severity: Low]
This isn't a bug, but there is no aeon_read_status() in drivers/net/phy/.
Should this say as21xxx_read_status()? That is the name the companion
patch "net: phy: as21xxx: Use the correct mask for the speed status"
uses.
> diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
> index ff6c2005c442a..8d46fdfc279a7 100644
> --- a/drivers/net/phy/as21xxx.c
> +++ b/drivers/net/phy/as21xxx.c
> @@ -47,7 +47,7 @@
> #define VEND1_SPEED_2500 FIELD_PREP_CONST(VEND1_SPEED_MASK, 0x9)
> #define VEND1_SPEED_1000 FIELD_PREP_CONST(VEND1_SPEED_MASK, 0x10)
> #define VEND1_SPEED_100 FIELD_PREP_CONST(VEND1_SPEED_MASK, 0x20)
> -#define VEND1_SPEED_10 FIELD_PREP_CONST(VEND1_SPEED_MASK, 0x0)
> +#define VEND1_SPEED_10 FIELD_PREP_CONST(VEND1_SPEED_MASK, 0x40)
[Severity: Medium]
Does this patch only work when the previous one, "net: phy: as21xxx: Use
the correct mask for the speed status", is also applied?
Both patches carry only:
Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
At 830877d89edc, as21xxx_read_status() does:
switch (speed & VEND1_SPEED_STATUS) {
VEND1_SPEED_STATUS is 0x4002, so 0x40 & 0x4002 is 0x0, which matched the
old VEND1_SPEED_10. The commit message says forced 10M was reported
correctly there. If so, the splat quoted above can't happen at
830877d89edc.
The splat seems to come from the mask patch instead. Once the switch uses
VEND1_SPEED_MASK, 0x40 no longer matches VEND1_SPEED_10 (still 0x0), and
as21xxx_read_status() falls into:
default:
return -EINVAL;
That leaves a bisect hole for forced 10M between the two patches, for
example with "ethtool -s <if> speed 10 duplex full autoneg off".
The opposite case looks worse. Stable could pick up only this patch on
top of 830877d89edc based on the Fixes: tag. The switch would then still
mask with 0x4002, so the masked value could only be 0x0, 0x2, 0x4000 or
0x4002. None of these match 0x3, 0x5, 0x9, 0x10, 0x20 or 0x40.
Wouldn't every forced speed then hit the default case, return -EINVAL and
put the PHY into PHY_ERROR?
The mask and the 10M value were both wrong in 830877d89edc, and the fix
only works when both change. Could the two patches be squashed, or could
the dependency at least be stated explicitly?
[Severity: Medium]
Can an all-zero speed field now make as21xxx_read_status() fail while a
forced-mode link is down?
At this commit, the forced branch decodes the speed status without
checking phydev->link:
} else {
...
speed = phy_read_mmd(phydev, MDIO_MMD_VEND1,
VEND1_SPEED_STATUS);
...
switch (speed & VEND1_SPEED_MASK) {
...
default:
return -EINVAL;
}
That includes an unplugged cable, and the case where as21xxx_read_link()
returns early on BMCR_ANRESTART:
if (*bmcr & BMCR_ANRESTART) {
phydev->link = 0;
return 0;
}
Before this patch, VEND1_SPEED_10 was the only case that matched 0x0. The
firmware might report 0x0, or another unlisted value, while the link is
down or the speed is not yet resolved. Every poll would then return
-EINVAL, and phylib would move the PHY to PHY_ERROR. Without a datasheet,
it isn't clear what the firmware reports in that state.
A later patch in the series, "net: phy: as21xxx: Fix speed and duplex
reporting", appears to fix this. There, the forced branch only calls
as21xxx_read_speed() when phydev->link is set. Its default case sets
SPEED_UNKNOWN with dev_warn_once() instead of returning -EINVAL.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc%40collabora.com
next prev parent reply other threads:[~2026-12-01 1:50 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 0:55 [PATCH net 00/14] net: phy: as21xxx: Fix a batch of driver issues Cristian Ciocaltea
2026-11-30 0:55 ` [PATCH net 01/14] net: phy: as21xxx: handle stale link status during autoneg Cristian Ciocaltea
2026-11-30 0:55 ` [PATCH net 02/14] net: phy: as21xxx: handle odd firmware on loading Cristian Ciocaltea
2026-11-30 0:55 ` [PATCH net 03/14] net: phy: as21xxx: Fix LED index bounds check Cristian Ciocaltea
2026-11-30 2:37 ` Andrew Lunn
2026-11-30 10:35 ` Cristian Ciocaltea
2026-11-30 0:55 ` [PATCH net 04/14] net: phy: as21xxx: Use the correct mask for the speed status Cristian Ciocaltea
2026-11-30 2:39 ` Andrew Lunn
2026-11-30 0:55 ` [PATCH net 05/14] net: phy: as21xxx: Correct the 10M speed status value Cristian Ciocaltea
2026-11-30 2:40 ` Andrew Lunn
2026-12-01 1:50 ` netdev-bot+sashiko [this message]
2026-11-30 0:55 ` [PATCH net 06/14] net: phy: as21xxx: Do not write the IPC reply to a NULL buffer Cristian Ciocaltea
2026-11-30 2:49 ` Andrew Lunn
2026-11-30 10:53 ` Cristian Ciocaltea
2026-12-01 1:50 ` netdev-bot+sashiko
2026-11-30 0:55 ` [PATCH net 07/14] net: phy: as21xxx: Write IPC payload under ipc_lock Cristian Ciocaltea
2026-11-30 2:53 ` Andrew Lunn
2026-11-30 11:09 ` Cristian Ciocaltea
2026-12-01 1:50 ` netdev-bot+sashiko
2026-11-30 0:55 ` [PATCH net 08/14] net: phy: as21xxx: Handle IPC payload write errors Cristian Ciocaltea
2026-11-30 2:54 ` Andrew Lunn
2026-11-30 0:55 ` [PATCH net 09/14] net: phy: as21xxx: Reject odd IPC payload lengths Cristian Ciocaltea
2026-11-30 2:55 ` Andrew Lunn
2026-12-01 1:50 ` netdev-bot+sashiko
2026-11-30 0:55 ` [PATCH net 10/14] net: phy: as21xxx: Fix LED hw control set for unsupported rules Cristian Ciocaltea
2026-11-30 3:01 ` Andrew Lunn
2026-11-30 11:29 ` Cristian Ciocaltea
2026-11-30 13:37 ` Andrew Lunn
2026-12-01 1:50 ` netdev-bot+sashiko
2026-11-30 0:55 ` [PATCH net 11/14] net: phy: as21xxx: Read 10/100/1000 link modes from C22 advertisement Cristian Ciocaltea
2026-11-30 3:34 ` Andrew Lunn
2026-11-30 11:53 ` Cristian Ciocaltea
2026-11-30 13:39 ` Andrew Lunn
2026-12-01 1:50 ` netdev-bot+sashiko
2026-11-30 0:55 ` [PATCH net 12/14] net: phy: as21xxx: Configure autoneg advertisement via IPC Cristian Ciocaltea
2026-11-30 3:43 ` Andrew Lunn
2026-11-30 12:05 ` Cristian Ciocaltea
2026-12-01 1:50 ` netdev-bot+sashiko
2026-11-30 0:55 ` [PATCH net 13/14] net: phy: as21xxx: Fix speed and duplex reporting Cristian Ciocaltea
2026-11-30 3:50 ` Andrew Lunn
2026-11-30 12:21 ` Cristian Ciocaltea
2026-11-30 14:01 ` Andrew Lunn
2026-12-01 1:51 ` netdev-bot+sashiko
2026-11-30 0:55 ` [PATCH net 14/14] net: phy: as21xxx: Release reset before reading ID in match Cristian Ciocaltea
2026-11-30 3:53 ` Andrew Lunn
2026-11-30 12:22 ` Cristian Ciocaltea
2026-12-01 1:51 ` 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=179608985188.3146.1203400149585184164@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew@lunn.ch \
--cc=ansuelsmth@gmail.com \
--cc=cristian.ciocaltea@collabora.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=hkallweit1@gmail.com \
--cc=kernel@collabora.com \
--cc=kuba@kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.