* [PATCH net 00/14] net: phy: as21xxx: Fix a batch of driver issues
@ 2026-11-30 0:55 Cristian Ciocaltea
2026-11-30 0:55 ` [PATCH net 01/14] net: phy: as21xxx: handle stale link status during autoneg Cristian Ciocaltea
` (13 more replies)
0 siblings, 14 replies; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 0:55 UTC (permalink / raw)
To: Christian Marangi, Andrew Lunn, Heiner Kallweit, Russell King,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: kernel, netdev, Maxime Chevallier
While refactoring the Aeonsemi AS21xxx driver to prepare support for the
2nd PHY generation, a number of bugs were found in the existing code,
all dating back to its initial support commit.
Fix them in this series, which was developed and tested on Gen2
hardware, and additionally verified on an Airoha AN7583 evaluation board
with a Gen1 (AS21010JB1) PHY, running a 6.12.94 OpenWrt based kernel.
Note the first two patches were cherry-picked from [1] to avoid bringing
in a partial dependency, since the remaining patches in that series had
to be replaced in order to address all the corner cases.
In more detail, the series covers:
- Link status, speed and duplex reporting: avoid reporting link up with
a stale speed while autoneg is restarting; fix the speed status mask
and the 10M status value (the mask bug had been hiding the latter);
read speed from VEND1_SPEED_STATUS on the autoneg path too and derive
duplex from the link partner abilities; read 10/100/1000 link modes
from the Clause 22 advertisement.
- Autoneg advertisement: the PHY doesn't fully support the C45 AN
registers written by phylib, which can break the link when restricting
the advertisement. Implement .config_aneg via the firmware IPC
command, which takes only a top speed, and reflect the result in
phydev->advertising.
- IPC mailbox robustness: don't write the reply to a NULL buffer, take
ipc_lock before writing the payload, check payload write errors, and
reject odd payload lengths.
- Bounds and validation: handle odd-length firmware without reading out
of bounds, fix the off-by-one LED index check, and return -EOPNOTSUPP
for unsupported LED hw control rules instead of overwriting the LED
configuration.
- Reset handling: release the PHY reset before reading the ID in
.match_phy_device(), so rebinding the driver no longer leaves the PHY
stuck in reset.
[1] https://lore.kernel.org/all/20261028073024.25175-1-ansuelsmth@gmail.com/
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
Christian Marangi (2):
net: phy: as21xxx: handle stale link status during autoneg
net: phy: as21xxx: handle odd firmware on loading
Cristian Ciocaltea (12):
net: phy: as21xxx: Fix LED index bounds check
net: phy: as21xxx: Use the correct mask for the speed status
net: phy: as21xxx: Correct the 10M speed status value
net: phy: as21xxx: Do not write the IPC reply to a NULL buffer
net: phy: as21xxx: Write IPC payload under ipc_lock
net: phy: as21xxx: Handle IPC payload write errors
net: phy: as21xxx: Reject odd IPC payload lengths
net: phy: as21xxx: Fix LED hw control set for unsupported rules
net: phy: as21xxx: Read 10/100/1000 link modes from C22 advertisement
net: phy: as21xxx: Configure autoneg advertisement via IPC
net: phy: as21xxx: Fix speed and duplex reporting
net: phy: as21xxx: Release reset before reading ID in match
drivers/net/phy/as21xxx.c | 496 +++++++++++++++++++++++++++++++++++++++-------
1 file changed, 420 insertions(+), 76 deletions(-)
---
base-commit: fad0d57b12f6979bc0127f0a4f704c6d7177ca78
change-id: 20261129-as21xxx-fixes-e934adae8841
^ permalink raw reply [flat|nested] 47+ messages in thread
* [PATCH net 01/14] net: phy: as21xxx: handle stale link status during autoneg
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 ` Cristian Ciocaltea
2026-11-30 0:55 ` [PATCH net 02/14] net: phy: as21xxx: handle odd firmware on loading Cristian Ciocaltea
` (12 subsequent siblings)
13 siblings, 0 replies; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 0:55 UTC (permalink / raw)
To: Christian Marangi, Andrew Lunn, Heiner Kallweit, Russell King,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: kernel, netdev, Maxime Chevallier
From: Christian Marangi <ansuelsmth@gmail.com>
When autonegotiation is restarted, MDIO_STAT1_ANEGCOMPLETE may be
cleared before MDIO_STAT1_LSTATUS. In this case, the link status bit
may still indicate link up even though autonegotiation has not
completed.
Force the link down when autonegotiation is enabled but has not
completed, preventing as21xxx_read_status() from reporting a link up
with an unknown or stale speed.
Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/net/phy/as21xxx.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
index dbe6be963389..3db455314b67 100644
--- a/drivers/net/phy/as21xxx.c
+++ b/drivers/net/phy/as21xxx.c
@@ -657,6 +657,13 @@ static int as21xxx_read_link(struct phy_device *phydev, int *bmcr)
return status;
phydev->link = !!(status & MDIO_STAT1_LSTATUS);
+ phydev->autoneg_complete = !!(status & MDIO_AN_STAT1_COMPLETE);
+
+ /* Consider the case that autoneg was started and "aneg complete"
+ * bit has been reset, but "link up" bit not yet.
+ */
+ if (phydev->autoneg == AUTONEG_ENABLE && !phydev->autoneg_complete)
+ phydev->link = 0;
return 0;
}
--
2.56.0
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [PATCH net 02/14] net: phy: as21xxx: handle odd firmware on loading
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 ` Cristian Ciocaltea
2026-11-30 0:55 ` [PATCH net 03/14] net: phy: as21xxx: Fix LED index bounds check Cristian Ciocaltea
` (11 subsequent siblings)
13 siblings, 0 replies; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 0:55 UTC (permalink / raw)
To: Christian Marangi, Andrew Lunn, Heiner Kallweit, Russell King,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: kernel, netdev
From: Christian Marangi <ansuelsmth@gmail.com>
Even if firmware for AS21xxx should be always u16 aligned, we can't assume
this will be the same forever. Better address this by simply validate the
index before reading out of bound from the data buffer.
A zero padded buffer will be passed to the AS21xxx mailbox in such case.
Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/net/phy/as21xxx.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
index 3db455314b67..5fb06cd765cf 100644
--- a/drivers/net/phy/as21xxx.c
+++ b/drivers/net/phy/as21xxx.c
@@ -323,9 +323,11 @@ static int aeon_firmware_boot(struct phy_device *phydev, const u8 *data,
return -EINVAL;
}
- /* Firmware is always aligned to u16 */
+ /* Firmware should be u16 aligned, zero-pad a trailing odd byte */
for (i = 0; i < size; i += 2) {
- val = data[i + 1] << 8 | data[i];
+ val = data[i];
+ if (i + 1 < size)
+ val |= data[i + 1] << 8;
ret = phy_write_mmd(phydev, MDIO_MMD_VEND1,
VEND1_GLB_REG_MDIO_INDIRECT_LOAD, val);
--
2.56.0
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [PATCH net 03/14] net: phy: as21xxx: Fix LED index bounds check
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 ` Cristian Ciocaltea
2026-11-30 2:37 ` Andrew Lunn
2026-11-30 0:55 ` [PATCH net 04/14] net: phy: as21xxx: Use the correct mask for the speed status Cristian Ciocaltea
` (10 subsequent siblings)
13 siblings, 1 reply; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 0:55 UTC (permalink / raw)
To: Christian Marangi, Andrew Lunn, Heiner Kallweit, Russell King,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: kernel, netdev
The LED indexes are zero-based, so valid indexes are strictly less than
the number of LEDs, AEON_MAX_LEDS. However, the LED ops only reject
indexes greater than AEON_MAX_LEDS, which wrongly accepts an index equal
to AEON_MAX_LEDS, one past the last valid LED.
Such an index makes VEND1_LED_REG() compute an address outside the LED
register block. A bogus LED node in the device tree can then cause
reads and writes of an unrelated vendor register.
Reject indexes greater than or equal to AEON_MAX_LEDS so that only valid
LED indexes are accepted.
Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/net/phy/as21xxx.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
index 5fb06cd765cf..5b38c641329a 100644
--- a/drivers/net/phy/as21xxx.c
+++ b/drivers/net/phy/as21xxx.c
@@ -781,7 +781,7 @@ static int as21xxx_led_brightness_set(struct phy_device *phydev,
{
u16 val = VEND1_LED_REG_A_EVENT_OFF;
- if (index > AEON_MAX_LEDS)
+ if (index >= AEON_MAX_LEDS)
return -EINVAL;
if (value)
@@ -798,7 +798,7 @@ static int as21xxx_led_hw_is_supported(struct phy_device *phydev, u8 index,
{
int i;
- if (index > AEON_MAX_LEDS)
+ if (index >= AEON_MAX_LEDS)
return -EINVAL;
for (i = 0; i < ARRAY_SIZE(as21xxx_led_supported_pattern); i++)
@@ -813,7 +813,7 @@ static int as21xxx_led_hw_control_get(struct phy_device *phydev, u8 index,
{
int i, val;
- if (index > AEON_MAX_LEDS)
+ if (index >= AEON_MAX_LEDS)
return -EINVAL;
val = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_LED_REG(index));
@@ -837,7 +837,7 @@ static int as21xxx_led_hw_control_set(struct phy_device *phydev, u8 index,
u16 val = 0;
int i;
- if (index > AEON_MAX_LEDS)
+ if (index >= AEON_MAX_LEDS)
return -EINVAL;
for (i = 0; i < ARRAY_SIZE(as21xxx_led_supported_pattern); i++)
@@ -859,7 +859,7 @@ static int as21xxx_led_polarity_set(struct phy_device *phydev, int index,
u16 mask, val = 0;
u32 mode;
- if (index > AEON_MAX_LEDS)
+ if (index >= AEON_MAX_LEDS)
return -EINVAL;
for_each_set_bit(mode, &modes, __PHY_LED_MODES_NUM) {
--
2.56.0
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [PATCH net 04/14] net: phy: as21xxx: Use the correct mask for the speed status
2026-11-30 0:55 [PATCH net 00/14] net: phy: as21xxx: Fix a batch of driver issues Cristian Ciocaltea
` (2 preceding siblings ...)
2026-11-30 0:55 ` [PATCH net 03/14] net: phy: as21xxx: Fix LED index bounds check Cristian Ciocaltea
@ 2026-11-30 0:55 ` 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
` (9 subsequent siblings)
13 siblings, 1 reply; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 0:55 UTC (permalink / raw)
To: Christian Marangi, Andrew Lunn, Heiner Kallweit, Russell King,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: kernel, netdev
as21xxx_read_status() masks the speed status with VEND1_SPEED_STATUS,
the address of the register it just read, instead of VEND1_SPEED_MASK,
which is the field mask the speed values are built with.
This affects the path taken when auto-negotiation is disabled. For
example, after setting "speed 100 duplex full autoneg off", ethtool
would incorrectly report "Speed: 10Mb/s" instead of "Speed: 100Mb/s".
Switch to the correct field mask so the speed is decoded properly.
Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/net/phy/as21xxx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
index 5b38c641329a..ff6c2005c442 100644
--- a/drivers/net/phy/as21xxx.c
+++ b/drivers/net/phy/as21xxx.c
@@ -740,7 +740,7 @@ static int as21xxx_read_status(struct phy_device *phydev)
if (speed < 0)
return speed;
- switch (speed & VEND1_SPEED_STATUS) {
+ switch (speed & VEND1_SPEED_MASK) {
case VEND1_SPEED_10000:
phydev->speed = SPEED_10000;
phydev->duplex = DUPLEX_FULL;
--
2.56.0
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [PATCH net 05/14] net: phy: as21xxx: Correct the 10M speed status value
2026-11-30 0:55 [PATCH net 00/14] net: phy: as21xxx: Fix a batch of driver issues Cristian Ciocaltea
` (3 preceding siblings ...)
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 0:55 ` Cristian Ciocaltea
2026-11-30 2:40 ` Andrew Lunn
2026-12-01 1:50 ` netdev-bot+sashiko
2026-11-30 0:55 ` [PATCH net 06/14] net: phy: as21xxx: Do not write the IPC reply to a NULL buffer Cristian Ciocaltea
` (8 subsequent siblings)
13 siblings, 2 replies; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 0:55 UTC (permalink / raw)
To: Christian Marangi, Andrew Lunn, Heiner Kallweit, Russell King,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: kernel, netdev
The speed status register reports 0x40 for a 10M link, not 0x0 as
VEND1_SPEED_10 describes.
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:
[ 740.903011] _phy_start_aneg+0x0/0x98: returned: -22
[ 740.907932] WARNING: CPU: 0 PID: 6774 at _phy_state_machine+0x60/0x2dc
[...]
[ 741.192990] Call trace:
[ 741.195429] _phy_state_machine+0x60/0x2dc
[ 741.199526] phy_state_machine+0x28/0x80
[ 741.203449] process_one_work+0x174/0x300
[...]
The bug was hidden because the status was masked with VEND1_SPEED_STATUS
(the register address) instead of VEND1_SPEED_MASK. 0x40 & 0x4002
evaluates to 0, which happened to match the wrong VEND1_SPEED_10 value,
so 10M links were still reported correctly. Fixing the mask exposes the
bad definition.
Describe the value the PHY actually reports.
Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/net/phy/as21xxx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
index ff6c2005c442..8d46fdfc279a 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)
#define VEND1_IPC_CMD 0x5801
#define AEON_IPC_CMD_PARITY BIT(15)
--
2.56.0
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [PATCH net 06/14] net: phy: as21xxx: Do not write the IPC reply to a NULL buffer
2026-11-30 0:55 [PATCH net 00/14] net: phy: as21xxx: Fix a batch of driver issues Cristian Ciocaltea
` (4 preceding siblings ...)
2026-11-30 0:55 ` [PATCH net 05/14] net: phy: as21xxx: Correct the 10M speed status value Cristian Ciocaltea
@ 2026-11-30 0:55 ` Cristian Ciocaltea
2026-11-30 2:49 ` Andrew Lunn
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
` (7 subsequent siblings)
13 siblings, 2 replies; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 0:55 UTC (permalink / raw)
To: Christian Marangi, Andrew Lunn, Heiner Kallweit, Russell King,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: kernel, netdev
aeon_ipc_send_msg() intends to skip reading the IPC reply when the
caller passes no buffer for it, but the check tests the input buffer
(data) rather than the output buffer (ret_data). A caller supplying
a payload but a NULL ret_data would have the reply written through a
NULL pointer.
Check ret_data before copying the reply. While at it, validate the
input buffer at function entry, rejecting a NULL data pointer with a
non-zero data_len.
Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/net/phy/as21xxx.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
index 8d46fdfc279a..592b4b7a7869 100644
--- a/drivers/net/phy/as21xxx.c
+++ b/drivers/net/phy/as21xxx.c
@@ -464,6 +464,9 @@ static int aeon_ipc_send_msg(struct phy_device *phydev,
int ret;
int i;
+ if (data_len && !data)
+ return -EINVAL;
+
/* IPC have a max of 8 register to transfer data,
* make sure we never exceed this.
*/
@@ -486,14 +489,14 @@ static int aeon_ipc_send_msg(struct phy_device *phydev,
goto out;
}
- if (!data)
- goto out;
-
if ((ret_sts & AEON_IPC_STS_STATUS) == AEON_IPC_STS_STATUS_ERROR) {
ret = -EINVAL;
goto out;
}
+ if (!ret_data)
+ goto out;
+
/* Prevent IPC from stack smashing the kernel.
* We can't trust IPC to return a good value and we always
* preallocate space for 16 Bytes.
--
2.56.0
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [PATCH net 07/14] net: phy: as21xxx: Write IPC payload under ipc_lock
2026-11-30 0:55 [PATCH net 00/14] net: phy: as21xxx: Fix a batch of driver issues Cristian Ciocaltea
` (5 preceding siblings ...)
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 0:55 ` Cristian Ciocaltea
2026-11-30 2:53 ` Andrew Lunn
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
` (6 subsequent siblings)
13 siblings, 2 replies; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 0:55 UTC (permalink / raw)
To: Christian Marangi, Andrew Lunn, Heiner Kallweit, Russell King,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: kernel, netdev
aeon_ipc_send_msg() writes the message payload to the shared
VEND1_IPC_DATA registers before taking ipc_lock. Two concurrent
senders may interleave, so that one overwrites the payload of the
other before the corresponding command is issued. The firmware would
then execute a command with the wrong arguments.
Take ipc_lock before writing the payload, so that filling the data
registers and issuing the command happen atomically with respect to
other IPC users. The argument checks remain outside the lock.
Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/net/phy/as21xxx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
index 592b4b7a7869..4e10b0920a3c 100644
--- a/drivers/net/phy/as21xxx.c
+++ b/drivers/net/phy/as21xxx.c
@@ -473,6 +473,8 @@ static int aeon_ipc_send_msg(struct phy_device *phydev,
if (data_len > AEON_IPC_DATA_MAX)
return -EINVAL;
+ mutex_lock(&priv->ipc_lock);
+
for (i = 0; i < data_len / sizeof(u16); i++)
phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_IPC_DATA(i),
data[i]);
@@ -480,8 +482,6 @@ static int aeon_ipc_send_msg(struct phy_device *phydev,
cmd = FIELD_PREP(AEON_IPC_CMD_SIZE, data_len) |
FIELD_PREP(AEON_IPC_CMD_OPCODE, opcode);
- mutex_lock(&priv->ipc_lock);
-
ret = aeon_ipc_send_cmd(phydev, priv, cmd, &ret_sts);
if (ret) {
phydev_err(phydev, "failed to send ipc msg for %x: %d\n",
--
2.56.0
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [PATCH net 08/14] net: phy: as21xxx: Handle IPC payload write errors
2026-11-30 0:55 [PATCH net 00/14] net: phy: as21xxx: Fix a batch of driver issues Cristian Ciocaltea
` (6 preceding siblings ...)
2026-11-30 0:55 ` [PATCH net 07/14] net: phy: as21xxx: Write IPC payload under ipc_lock Cristian Ciocaltea
@ 2026-11-30 0:55 ` 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
` (5 subsequent siblings)
13 siblings, 1 reply; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 0:55 UTC (permalink / raw)
To: Christian Marangi, Andrew Lunn, Heiner Kallweit, Russell King,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: kernel, netdev
aeon_ipc_send_msg() ignores the return value of phy_write_mmd() when
filling the IPC data registers. On an MDIO failure the command is still
issued, and the firmware acts on stale or partial data left in the
registers.
Check the result of each write and abort the transfer on error,
propagating the error code to the caller.
Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/net/phy/as21xxx.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
index 4e10b0920a3c..14c22cb80db7 100644
--- a/drivers/net/phy/as21xxx.c
+++ b/drivers/net/phy/as21xxx.c
@@ -475,9 +475,12 @@ static int aeon_ipc_send_msg(struct phy_device *phydev,
mutex_lock(&priv->ipc_lock);
- for (i = 0; i < data_len / sizeof(u16); i++)
- phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_IPC_DATA(i),
- data[i]);
+ for (i = 0; i < data_len / sizeof(u16); i++) {
+ ret = phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_IPC_DATA(i),
+ data[i]);
+ if (ret < 0)
+ goto out;
+ }
cmd = FIELD_PREP(AEON_IPC_CMD_SIZE, data_len) |
FIELD_PREP(AEON_IPC_CMD_OPCODE, opcode);
--
2.56.0
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [PATCH net 09/14] net: phy: as21xxx: Reject odd IPC payload lengths
2026-11-30 0:55 [PATCH net 00/14] net: phy: as21xxx: Fix a batch of driver issues Cristian Ciocaltea
` (7 preceding siblings ...)
2026-11-30 0:55 ` [PATCH net 08/14] net: phy: as21xxx: Handle IPC payload write errors Cristian Ciocaltea
@ 2026-11-30 0:55 ` 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
` (4 subsequent siblings)
13 siblings, 2 replies; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 0:55 UTC (permalink / raw)
To: Christian Marangi, Andrew Lunn, Heiner Kallweit, Russell King,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: kernel, netdev
The IPC payload is transferred through 16-bit data registers, but
aeon_ipc_send_msg() advertises data_len bytes to the firmware while
writing only data_len / 2 registers. For an odd length the last byte is
silently dropped, and the firmware reads whatever was left in the next
register.
Reject payload lengths that are not a multiple of the register width.
Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/net/phy/as21xxx.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
index 14c22cb80db7..90b6f528f76d 100644
--- a/drivers/net/phy/as21xxx.c
+++ b/drivers/net/phy/as21xxx.c
@@ -473,6 +473,10 @@ static int aeon_ipc_send_msg(struct phy_device *phydev,
if (data_len > AEON_IPC_DATA_MAX)
return -EINVAL;
+ /* Data is transferred in 16-bit words, so the length must be even. */
+ if (data_len % sizeof(u16))
+ return -EINVAL;
+
mutex_lock(&priv->ipc_lock);
for (i = 0; i < data_len / sizeof(u16); i++) {
--
2.56.0
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [PATCH net 10/14] net: phy: as21xxx: Fix LED hw control set for unsupported rules
2026-11-30 0:55 [PATCH net 00/14] net: phy: as21xxx: Fix a batch of driver issues Cristian Ciocaltea
` (8 preceding siblings ...)
2026-11-30 0:55 ` [PATCH net 09/14] net: phy: as21xxx: Reject odd IPC payload lengths Cristian Ciocaltea
@ 2026-11-30 0:55 ` Cristian Ciocaltea
2026-11-30 3:01 ` 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
` (3 subsequent siblings)
13 siblings, 2 replies; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 0:55 UTC (permalink / raw)
To: Christian Marangi, Andrew Lunn, Heiner Kallweit, Russell King,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: kernel, netdev
as21xxx_led_hw_control_set() looks up the requested rules in
as21xxx_led_supported_pattern, but does not check whether a match was
found. If the rules are not in the table, val keeps its initial value
of 0, so phy_modify_mmd() still gets called, overwriting the current LED
configuration with event 0, and the function returns success.
Return -EOPNOTSUPP when no matching pattern exists, before touching the
hardware, consistent with as21xxx_led_hw_is_supported(). As val is now
only used after a successful lookup, drop its redundant zero
initialization.
Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/net/phy/as21xxx.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
index 90b6f528f76d..1c4a808bf01e 100644
--- a/drivers/net/phy/as21xxx.c
+++ b/drivers/net/phy/as21xxx.c
@@ -844,7 +844,7 @@ static int as21xxx_led_hw_control_get(struct phy_device *phydev, u8 index,
static int as21xxx_led_hw_control_set(struct phy_device *phydev, u8 index,
unsigned long rules)
{
- u16 val = 0;
+ u16 val;
int i;
if (index >= AEON_MAX_LEDS)
@@ -856,6 +856,9 @@ static int as21xxx_led_hw_control_set(struct phy_device *phydev, u8 index,
break;
}
+ if (i == ARRAY_SIZE(as21xxx_led_supported_pattern))
+ return -EOPNOTSUPP;
+
return phy_modify_mmd(phydev, MDIO_MMD_VEND1,
VEND1_LED_REG(index),
VEND1_LED_REG_A_EVENT,
--
2.56.0
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [PATCH net 11/14] net: phy: as21xxx: Read 10/100/1000 link modes from C22 advertisement
2026-11-30 0:55 [PATCH net 00/14] net: phy: as21xxx: Fix a batch of driver issues Cristian Ciocaltea
` (9 preceding siblings ...)
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 0:55 ` Cristian Ciocaltea
2026-11-30 3:34 ` 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
` (2 subsequent siblings)
13 siblings, 2 replies; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 0:55 UTC (permalink / raw)
To: Christian Marangi, Andrew Lunn, Heiner Kallweit, Russell King,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: kernel, netdev
The Clause 45 ability registers hold a single bit for 10BASE-T and one
for 100BASE-TX, so genphy_c45_pma_read_abilities() derives both the full
and half duplex link modes from each of them, even on PHYs that support
neither 10BASE-T nor half duplex.
Read the 2.5G, 5G and 10G abilities from the Clause 45 registers as
before, then take the 10M, 100M and 1G link modes from the Clause 22
ADVERTISE and CTRL1000 registers mapped in the AN MMD. The firmware
does not update the C22 BMSR/ESTATUS ability bits, but its default
advertisement reflects the modes the PHY actually supports. If the
advertisement reads back empty, keep the Clause 45 derived modes.
Note that those registers mirror the current advertisement rather than a
fixed capability set, so they reflect the supported modes only while the
firmware defaults are in place. The PHY is reset when the driver is
unbound, so it reports the generic pre-firmware ID again and the
firmware is reloaded from .match_phy_device() before the next probe.
Hence .get_features() always samples the firmware defaults.
Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/net/phy/as21xxx.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)
diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
index 1c4a808bf01e..3423448a0cb1 100644
--- a/drivers/net/phy/as21xxx.c
+++ b/drivers/net/phy/as21xxx.c
@@ -644,6 +644,61 @@ static int as21xxx_probe(struct phy_device *phydev)
return aeon_dpc_ra_enable(phydev);
}
+static int as21xxx_get_features(struct phy_device *phydev)
+{
+ int ret, adv, ctrl1000;
+
+ /* Only the Clause 45 ability registers describe the 2.5G, 5G and 10G
+ * speeds.
+ */
+ ret = genphy_c45_pma_read_abilities(phydev);
+ if (ret)
+ return ret;
+
+ /* The C45 registers hold a single bit each for 10BASE-T and 100BASE-TX,
+ * so phylib sets both duplex modes. The firmware doesn't update the
+ * ability bits of the C22 BMSR/ESTATUS mapped in the AN MMD, but its
+ * default advertisement in the mapped ADVERTISE and CTRL1000 reflects
+ * the modes it actually supports, so take the 10M, 100M and 1G link
+ * modes from there.
+ */
+ adv = phy_read_mmd(phydev, MDIO_MMD_AN,
+ AS21XXX_MDIO_AN_C22 + MII_ADVERTISE);
+ if (adv < 0)
+ return adv;
+
+ ctrl1000 = phy_read_mmd(phydev, MDIO_MMD_AN,
+ AS21XXX_MDIO_AN_C22 + MII_CTRL1000);
+ if (ctrl1000 < 0)
+ return ctrl1000;
+
+ /* If the firmware defaults are not available, keep the C45-derived
+ * modes rather than dropping all 10/100/1000 link modes.
+ */
+ if (!(adv & ADVERTISE_ALL) ||
+ !(ctrl1000 & (ADVERTISE_1000HALF | ADVERTISE_1000FULL))) {
+ phydev_warn(phydev,
+ "Empty C22 advertisement, using C45 abilities\n");
+ return 0;
+ }
+
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT,
+ phydev->supported, adv & ADVERTISE_10HALF);
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT,
+ phydev->supported, adv & ADVERTISE_10FULL);
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT,
+ phydev->supported, adv & ADVERTISE_100HALF);
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT,
+ phydev->supported, adv & ADVERTISE_100FULL);
+
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT,
+ phydev->supported, ctrl1000 & ADVERTISE_1000HALF);
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT,
+ phydev->supported, ctrl1000 & ADVERTISE_1000FULL);
+
+ return 0;
+}
+
static int as21xxx_read_link(struct phy_device *phydev, int *bmcr)
{
int status;
@@ -981,6 +1036,7 @@ static struct phy_driver as21xxx_drivers[] = {
.probe = as21xxx_probe,
.match_phy_device = as21xxx_match_phy_device,
.read_status = as21xxx_read_status,
+ .get_features = as21xxx_get_features,
.led_brightness_set = as21xxx_led_brightness_set,
.led_hw_is_supported = as21xxx_led_hw_is_supported,
.led_hw_control_set = as21xxx_led_hw_control_set,
@@ -993,6 +1049,7 @@ static struct phy_driver as21xxx_drivers[] = {
.probe = as21xxx_probe,
.match_phy_device = as21xxx_match_phy_device,
.read_status = as21xxx_read_status,
+ .get_features = as21xxx_get_features,
.led_brightness_set = as21xxx_led_brightness_set,
.led_hw_is_supported = as21xxx_led_hw_is_supported,
.led_hw_control_set = as21xxx_led_hw_control_set,
@@ -1005,6 +1062,7 @@ static struct phy_driver as21xxx_drivers[] = {
.probe = as21xxx_probe,
.match_phy_device = as21xxx_match_phy_device,
.read_status = as21xxx_read_status,
+ .get_features = as21xxx_get_features,
.led_brightness_set = as21xxx_led_brightness_set,
.led_hw_is_supported = as21xxx_led_hw_is_supported,
.led_hw_control_set = as21xxx_led_hw_control_set,
@@ -1017,6 +1075,7 @@ static struct phy_driver as21xxx_drivers[] = {
.probe = as21xxx_probe,
.match_phy_device = as21xxx_match_phy_device,
.read_status = as21xxx_read_status,
+ .get_features = as21xxx_get_features,
.led_brightness_set = as21xxx_led_brightness_set,
.led_hw_is_supported = as21xxx_led_hw_is_supported,
.led_hw_control_set = as21xxx_led_hw_control_set,
@@ -1029,6 +1088,7 @@ static struct phy_driver as21xxx_drivers[] = {
.probe = as21xxx_probe,
.match_phy_device = as21xxx_match_phy_device,
.read_status = as21xxx_read_status,
+ .get_features = as21xxx_get_features,
.led_brightness_set = as21xxx_led_brightness_set,
.led_hw_is_supported = as21xxx_led_hw_is_supported,
.led_hw_control_set = as21xxx_led_hw_control_set,
@@ -1041,6 +1101,7 @@ static struct phy_driver as21xxx_drivers[] = {
.probe = as21xxx_probe,
.match_phy_device = as21xxx_match_phy_device,
.read_status = as21xxx_read_status,
+ .get_features = as21xxx_get_features,
.led_brightness_set = as21xxx_led_brightness_set,
.led_hw_is_supported = as21xxx_led_hw_is_supported,
.led_hw_control_set = as21xxx_led_hw_control_set,
@@ -1053,6 +1114,7 @@ static struct phy_driver as21xxx_drivers[] = {
.probe = as21xxx_probe,
.match_phy_device = as21xxx_match_phy_device,
.read_status = as21xxx_read_status,
+ .get_features = as21xxx_get_features,
.led_brightness_set = as21xxx_led_brightness_set,
.led_hw_is_supported = as21xxx_led_hw_is_supported,
.led_hw_control_set = as21xxx_led_hw_control_set,
@@ -1065,6 +1127,7 @@ static struct phy_driver as21xxx_drivers[] = {
.probe = as21xxx_probe,
.match_phy_device = as21xxx_match_phy_device,
.read_status = as21xxx_read_status,
+ .get_features = as21xxx_get_features,
.led_brightness_set = as21xxx_led_brightness_set,
.led_hw_is_supported = as21xxx_led_hw_is_supported,
.led_hw_control_set = as21xxx_led_hw_control_set,
@@ -1077,6 +1140,7 @@ static struct phy_driver as21xxx_drivers[] = {
.probe = as21xxx_probe,
.match_phy_device = as21xxx_match_phy_device,
.read_status = as21xxx_read_status,
+ .get_features = as21xxx_get_features,
.led_brightness_set = as21xxx_led_brightness_set,
.led_hw_is_supported = as21xxx_led_hw_is_supported,
.led_hw_control_set = as21xxx_led_hw_control_set,
@@ -1089,6 +1153,7 @@ static struct phy_driver as21xxx_drivers[] = {
.probe = as21xxx_probe,
.match_phy_device = as21xxx_match_phy_device,
.read_status = as21xxx_read_status,
+ .get_features = as21xxx_get_features,
.led_brightness_set = as21xxx_led_brightness_set,
.led_hw_is_supported = as21xxx_led_hw_is_supported,
.led_hw_control_set = as21xxx_led_hw_control_set,
--
2.56.0
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [PATCH net 12/14] net: phy: as21xxx: Configure autoneg advertisement via IPC
2026-11-30 0:55 [PATCH net 00/14] net: phy: as21xxx: Fix a batch of driver issues Cristian Ciocaltea
` (10 preceding siblings ...)
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 0:55 ` Cristian Ciocaltea
2026-11-30 3:43 ` Andrew Lunn
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 0:55 ` [PATCH net 14/14] net: phy: as21xxx: Release reset before reading ID in match Cristian Ciocaltea
13 siblings, 2 replies; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 0:55 UTC (permalink / raw)
To: Christian Marangi, Andrew Lunn, Heiner Kallweit, Russell King,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: kernel, netdev
The PHY does not properly support the Clause 45 auto-negotiation
registers that phylib writes from genphy_c45_config_aneg(). As a
consequence, restricting the advertisement from userspace does not have
the expected outcome on the wire. For example, setting it to
2500baseT/Full will confuse the peer, as 5000baseT/Full still shows up
in the link partner advertised link modes. Even worse, setting it to
100baseT/Full + 1000baseT/Full will end up with a broken link, because
the peer would only see the unrelated 2500baseT/Full + 5000baseT/Full
modes.
Since the firmware owns the advertisement and is reachable over IPC,
implement the .config_aneg callback and pass the highest advertised
speed. Cache it and only restart autoneg when it changes, as
genphy_c45_config_aneg() does, so that phy_start_aneg() does not take
the link down unnecessarily. Forced mode invalidates the cache so that
autoneg is restarted once it is re-enabled. So does .config_init, since
the firmware might have lost the setting, e.g. across a suspend/resume
cycle.
Note that the related IPC command only takes a top speed, and every
slower speed the PHY supports is advertised along with it. An arbitrary
subset cannot be described yet, so a link can still be negotiated below
the slowest speed that was asked for. Add those slower speeds to
phydev->advertising so that it reflects what is actually advertised on
the wire. If no BASE-T speed is advertised, which ethtool still allows,
fall back to the slowest supported one rather than leaving the PHY in
the error state.
Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/net/phy/as21xxx.c | 169 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 169 insertions(+)
diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
index 3423448a0cb1..967ff3020814 100644
--- a/drivers/net/phy/as21xxx.c
+++ b/drivers/net/phy/as21xxx.c
@@ -112,6 +112,18 @@
#define IPC_CFG_PARAM_DIRECT_TEMP_MON 0x11
#define IPC_CFG_PARAM_DIRECT_WOL 0x12
+/* Sub command of IPC_CFG_PARAM_DIRECT_CU_AN */
+#define IPC_CU_AN_RESTART 0xa
+#define IPC_CU_AN_TOP_SPD 0xc
+
+/* Argument of IPC_CU_AN_TOP_SPD */
+#define IPC_CU_AN_TOP_SPD_10 BIT(1)
+#define IPC_CU_AN_TOP_SPD_100 BIT(2)
+#define IPC_CU_AN_TOP_SPD_1000 BIT(3)
+#define IPC_CU_AN_TOP_SPD_2500 BIT(4)
+#define IPC_CU_AN_TOP_SPD_5000 BIT(5)
+#define IPC_CU_AN_TOP_SPD_10000 BIT(6)
+
/* Sub command of CMD_TEMP_MON */
#define IPC_CMD_TEMP_MON_GET 0x4
@@ -186,6 +198,11 @@ struct as21xxx_priv {
bool parity_status;
/* Protect concurrent IPC access */
struct mutex ipc_lock;
+ /* Top speed last handed to the firmware, 0 when it has to be sent
+ * again. Updated under phydev->lock, or while the state machine is
+ * stopped.
+ */
+ u16 top_spd;
};
static struct as21xxx_led_pattern_info as21xxx_led_supported_pattern[] = {
@@ -841,6 +858,138 @@ static int as21xxx_read_status(struct phy_device *phydev)
return 0;
}
+static int aeon_restart_aneg(struct phy_device *phydev)
+{
+ u16 data[3];
+
+ data[0] = IPC_CFG_PARAM_DIRECT;
+ data[1] = IPC_CFG_PARAM_DIRECT_CU_AN;
+ data[2] = IPC_CU_AN_RESTART;
+
+ return aeon_ipc_send_msg(phydev, IPC_CMD_CFG_PARAM, data,
+ sizeof(data), NULL);
+}
+
+static int aeon_set_top_speed(struct phy_device *phydev, u16 top_spd)
+{
+ u16 data[4];
+
+ data[0] = IPC_CFG_PARAM_DIRECT;
+ data[1] = IPC_CFG_PARAM_DIRECT_CU_AN;
+ data[2] = IPC_CU_AN_TOP_SPD;
+ data[3] = top_spd;
+
+ return aeon_ipc_send_msg(phydev, IPC_CMD_CFG_PARAM, data,
+ sizeof(data), NULL);
+}
+
+/* Highest speed first, the firmware is given the fastest advertised one */
+static const struct {
+ u16 top_spd;
+ int linkmode;
+} aeon_top_speeds[] = {
+ { IPC_CU_AN_TOP_SPD_10000, ETHTOOL_LINK_MODE_10000baseT_Full_BIT },
+ { IPC_CU_AN_TOP_SPD_5000, ETHTOOL_LINK_MODE_5000baseT_Full_BIT },
+ { IPC_CU_AN_TOP_SPD_2500, ETHTOOL_LINK_MODE_2500baseT_Full_BIT },
+ { IPC_CU_AN_TOP_SPD_1000, ETHTOOL_LINK_MODE_1000baseT_Full_BIT },
+ { IPC_CU_AN_TOP_SPD_1000, ETHTOOL_LINK_MODE_1000baseT_Half_BIT },
+ { IPC_CU_AN_TOP_SPD_100, ETHTOOL_LINK_MODE_100baseT_Full_BIT },
+ { IPC_CU_AN_TOP_SPD_100, ETHTOOL_LINK_MODE_100baseT_Half_BIT },
+ { IPC_CU_AN_TOP_SPD_10, ETHTOOL_LINK_MODE_10baseT_Full_BIT },
+ { IPC_CU_AN_TOP_SPD_10, ETHTOOL_LINK_MODE_10baseT_Half_BIT },
+};
+
+static int as21xxx_config_init(struct phy_device *phydev)
+{
+ struct as21xxx_priv *priv = phydev->priv;
+
+ /* The firmware might have lost the top speed, e.g. across a
+ * suspend/resume cycle, make sure the next .config_aneg sends it.
+ */
+ priv->top_spd = 0;
+
+ return 0;
+}
+
+static int as21xxx_config_aneg(struct phy_device *phydev)
+{
+ struct as21xxx_priv *priv = phydev->priv;
+ u16 top_spd;
+ int ret, i;
+
+ if (phydev->autoneg == AUTONEG_DISABLE) {
+ /* Make sure autoneg is restarted once enabled again */
+ priv->top_spd = 0;
+
+ return genphy_c45_pma_setup_forced(phydev);
+ }
+
+ /* The firmware doesn't properly support the C45 autoneg registers, so
+ * it has to be told over the IPC instead. Only the highest speed can
+ * be described at the moment, the slower ones the PHY supports are
+ * implicitly advertised along with it.
+ */
+ for (i = 0; i < ARRAY_SIZE(aeon_top_speeds); i++)
+ if (linkmode_test_bit(aeon_top_speeds[i].linkmode,
+ phydev->advertising))
+ break;
+
+ /* None of the BASE-T speeds is advertised, e.g. after
+ * "ethtool -s ... autoneg on speed 10" on a PHY lacking 10M. The IPC
+ * cannot advertise nothing, and an error would only put the PHY in
+ * the error state, so fall back to the slowest supported speed.
+ */
+ if (i == ARRAY_SIZE(aeon_top_speeds)) {
+ while (--i >= 0 &&
+ !linkmode_test_bit(aeon_top_speeds[i].linkmode,
+ phydev->supported))
+ ;
+
+ if (i < 0)
+ return -EINVAL;
+ }
+
+ top_spd = aeon_top_speeds[i].top_spd;
+
+ /* Let the advertisement reflect the slower speeds which go on the
+ * wire along with the highest one.
+ */
+ for (i = 0; i < ARRAY_SIZE(aeon_top_speeds); i++)
+ if (aeon_top_speeds[i].top_spd <= top_spd &&
+ linkmode_test_bit(aeon_top_speeds[i].linkmode,
+ phydev->supported))
+ linkmode_set_bit(aeon_top_speeds[i].linkmode,
+ phydev->advertising);
+
+ /* Restarting autoneg takes the link down, so only do it when the
+ * advertisement changed, or has to be sent again.
+ */
+ if (top_spd == priv->top_spd)
+ return 0;
+
+ ret = aeon_set_top_speed(phydev, top_spd);
+ if (ret)
+ return ret;
+
+ if (!priv->top_spd) {
+ /* genphy_c45_pma_setup_forced() clears MDIO_AN_CTRL1_ENABLE,
+ * which restarting autoneg over the IPC doesn't set back.
+ */
+ ret = phy_set_bits_mmd(phydev, MDIO_MMD_AN, MDIO_CTRL1,
+ MDIO_AN_CTRL1_ENABLE);
+ if (ret)
+ return ret;
+ }
+
+ ret = aeon_restart_aneg(phydev);
+ if (ret)
+ return ret;
+
+ priv->top_spd = top_spd;
+
+ return 0;
+}
+
static int as21xxx_led_brightness_set(struct phy_device *phydev,
u8 index, enum led_brightness value)
{
@@ -1037,6 +1186,8 @@ static struct phy_driver as21xxx_drivers[] = {
.match_phy_device = as21xxx_match_phy_device,
.read_status = as21xxx_read_status,
.get_features = as21xxx_get_features,
+ .config_init = as21xxx_config_init,
+ .config_aneg = as21xxx_config_aneg,
.led_brightness_set = as21xxx_led_brightness_set,
.led_hw_is_supported = as21xxx_led_hw_is_supported,
.led_hw_control_set = as21xxx_led_hw_control_set,
@@ -1050,6 +1201,8 @@ static struct phy_driver as21xxx_drivers[] = {
.match_phy_device = as21xxx_match_phy_device,
.read_status = as21xxx_read_status,
.get_features = as21xxx_get_features,
+ .config_init = as21xxx_config_init,
+ .config_aneg = as21xxx_config_aneg,
.led_brightness_set = as21xxx_led_brightness_set,
.led_hw_is_supported = as21xxx_led_hw_is_supported,
.led_hw_control_set = as21xxx_led_hw_control_set,
@@ -1063,6 +1216,8 @@ static struct phy_driver as21xxx_drivers[] = {
.match_phy_device = as21xxx_match_phy_device,
.read_status = as21xxx_read_status,
.get_features = as21xxx_get_features,
+ .config_init = as21xxx_config_init,
+ .config_aneg = as21xxx_config_aneg,
.led_brightness_set = as21xxx_led_brightness_set,
.led_hw_is_supported = as21xxx_led_hw_is_supported,
.led_hw_control_set = as21xxx_led_hw_control_set,
@@ -1076,6 +1231,8 @@ static struct phy_driver as21xxx_drivers[] = {
.match_phy_device = as21xxx_match_phy_device,
.read_status = as21xxx_read_status,
.get_features = as21xxx_get_features,
+ .config_init = as21xxx_config_init,
+ .config_aneg = as21xxx_config_aneg,
.led_brightness_set = as21xxx_led_brightness_set,
.led_hw_is_supported = as21xxx_led_hw_is_supported,
.led_hw_control_set = as21xxx_led_hw_control_set,
@@ -1089,6 +1246,8 @@ static struct phy_driver as21xxx_drivers[] = {
.match_phy_device = as21xxx_match_phy_device,
.read_status = as21xxx_read_status,
.get_features = as21xxx_get_features,
+ .config_init = as21xxx_config_init,
+ .config_aneg = as21xxx_config_aneg,
.led_brightness_set = as21xxx_led_brightness_set,
.led_hw_is_supported = as21xxx_led_hw_is_supported,
.led_hw_control_set = as21xxx_led_hw_control_set,
@@ -1102,6 +1261,8 @@ static struct phy_driver as21xxx_drivers[] = {
.match_phy_device = as21xxx_match_phy_device,
.read_status = as21xxx_read_status,
.get_features = as21xxx_get_features,
+ .config_init = as21xxx_config_init,
+ .config_aneg = as21xxx_config_aneg,
.led_brightness_set = as21xxx_led_brightness_set,
.led_hw_is_supported = as21xxx_led_hw_is_supported,
.led_hw_control_set = as21xxx_led_hw_control_set,
@@ -1115,6 +1276,8 @@ static struct phy_driver as21xxx_drivers[] = {
.match_phy_device = as21xxx_match_phy_device,
.read_status = as21xxx_read_status,
.get_features = as21xxx_get_features,
+ .config_init = as21xxx_config_init,
+ .config_aneg = as21xxx_config_aneg,
.led_brightness_set = as21xxx_led_brightness_set,
.led_hw_is_supported = as21xxx_led_hw_is_supported,
.led_hw_control_set = as21xxx_led_hw_control_set,
@@ -1128,6 +1291,8 @@ static struct phy_driver as21xxx_drivers[] = {
.match_phy_device = as21xxx_match_phy_device,
.read_status = as21xxx_read_status,
.get_features = as21xxx_get_features,
+ .config_init = as21xxx_config_init,
+ .config_aneg = as21xxx_config_aneg,
.led_brightness_set = as21xxx_led_brightness_set,
.led_hw_is_supported = as21xxx_led_hw_is_supported,
.led_hw_control_set = as21xxx_led_hw_control_set,
@@ -1141,6 +1306,8 @@ static struct phy_driver as21xxx_drivers[] = {
.match_phy_device = as21xxx_match_phy_device,
.read_status = as21xxx_read_status,
.get_features = as21xxx_get_features,
+ .config_init = as21xxx_config_init,
+ .config_aneg = as21xxx_config_aneg,
.led_brightness_set = as21xxx_led_brightness_set,
.led_hw_is_supported = as21xxx_led_hw_is_supported,
.led_hw_control_set = as21xxx_led_hw_control_set,
@@ -1154,6 +1321,8 @@ static struct phy_driver as21xxx_drivers[] = {
.match_phy_device = as21xxx_match_phy_device,
.read_status = as21xxx_read_status,
.get_features = as21xxx_get_features,
+ .config_init = as21xxx_config_init,
+ .config_aneg = as21xxx_config_aneg,
.led_brightness_set = as21xxx_led_brightness_set,
.led_hw_is_supported = as21xxx_led_hw_is_supported,
.led_hw_control_set = as21xxx_led_hw_control_set,
--
2.56.0
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [PATCH net 13/14] net: phy: as21xxx: Fix speed and duplex reporting
2026-11-30 0:55 [PATCH net 00/14] net: phy: as21xxx: Fix a batch of driver issues Cristian Ciocaltea
` (11 preceding siblings ...)
2026-11-30 0:55 ` [PATCH net 12/14] net: phy: as21xxx: Configure autoneg advertisement via IPC Cristian Ciocaltea
@ 2026-11-30 0:55 ` Cristian Ciocaltea
2026-11-30 3:50 ` 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
13 siblings, 2 replies; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 0:55 UTC (permalink / raw)
To: Christian Marangi, Andrew Lunn, Heiner Kallweit, Russell King,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: kernel, netdev
With autoneg enabled, as21xxx_read_status() derives the result purely in
software via phy_resolve_aneg_linkmode(). That does not work reliably
here: the advertisement is driven by the firmware over IPC, which
ignores the Clause 45 AN registers phylib writes except for the maximum
speed, and arbitrary subsets of speeds are not supported. The speed the
firmware actually settles on can therefore differ from what resolving
the advertised and link partner abilities yields.
Use VEND1_SPEED_STATUS, the authoritative source, on the autoneg path
too. Since aeon_config_aneg() makes phydev->advertising reflect what
the firmware puts on the wire, it is still reliable for picking the
duplex mode at that speed: resolve duplex from the link partner
advertisement (2.5GBASE-T and above are full duplex only), then resolve
pause. Parallel detection at 10/100M implies half duplex, unless the
PHY lacks it.
The link partner abilities are read from the Clause 22 registers mapped
in the AN MMD (base page and 1000BASE-T status), plus the 10GBASE-T
status register for 2.5G/5G/10G. Rename as21xxx_read_c22_lpa() to
as21xxx_read_lpa() accordingly, as it no longer covers Clause 22 only.
Speed and link partner abilities are only read once the link is up and
are reported unknown until then. An unrecognised speed status holds the
link down instead of failing read_status, which would move the PHY to
PHY_ERROR. I/O errors are still propagated.
With autoneg disabled, report the settings programmed by
genphy_c45_pma_setup_forced() via genphy_c45_read_pma(), regardless of
link state. Otherwise phy_sanitize_settings() sees unknown values on
the next autoneg restart with the link down and falls back to the
slowest mode. As a result, the BMCR_FULLDPLX check goes away, as it was
never set in Clause 45 forced mode, which is full duplex only. With the
link up, the speed is still taken from VEND1_SPEED_STATUS.
Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/net/phy/as21xxx.c | 200 ++++++++++++++++++++++++++++++++--------------
1 file changed, 141 insertions(+), 59 deletions(-)
diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
index 967ff3020814..5eea6baa75bf 100644
--- a/drivers/net/phy/as21xxx.c
+++ b/drivers/net/phy/as21xxx.c
@@ -716,22 +716,22 @@ static int as21xxx_get_features(struct phy_device *phydev)
return 0;
}
-static int as21xxx_read_link(struct phy_device *phydev, int *bmcr)
+static int as21xxx_read_link(struct phy_device *phydev)
{
- int status;
+ int bmcr, status;
/* Normal C22 BMCR report inconsistent data, use
* the mapped C22 in C45 to have more consistent link info.
*/
- *bmcr = phy_read_mmd(phydev, MDIO_MMD_AN,
- AS21XXX_MDIO_AN_C22 + MII_BMCR);
- if (*bmcr < 0)
- return *bmcr;
+ bmcr = phy_read_mmd(phydev, MDIO_MMD_AN,
+ AS21XXX_MDIO_AN_C22 + MII_BMCR);
+ if (bmcr < 0)
+ return bmcr;
/* Autoneg is being started, therefore disregard current
* link status and report link as down.
*/
- if (*bmcr & BMCR_ANRESTART) {
+ if (bmcr & BMCR_ANRESTART) {
phydev->link = 0;
return 0;
}
@@ -752,9 +752,9 @@ static int as21xxx_read_link(struct phy_device *phydev, int *bmcr)
return 0;
}
-static int as21xxx_read_c22_lpa(struct phy_device *phydev)
+static int as21xxx_read_lpa(struct phy_device *phydev)
{
- int lpagb;
+ int lpagb, lpa;
/* MII_STAT1000 are only filled in the mapped C22
* in C45, use that to fill lpagb values and check.
@@ -781,15 +781,107 @@ static int as21xxx_read_c22_lpa(struct phy_device *phydev)
mii_stat1000_mod_linkmode_lpa_t(phydev->lp_advertising,
lpagb);
+ /* Same goes for the base page of the link partner */
+ lpa = phy_read_mmd(phydev, MDIO_MMD_AN,
+ AS21XXX_MDIO_AN_C22 + MII_LPA);
+ if (lpa < 0)
+ return lpa;
+
+ mii_lpa_mod_linkmode_lpa_t(phydev->lp_advertising, lpa);
+
+ lpagb = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_10GBT_STAT);
+ if (lpagb < 0)
+ return lpagb;
+
+ mii_10gbt_stat_mod_linkmode_lpa_t(phydev->lp_advertising, lpagb);
+
return 0;
}
+static int as21xxx_read_speed(struct phy_device *phydev)
+{
+ int val;
+
+ val = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_SPEED_STATUS);
+ if (val < 0)
+ return val;
+
+ switch (val & VEND1_SPEED_MASK) {
+ case VEND1_SPEED_10000:
+ phydev->speed = SPEED_10000;
+ break;
+ case VEND1_SPEED_5000:
+ phydev->speed = SPEED_5000;
+ break;
+ case VEND1_SPEED_2500:
+ phydev->speed = SPEED_2500;
+ break;
+ case VEND1_SPEED_1000:
+ phydev->speed = SPEED_1000;
+ break;
+ case VEND1_SPEED_100:
+ phydev->speed = SPEED_100;
+ break;
+ case VEND1_SPEED_10:
+ phydev->speed = SPEED_10;
+ break;
+ default:
+ dev_warn_once(&phydev->mdio.dev,
+ "Unknown speed status 0x%04x\n", val);
+ phydev->speed = SPEED_UNKNOWN;
+ break;
+ }
+
+ return 0;
+}
+
+/* Pick the duplex mode negotiated for the speed the link came up at */
+static void as21xxx_resolve_duplex(struct phy_device *phydev)
+{
+ __ETHTOOL_DECLARE_LINK_MODE_MASK(common);
+ int full, half;
+
+ switch (phydev->speed) {
+ case SPEED_1000:
+ full = ETHTOOL_LINK_MODE_1000baseT_Full_BIT;
+ half = ETHTOOL_LINK_MODE_1000baseT_Half_BIT;
+ break;
+ case SPEED_100:
+ full = ETHTOOL_LINK_MODE_100baseT_Full_BIT;
+ half = ETHTOOL_LINK_MODE_100baseT_Half_BIT;
+ break;
+ case SPEED_10:
+ full = ETHTOOL_LINK_MODE_10baseT_Full_BIT;
+ half = ETHTOOL_LINK_MODE_10baseT_Half_BIT;
+ break;
+ default:
+ /* 2.5GBASE-T and above are full duplex only */
+ phydev->duplex = DUPLEX_FULL;
+ return;
+ }
+
+ linkmode_and(common, phydev->lp_advertising, phydev->advertising);
+
+ if (linkmode_test_bit(full, common)) {
+ phydev->duplex = DUPLEX_FULL;
+ } else if (linkmode_test_bit(half, common)) {
+ phydev->duplex = DUPLEX_HALF;
+ } else {
+ /* No partner abilities, i.e. parallel detection at 10/100M,
+ * which implies half duplex, unless the PHY lacks it.
+ */
+ phydev->duplex = phydev->speed != SPEED_1000 &&
+ linkmode_test_bit(half, phydev->supported) ?
+ DUPLEX_HALF : DUPLEX_FULL;
+ }
+}
+
static int as21xxx_read_status(struct phy_device *phydev)
{
- int bmcr, old_link = phydev->link;
+ int old_link = phydev->link;
int ret;
- ret = as21xxx_read_link(phydev, &bmcr);
+ ret = as21xxx_read_link(phydev);
if (ret)
return ret;
@@ -797,64 +889,54 @@ static int as21xxx_read_status(struct phy_device *phydev)
if (phydev->autoneg == AUTONEG_ENABLE && old_link && phydev->link)
return 0;
- phydev->speed = SPEED_UNKNOWN;
- phydev->duplex = DUPLEX_UNKNOWN;
phydev->pause = 0;
phydev->asym_pause = 0;
- if (phydev->autoneg == AUTONEG_ENABLE) {
- ret = genphy_c45_read_lpa(phydev);
+ if (phydev->autoneg == AUTONEG_DISABLE) {
+ ret = genphy_c45_read_pma(phydev);
if (ret)
return ret;
- ret = as21xxx_read_c22_lpa(phydev);
- if (ret)
- return ret;
+ if (phydev->link) {
+ ret = as21xxx_read_speed(phydev);
- phy_resolve_aneg_linkmode(phydev);
- } else {
- int speed;
-
- linkmode_zero(phydev->lp_advertising);
-
- speed = phy_read_mmd(phydev, MDIO_MMD_VEND1,
- VEND1_SPEED_STATUS);
- if (speed < 0)
- return speed;
-
- switch (speed & VEND1_SPEED_MASK) {
- case VEND1_SPEED_10000:
- phydev->speed = SPEED_10000;
- phydev->duplex = DUPLEX_FULL;
- break;
- case VEND1_SPEED_5000:
- phydev->speed = SPEED_5000;
- phydev->duplex = DUPLEX_FULL;
- break;
- case VEND1_SPEED_2500:
- phydev->speed = SPEED_2500;
- phydev->duplex = DUPLEX_FULL;
- break;
- case VEND1_SPEED_1000:
- phydev->speed = SPEED_1000;
- if (bmcr & BMCR_FULLDPLX)
- phydev->duplex = DUPLEX_FULL;
- else
- phydev->duplex = DUPLEX_HALF;
- break;
- case VEND1_SPEED_100:
- phydev->speed = SPEED_100;
- phydev->duplex = DUPLEX_FULL;
- break;
- case VEND1_SPEED_10:
- phydev->speed = SPEED_10;
- phydev->duplex = DUPLEX_FULL;
- break;
- default:
- return -EINVAL;
+ /* Hold the link down until the speed status settles */
+ if (!ret && phydev->speed == SPEED_UNKNOWN)
+ phydev->link = 0;
}
+
+ return ret;
}
+ phydev->speed = SPEED_UNKNOWN;
+ phydev->duplex = DUPLEX_UNKNOWN;
+ linkmode_zero(phydev->lp_advertising);
+
+ /* as21xxx_read_link() reports link up only once autoneg completed */
+ if (!phydev->link)
+ return 0;
+
+ /* The firmware advertises every speed up to the highest one in
+ * phydev->advertising, hence resolving the advertisements may not
+ * match the link. Take the speed from VEND1_SPEED_STATUS instead.
+ */
+ ret = as21xxx_read_speed(phydev);
+ if (ret)
+ return ret;
+
+ /* Hold the link down until the speed status settles */
+ if (phydev->speed == SPEED_UNKNOWN) {
+ phydev->link = 0;
+ return 0;
+ }
+
+ ret = as21xxx_read_lpa(phydev);
+ if (ret)
+ return ret;
+
+ as21xxx_resolve_duplex(phydev);
+ phy_resolve_aneg_pause(phydev);
+
return 0;
}
--
2.56.0
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [PATCH net 14/14] net: phy: as21xxx: Release reset before reading ID in match
2026-11-30 0:55 [PATCH net 00/14] net: phy: as21xxx: Fix a batch of driver issues Cristian Ciocaltea
` (12 preceding siblings ...)
2026-11-30 0:55 ` [PATCH net 13/14] net: phy: as21xxx: Fix speed and duplex reporting Cristian Ciocaltea
@ 2026-11-30 0:55 ` Cristian Ciocaltea
2026-11-30 3:53 ` Andrew Lunn
2026-12-01 1:51 ` netdev-bot+sashiko
13 siblings, 2 replies; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 0:55 UTC (permalink / raw)
To: Christian Marangi, Andrew Lunn, Heiner Kallweit, Russell King,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: kernel, netdev
The Aeonsemi PHYs report a generic PHY ID until their firmware is
loaded, so the driver reads the ID from the hardware while matching
instead of relying on the ID cached at bus scan time.
The PHY only reports a valid ID while out of reset, which is not
guaranteed. phy_remove() asserts the reset and phy_probe() deasserts
it, but probing only happens once a driver has matched. Rebinding the
driver, for instance by reloading the module, therefore reads the ID of
a PHY held in reset. This fails to match, leaving the PHY in reset with
no driver bound, which cannot be recovered without a power cycle.
Deassert the reset before reading the ID. mdio_device_reset() keeps
track of the reset state, so this does nothing when the PHY has no reset
described or is already out of reset. Since the PHY comes out of reset
with its firmware unloaded, it reports the generic PHY ID again and the
existing firmware loading path handles it. If no driver matches, the
PHY is left out of reset, just as after phy_device_register().
Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
drivers/net/phy/as21xxx.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
index 5eea6baa75bf..761458c606a2 100644
--- a/drivers/net/phy/as21xxx.c
+++ b/drivers/net/phy/as21xxx.c
@@ -1196,6 +1196,12 @@ static int as21xxx_match_phy_device(struct phy_device *phydev,
PHY_VENDOR_AEONSEMI))
return genphy_match_phy_device(phydev, phydrv);
+ /* phy_remove() leaves the PHY in reset and only phy_probe() releases
+ * it, so release it here to be able to read the ID on rebind. No-op
+ * if there is no reset or it is already released.
+ */
+ phy_device_reset(phydev, 0);
+
/* Read PHY ID to handle firmware loaded or HW reset */
ret = phy_read_mmd(phydev, MDIO_MMD_PCS, MII_PHYSID1);
if (ret < 0)
--
2.56.0
^ permalink raw reply related [flat|nested] 47+ messages in thread
* Re: [PATCH net 03/14] net: phy: as21xxx: Fix LED index bounds check
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
0 siblings, 1 reply; 47+ messages in thread
From: Andrew Lunn @ 2026-11-30 2:37 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
On Mon, Nov 30, 2026 at 02:55:10AM +0200, Cristian Ciocaltea wrote:
> The LED indexes are zero-based, so valid indexes are strictly less than
> the number of LEDs, AEON_MAX_LEDS. However, the LED ops only reject
> indexes greater than AEON_MAX_LEDS, which wrongly accepts an index equal
> to AEON_MAX_LEDS, one past the last valid LED.
>
> Such an index makes VEND1_LED_REG() compute an address outside the LED
> register block. A bogus LED node in the device tree can then cause
> reads and writes of an unrelated vendor register.
>
> Reject indexes greater than or equal to AEON_MAX_LEDS so that only valid
> LED indexes are accepted.
>
> Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
I'm not sure a Fixes tag is justified. Does this actually bother
anybody? It requires a broken DT blob. Does mainline have one?
I suggest this goes via net-next.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 04/14] net: phy: as21xxx: Use the correct mask for the speed status
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
0 siblings, 0 replies; 47+ messages in thread
From: Andrew Lunn @ 2026-11-30 2:39 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
On Mon, Nov 30, 2026 at 02:55:11AM +0200, Cristian Ciocaltea wrote:
> as21xxx_read_status() masks the speed status with VEND1_SPEED_STATUS,
> the address of the register it just read, instead of VEND1_SPEED_MASK,
> which is the field mask the speed values are built with.
>
> This affects the path taken when auto-negotiation is disabled. For
> example, after setting "speed 100 duplex full autoneg off", ethtool
> would incorrectly report "Speed: 10Mb/s" instead of "Speed: 100Mb/s".
>
> Switch to the correct field mask so the speed is decoded properly.
>
> Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 05/14] net: phy: as21xxx: Correct the 10M speed status value
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
1 sibling, 0 replies; 47+ messages in thread
From: Andrew Lunn @ 2026-11-30 2:40 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
On Mon, Nov 30, 2026 at 02:55:12AM +0200, Cristian Ciocaltea wrote:
> The speed status register reports 0x40 for a 10M link, not 0x0 as
> VEND1_SPEED_10 describes.
>
> 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:
>
> [ 740.903011] _phy_start_aneg+0x0/0x98: returned: -22
> [ 740.907932] WARNING: CPU: 0 PID: 6774 at _phy_state_machine+0x60/0x2dc
> [...]
> [ 741.192990] Call trace:
> [ 741.195429] _phy_state_machine+0x60/0x2dc
> [ 741.199526] phy_state_machine+0x28/0x80
> [ 741.203449] process_one_work+0x174/0x300
> [...]
>
> The bug was hidden because the status was masked with VEND1_SPEED_STATUS
> (the register address) instead of VEND1_SPEED_MASK. 0x40 & 0x4002
> evaluates to 0, which happened to match the wrong VEND1_SPEED_10 value,
> so 10M links were still reported correctly. Fixing the mask exposes the
> bad definition.
>
> Describe the value the PHY actually reports.
>
> Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 06/14] net: phy: as21xxx: Do not write the IPC reply to a NULL buffer
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
1 sibling, 1 reply; 47+ messages in thread
From: Andrew Lunn @ 2026-11-30 2:49 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
On Mon, Nov 30, 2026 at 02:55:13AM +0200, Cristian Ciocaltea wrote:
> aeon_ipc_send_msg() intends to skip reading the IPC reply when the
> caller passes no buffer for it, but the check tests the input buffer
> (data) rather than the output buffer (ret_data).
The comment at the beginning of the function is also wrong:
/* If data is NULL, return 0 or negative error.
* If data not NULL, return number of Bytes received from IPC or
* a negative error.
*/
static int aeon_ipc_send_msg(struct phy_device *phydev,
u16 opcode, u16 *data, unsigned int data_len,
u16 *ret_data)
{
Maybe a later patch fixes that?
> A caller supplying
> a payload but a NULL ret_data would have the reply written through a
> NULL pointer.
>
> Check ret_data before copying the reply. While at it, validate the
> input buffer at function entry, rejecting a NULL data pointer with a
> non-zero data_len.
I would actually let this explode. The oops makes it clear where the
bug is, returning EINVAL will be harder to correct, there is already
three of them in this function.
> Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
This is purely about validation of the passed parameters, that the
validation is not strictly correct. As far as i see, nothing in the
happy days case is actually broken? So this should go via net-next.
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 07/14] net: phy: as21xxx: Write IPC payload under ipc_lock
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
1 sibling, 1 reply; 47+ messages in thread
From: Andrew Lunn @ 2026-11-30 2:53 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
On Mon, Nov 30, 2026 at 02:55:14AM +0200, Cristian Ciocaltea wrote:
> aeon_ipc_send_msg() writes the message payload to the shared
> VEND1_IPC_DATA registers before taking ipc_lock. Two concurrent
> senders may interleave, so that one overwrites the payload of the
> other before the corresponding command is issued. The firmware would
> then execute a command with the wrong arguments.
>
> Take ipc_lock before writing the payload, so that filling the data
> registers and issuing the command happen atomically with respect to
> other IPC users. The argument checks remain outside the lock.
How theoretical is this? phylib operations are protected by the phylib
mutex. That should include LEDs.
What is outside of phylib is things like hwmon devices. Does this
driver have any paths which don't take the phydev mutex?
The patch seems theoretically valid, but does it actually bother
anybody? If not, net-next.
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 08/14] net: phy: as21xxx: Handle IPC payload write errors
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
0 siblings, 0 replies; 47+ messages in thread
From: Andrew Lunn @ 2026-11-30 2:54 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
On Mon, Nov 30, 2026 at 02:55:15AM +0200, Cristian Ciocaltea wrote:
> aeon_ipc_send_msg() ignores the return value of phy_write_mmd() when
> filling the IPC data registers. On an MDIO failure the command is still
> issued, and the firmware acts on stale or partial data left in the
> registers.
>
> Check the result of each write and abort the transfer on error,
> propagating the error code to the caller.
>
> Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
MDIO transactions pretty much never fail, so this is
theoretical. net-next please.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 09/14] net: phy: as21xxx: Reject odd IPC payload lengths
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
1 sibling, 0 replies; 47+ messages in thread
From: Andrew Lunn @ 2026-11-30 2:55 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
On Mon, Nov 30, 2026 at 02:55:16AM +0200, Cristian Ciocaltea wrote:
> The IPC payload is transferred through 16-bit data registers, but
> aeon_ipc_send_msg() advertises data_len bytes to the firmware while
> writing only data_len / 2 registers. For an odd length the last byte is
> silently dropped, and the firmware reads whatever was left in the next
> register.
>
> Reject payload lengths that are not a multiple of the register width.
Are there currently can callers which get this wrong?
Seems like net-next.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 10/14] net: phy: as21xxx: Fix LED hw control set for unsupported rules
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-12-01 1:50 ` netdev-bot+sashiko
1 sibling, 1 reply; 47+ messages in thread
From: Andrew Lunn @ 2026-11-30 3:01 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
> + if (i == ARRAY_SIZE(as21xxx_led_supported_pattern))
> + return -EOPNOTSUPP;
> +
> return phy_modify_mmd(phydev, MDIO_MMD_VEND1,
> VEND1_LED_REG(index),
> VEND1_LED_REG_A_EVENT,
This works, but maybe:
for (i = 0; i < ARRAY_SIZE(as21xxx_led_supported_pattern); i++)
if (rules == as21xxx_led_supported_pattern[i].pattern) {
val = as21xxx_led_supported_pattern[i].val;
return phy_modify_mmd(phydev, MDIO_MMD_VEND1,
VEND1_LED_REG(index),
VEND1_LED_REG_A_EVENT,
FIELD_PREP(VEND1_LED_REG_A_EVENT,
val));
}
return -EOPNOTSUPP
}
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 11/14] net: phy: as21xxx: Read 10/100/1000 link modes from C22 advertisement
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-12-01 1:50 ` netdev-bot+sashiko
1 sibling, 1 reply; 47+ messages in thread
From: Andrew Lunn @ 2026-11-30 3:34 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
On Mon, Nov 30, 2026 at 02:55:18AM +0200, Cristian Ciocaltea wrote:
> The Clause 45 ability registers hold a single bit for 10BASE-T and one
> for 100BASE-TX, so genphy_c45_pma_read_abilities() derives both the full
> and half duplex link modes from each of them, even on PHYs that support
> neither 10BASE-T nor half duplex.
>
> Read the 2.5G, 5G and 10G abilities from the Clause 45 registers as
> before, then take the 10M, 100M and 1G link modes from the Clause 22
> ADVERTISE and CTRL1000 registers mapped in the AN MMD. The firmware
> does not update the C22 BMSR/ESTATUS ability bits, but its default
> advertisement reflects the modes the PHY actually supports. If the
> advertisement reads back empty, keep the Clause 45 derived modes.
This is funky, i'm not sure this is a safe assumption to make.
Is it known what this PHY actually supports?
I think it would be better to just accept the firmware is broken and
hard code the 10/100/1G link modes after calling
genphy_c45_pma_read_abilities().
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 12/14] net: phy: as21xxx: Configure autoneg advertisement via IPC
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
1 sibling, 1 reply; 47+ messages in thread
From: Andrew Lunn @ 2026-11-30 3:43 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
On Mon, Nov 30, 2026 at 02:55:19AM +0200, Cristian Ciocaltea wrote:
> The PHY does not properly support the Clause 45 auto-negotiation
> registers that phylib writes from genphy_c45_config_aneg(). As a
> consequence, restricting the advertisement from userspace does not have
> the expected outcome on the wire. For example, setting it to
> 2500baseT/Full will confuse the peer, as 5000baseT/Full still shows up
> in the link partner advertised link modes. Even worse, setting it to
> 100baseT/Full + 1000baseT/Full will end up with a broken link, because
> the peer would only see the unrelated 2500baseT/Full + 5000baseT/Full
> modes.
>
> Since the firmware owns the advertisement and is reachable over IPC,
> implement the .config_aneg callback and pass the highest advertised
> speed.
That is not technically correct.
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
There is free choice of any combination of the supported modes.
It should be possible to ask it to advertise
Advertised link modes: 10baseT/Half 1000baseT/Full
I find it surprising it is totally broken. 10/100/1G are often in
vendor registers, so you might need to implement those link modes
separately to the standard C45 2500, 5000 and 10G.
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 13/14] net: phy: as21xxx: Fix speed and duplex reporting
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-12-01 1:51 ` netdev-bot+sashiko
1 sibling, 1 reply; 47+ messages in thread
From: Andrew Lunn @ 2026-11-30 3:50 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
On Mon, Nov 30, 2026 at 02:55:20AM +0200, Cristian Ciocaltea wrote:
> With autoneg enabled, as21xxx_read_status() derives the result purely in
> software via phy_resolve_aneg_linkmode(). That does not work reliably
> here: the advertisement is driven by the firmware over IPC, which
> ignores the Clause 45 AN registers phylib writes except for the maximum
> speed, and arbitrary subsets of speeds are not supported.
So the firmware is totally FUBAR?
So autoneg does not work, other than for a single link mode? This
suggests you are setting phydev->supported wrongly. It should have a
single link mode in it, the top speed the PHY supports.
phylib should then do the correct thing, it will only let the user
select that one link mode for advertisement.
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 14/14] net: phy: as21xxx: Release reset before reading ID in match
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
1 sibling, 1 reply; 47+ messages in thread
From: Andrew Lunn @ 2026-11-30 3:53 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
On Mon, Nov 30, 2026 at 02:55:21AM +0200, Cristian Ciocaltea wrote:
> The Aeonsemi PHYs report a generic PHY ID until their firmware is
> loaded, so the driver reads the ID from the hardware while matching
> instead of relying on the ID cached at bus scan time.
>
> The PHY only reports a valid ID while out of reset, which is not
> guaranteed. phy_remove() asserts the reset and phy_probe() deasserts
> it, but probing only happens once a driver has matched. Rebinding the
> driver, for instance by reloading the module, therefore reads the ID of
> a PHY held in reset. This fails to match, leaving the PHY in reset with
> no driver bound, which cannot be recovered without a power cycle.
We don't do fun and games like this. We just require the compatible in
DT contains the ID, if the ID cannot be reliably read from the device.
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 03/14] net: phy: as21xxx: Fix LED index bounds check
2026-11-30 2:37 ` Andrew Lunn
@ 2026-11-30 10:35 ` Cristian Ciocaltea
0 siblings, 0 replies; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 10:35 UTC (permalink / raw)
To: Andrew Lunn
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
Hi Andrew,
On 11/30/26 4:37 AM, Andrew Lunn wrote:
> On Mon, Nov 30, 2026 at 02:55:10AM +0200, Cristian Ciocaltea wrote:
>> The LED indexes are zero-based, so valid indexes are strictly less than
>> the number of LEDs, AEON_MAX_LEDS. However, the LED ops only reject
>> indexes greater than AEON_MAX_LEDS, which wrongly accepts an index equal
>> to AEON_MAX_LEDS, one past the last valid LED.
>>
>> Such an index makes VEND1_LED_REG() compute an address outside the LED
>> register block. A bogus LED node in the device tree can then cause
>> reads and writes of an unrelated vendor register.
>>
>> Reject indexes greater than or equal to AEON_MAX_LEDS so that only valid
>> LED indexes are accepted.
>>
>> Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
>
> I'm not sure a Fixes tag is justified. Does this actually bother
> anybody? It requires a broken DT blob. Does mainline have one?
>
> I suggest this goes via net-next.
Ack, I'll make this part of the follow-up series adding Gen2 support.
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Thanks for your quick review.
Regards,
Cristian
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 06/14] net: phy: as21xxx: Do not write the IPC reply to a NULL buffer
2026-11-30 2:49 ` Andrew Lunn
@ 2026-11-30 10:53 ` Cristian Ciocaltea
0 siblings, 0 replies; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 10:53 UTC (permalink / raw)
To: Andrew Lunn
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
On 11/30/26 4:49 AM, Andrew Lunn wrote:
> On Mon, Nov 30, 2026 at 02:55:13AM +0200, Cristian Ciocaltea wrote:
>> aeon_ipc_send_msg() intends to skip reading the IPC reply when the
>> caller passes no buffer for it, but the check tests the input buffer
>> (data) rather than the output buffer (ret_data).
>
> The comment at the beginning of the function is also wrong:
>
> /* If data is NULL, return 0 or negative error.
> * If data not NULL, return number of Bytes received from IPC or
> * a negative error.
> */
> static int aeon_ipc_send_msg(struct phy_device *phydev,
> u16 opcode, u16 *data, unsigned int data_len,
> u16 *ret_data)
> {
>
>
> Maybe a later patch fixes that?
Sure, I somehow missed to correct it.
>> A caller supplying
>> a payload but a NULL ret_data would have the reply written through a
>> NULL pointer.
>>
>> Check ret_data before copying the reply. While at it, validate the
>> input buffer at function entry, rejecting a NULL data pointer with a
>> non-zero data_len.
>
> I would actually let this explode. The oops makes it clear where the
> bug is, returning EINVAL will be harder to correct, there is already
> three of them in this function.
Ok, I'll drop the 'data_len && !data' check and just keep the '!ret_data' one.
>> Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
>
> This is purely about validation of the passed parameters, that the
> validation is not strictly correct. As far as i see, nothing in the
> happy days case is actually broken? So this should go via net-next.
Indeed, let's move this to the next series.
Thanks,
Cristian
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 07/14] net: phy: as21xxx: Write IPC payload under ipc_lock
2026-11-30 2:53 ` Andrew Lunn
@ 2026-11-30 11:09 ` Cristian Ciocaltea
0 siblings, 0 replies; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 11:09 UTC (permalink / raw)
To: Andrew Lunn
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
On 11/30/26 4:53 AM, Andrew Lunn wrote:
> On Mon, Nov 30, 2026 at 02:55:14AM +0200, Cristian Ciocaltea wrote:
>> aeon_ipc_send_msg() writes the message payload to the shared
>> VEND1_IPC_DATA registers before taking ipc_lock. Two concurrent
>> senders may interleave, so that one overwrites the payload of the
>> other before the corresponding command is issued. The firmware would
>> then execute a command with the wrong arguments.
>>
>> Take ipc_lock before writing the payload, so that filling the data
>> registers and issuing the command happen atomically with respect to
>> other IPC users. The argument checks remain outside the lock.
>
> How theoretical is this? phylib operations are protected by the phylib
> mutex. That should include LEDs.
>
> What is outside of phylib is things like hwmon devices. Does this
> driver have any paths which don't take the phydev mutex?
>
> The patch seems theoretically valid, but does it actually bother
> anybody? If not, net-next.
The driver defines IPC_CMD_TEMP_MON_GET but doesn't use it to support any hwmon
temperature features yet, so I'll move it to net-next.
Thanks,
Cristian
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 10/14] net: phy: as21xxx: Fix LED hw control set for unsupported rules
2026-11-30 3:01 ` Andrew Lunn
@ 2026-11-30 11:29 ` Cristian Ciocaltea
2026-11-30 13:37 ` Andrew Lunn
0 siblings, 1 reply; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 11:29 UTC (permalink / raw)
To: Andrew Lunn
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
On 11/30/26 5:01 AM, Andrew Lunn wrote:
>> + if (i == ARRAY_SIZE(as21xxx_led_supported_pattern))
>> + return -EOPNOTSUPP;
>> +
>> return phy_modify_mmd(phydev, MDIO_MMD_VEND1,
>> VEND1_LED_REG(index),
>> VEND1_LED_REG_A_EVENT,
>
> This works, but maybe:
>
> for (i = 0; i < ARRAY_SIZE(as21xxx_led_supported_pattern); i++)
> if (rules == as21xxx_led_supported_pattern[i].pattern) {
> val = as21xxx_led_supported_pattern[i].val;
> return phy_modify_mmd(phydev, MDIO_MMD_VEND1,
> VEND1_LED_REG(index),
> VEND1_LED_REG_A_EVENT,
> FIELD_PREP(VEND1_LED_REG_A_EVENT,
> val));
>
> }
>
> return -EOPNOTSUPP
> }
On upcoming Gen2 PHY the LEDs are meant to be driven by the firmware via IPC
rather than by writing the vendor LED registers directly. The refactored block
will look like this:
info = aeon_led_find_pattern(phydev, rules);
if (!info)
return -EOPNOTSUPP;
return data->led_ops->set_event(phydev, index, info->val);
I'm happy to incorporate your suggestion if you prefer, though it will add some
churn to the diffs.
Cristian
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 11/14] net: phy: as21xxx: Read 10/100/1000 link modes from C22 advertisement
2026-11-30 3:34 ` Andrew Lunn
@ 2026-11-30 11:53 ` Cristian Ciocaltea
2026-11-30 13:39 ` Andrew Lunn
0 siblings, 1 reply; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 11:53 UTC (permalink / raw)
To: Andrew Lunn
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
On 11/30/26 5:34 AM, Andrew Lunn wrote:
> On Mon, Nov 30, 2026 at 02:55:18AM +0200, Cristian Ciocaltea wrote:
>> The Clause 45 ability registers hold a single bit for 10BASE-T and one
>> for 100BASE-TX, so genphy_c45_pma_read_abilities() derives both the full
>> and half duplex link modes from each of them, even on PHYs that support
>> neither 10BASE-T nor half duplex.
>>
>> Read the 2.5G, 5G and 10G abilities from the Clause 45 registers as
>> before, then take the 10M, 100M and 1G link modes from the Clause 22
>> ADVERTISE and CTRL1000 registers mapped in the AN MMD. The firmware
>> does not update the C22 BMSR/ESTATUS ability bits, but its default
>> advertisement reflects the modes the PHY actually supports. If the
>> advertisement reads back empty, keep the Clause 45 derived modes.
>
> This is funky, i'm not sure this is a safe assumption to make.
>
> Is it known what this PHY actually supports?
>
> I think it would be better to just accept the firmware is broken and
> hard code the 10/100/1G link modes after calling
> genphy_c45_pma_read_abilities().
Yeah, the firmware is definitely broken. This is what ethtool currently shows
for both PHY generations:
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
10000baseT/Full
2500baseT/Full
5000baseT/Full
However, my understanding is that Gen1 doesn't actually support 10baseT, only
Gen2 does, while 100baseT/Half is never advertised by the firmware. I can go
with the hard-coded approach, as there doesn't seem to be a better or more
reliable way to get this information from the hardware.
Thanks,
Cristian
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 12/14] net: phy: as21xxx: Configure autoneg advertisement via IPC
2026-11-30 3:43 ` Andrew Lunn
@ 2026-11-30 12:05 ` Cristian Ciocaltea
0 siblings, 0 replies; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 12:05 UTC (permalink / raw)
To: Andrew Lunn
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
On 11/30/26 5:43 AM, Andrew Lunn wrote:
> On Mon, Nov 30, 2026 at 02:55:19AM +0200, Cristian Ciocaltea wrote:
>> The PHY does not properly support the Clause 45 auto-negotiation
>> registers that phylib writes from genphy_c45_config_aneg(). As a
>> consequence, restricting the advertisement from userspace does not have
>> the expected outcome on the wire. For example, setting it to
>> 2500baseT/Full will confuse the peer, as 5000baseT/Full still shows up
>> in the link partner advertised link modes. Even worse, setting it to
>> 100baseT/Full + 1000baseT/Full will end up with a broken link, because
>> the peer would only see the unrelated 2500baseT/Full + 5000baseT/Full
>> modes.
>>
>> Since the firmware owns the advertisement and is reachable over IPC,
>> implement the .config_aneg callback and pass the highest advertised
>> speed.
>
> That is not technically correct.
>
> Supported link modes: 10baseT/Half 10baseT/Full
> 100baseT/Half 100baseT/Full
> 1000baseT/Full
>
> There is free choice of any combination of the supported modes.
> It should be possible to ask it to advertise
>
> Advertised link modes: 10baseT/Half 1000baseT/Full
>
> I find it surprising it is totally broken. 10/100/1G are often in
> vendor registers, so you might need to implement those link modes
> separately to the standard C45 2500, 5000 and 10G.
Yeah, this was unexpected for me as well, but I later confirmed it with the
vendor: the firmware doesn't support arbitrary combinations of modes. It can
only take a top speed, and everything below is implicitly advertised :-(
Cristian
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 13/14] net: phy: as21xxx: Fix speed and duplex reporting
2026-11-30 3:50 ` Andrew Lunn
@ 2026-11-30 12:21 ` Cristian Ciocaltea
2026-11-30 14:01 ` Andrew Lunn
0 siblings, 1 reply; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 12:21 UTC (permalink / raw)
To: Andrew Lunn
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
On 11/30/26 5:50 AM, Andrew Lunn wrote:
> On Mon, Nov 30, 2026 at 02:55:20AM +0200, Cristian Ciocaltea wrote:
>> With autoneg enabled, as21xxx_read_status() derives the result purely in
>> software via phy_resolve_aneg_linkmode(). That does not work reliably
>> here: the advertisement is driven by the firmware over IPC, which
>> ignores the Clause 45 AN registers phylib writes except for the maximum
>> speed, and arbitrary subsets of speeds are not supported.
>
> So the firmware is totally FUBAR?
>
> So autoneg does not work, other than for a single link mode? This
> suggests you are setting phydev->supported wrongly. It should have a
> single link mode in it, the top speed the PHY supports.
>
> phylib should then do the correct thing, it will only let the user
> select that one link mode for advertisement.
As previously discussed, the root cause of all this unexpected behavior is the
firmware limitation: it cannot handle arbitrary subsets of speeds and always
advertises the full range, from the minimum supported speed up to the top one
(the only limit that can be enforced).
aeon$ ethtool -s eth1 autoneg on advertise 0x800000000000 # 2.5G
peer$ ethtool enp0s13f0u1
Link partner advertised link modes: 100baseT/Full
1000baseT/Full
2500baseT/Full
Thanks,
Cristian
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 14/14] net: phy: as21xxx: Release reset before reading ID in match
2026-11-30 3:53 ` Andrew Lunn
@ 2026-11-30 12:22 ` Cristian Ciocaltea
0 siblings, 0 replies; 47+ messages in thread
From: Cristian Ciocaltea @ 2026-11-30 12:22 UTC (permalink / raw)
To: Andrew Lunn
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
On 11/30/26 5:53 AM, Andrew Lunn wrote:
> On Mon, Nov 30, 2026 at 02:55:21AM +0200, Cristian Ciocaltea wrote:
>> The Aeonsemi PHYs report a generic PHY ID until their firmware is
>> loaded, so the driver reads the ID from the hardware while matching
>> instead of relying on the ID cached at bus scan time.
>>
>> The PHY only reports a valid ID while out of reset, which is not
>> guaranteed. phy_remove() asserts the reset and phy_probe() deasserts
>> it, but probing only happens once a driver has matched. Rebinding the
>> driver, for instance by reloading the module, therefore reads the ID of
>> a PHY held in reset. This fails to match, leaving the PHY in reset with
>> no driver bound, which cannot be recovered without a power cycle.
>
> We don't do fun and games like this. We just require the compatible in
> DT contains the ID, if the ID cannot be reliably read from the device.
Ack, will drop this patch.
Thanks,
Cristian
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 10/14] net: phy: as21xxx: Fix LED hw control set for unsupported rules
2026-11-30 11:29 ` Cristian Ciocaltea
@ 2026-11-30 13:37 ` Andrew Lunn
0 siblings, 0 replies; 47+ messages in thread
From: Andrew Lunn @ 2026-11-30 13:37 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
On Mon, Nov 30, 2026 at 01:29:45PM +0200, Cristian Ciocaltea wrote:
> On 11/30/26 5:01 AM, Andrew Lunn wrote:
> >> + if (i == ARRAY_SIZE(as21xxx_led_supported_pattern))
> >> + return -EOPNOTSUPP;
> >> +
> >> return phy_modify_mmd(phydev, MDIO_MMD_VEND1,
> >> VEND1_LED_REG(index),
> >> VEND1_LED_REG_A_EVENT,
> >
> > This works, but maybe:
> >
> > for (i = 0; i < ARRAY_SIZE(as21xxx_led_supported_pattern); i++)
> > if (rules == as21xxx_led_supported_pattern[i].pattern) {
> > val = as21xxx_led_supported_pattern[i].val;
> > return phy_modify_mmd(phydev, MDIO_MMD_VEND1,
> > VEND1_LED_REG(index),
> > VEND1_LED_REG_A_EVENT,
> > FIELD_PREP(VEND1_LED_REG_A_EVENT,
> > val));
> >
> > }
> >
> > return -EOPNOTSUPP
> > }
>
> On upcoming Gen2 PHY the LEDs are meant to be driven by the firmware via IPC
> rather than by writing the vendor LED registers directly.
Why would a vendor implement an IPC, when MDIO is already an IPC?
It seems to me the quality of design of PHYs has gone down in recent
years.
Anyway...
> info = aeon_led_find_pattern(phydev, rules);
> if (!info)
> return -EOPNOTSUPP;
>
> return data->led_ops->set_event(phydev, index, info->val);
This is fine. I just did not like the:
if (i == ARRAY_SIZE(as21xxx_led_supported_pattern))
but that seems to be going away.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 11/14] net: phy: as21xxx: Read 10/100/1000 link modes from C22 advertisement
2026-11-30 11:53 ` Cristian Ciocaltea
@ 2026-11-30 13:39 ` Andrew Lunn
0 siblings, 0 replies; 47+ messages in thread
From: Andrew Lunn @ 2026-11-30 13:39 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
> Yeah, the firmware is definitely broken. This is what ethtool currently shows
> for both PHY generations:
>
> Supported link modes: 10baseT/Half 10baseT/Full
> 100baseT/Half 100baseT/Full
> 1000baseT/Half 1000baseT/Full
> 10000baseT/Full
> 2500baseT/Full
> 5000baseT/Full
>
> However, my understanding is that Gen1 doesn't actually support 10baseT, only
> Gen2 does, while 100baseT/Half is never advertised by the firmware. I can go
> with the hard-coded approach, as there doesn't seem to be a better or more
> reliable way to get this information from the hardware.
Yes, hardwired is normal. See the mess aquantia made with their PHY as
an example.
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 13/14] net: phy: as21xxx: Fix speed and duplex reporting
2026-11-30 12:21 ` Cristian Ciocaltea
@ 2026-11-30 14:01 ` Andrew Lunn
0 siblings, 0 replies; 47+ messages in thread
From: Andrew Lunn @ 2026-11-30 14:01 UTC (permalink / raw)
To: Cristian Ciocaltea
Cc: Christian Marangi, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, netdev
On Mon, Nov 30, 2026 at 02:21:12PM +0200, Cristian Ciocaltea wrote:
> On 11/30/26 5:50 AM, Andrew Lunn wrote:
> > On Mon, Nov 30, 2026 at 02:55:20AM +0200, Cristian Ciocaltea wrote:
> >> With autoneg enabled, as21xxx_read_status() derives the result purely in
> >> software via phy_resolve_aneg_linkmode(). That does not work reliably
> >> here: the advertisement is driven by the firmware over IPC, which
> >> ignores the Clause 45 AN registers phylib writes except for the maximum
> >> speed, and arbitrary subsets of speeds are not supported.
> >
> > So the firmware is totally FUBAR?
> >
> > So autoneg does not work, other than for a single link mode? This
> > suggests you are setting phydev->supported wrongly. It should have a
> > single link mode in it, the top speed the PHY supports.
> >
> > phylib should then do the correct thing, it will only let the user
> > select that one link mode for advertisement.
>
> As previously discussed, the root cause of all this unexpected behavior is the
> firmware limitation: it cannot handle arbitrary subsets of speeds and always
> advertises the full range, from the minimum supported speed up to the top one
> (the only limit that can be enforced).
>
> aeon$ ethtool -s eth1 autoneg on advertise 0x800000000000 # 2.5G
>
> peer$ ethtool enp0s13f0u1
> Link partner advertised link modes: 100baseT/Full
> 1000baseT/Full
> 2500baseT/Full
What happens if you return -EOPNOTSUPP here? Does it make it back to
userspace?
I don't think it is guaranteed to. This is probably the first PHY
which is broken like this, all other vendors are capable of reading
802.3. So we don't have support in phylib for this sort of brokenness.
Maybe add a new op to struct phy_device:
/**
* @validate_aneg: Validate that the PHY can actually advertise this valid
* combination of link modes.
* Return 0 if it can, -EOPNOTSUPP if the PHY is broken and cannot.
*/
int (validate_aneg)(struct phy_device *phydev, unsigned long *advertisement);
Call it in phy_ethtool_ksettings_set() when not NULL.
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 05/14] net: phy: as21xxx: Correct the 10M speed status value
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
1 sibling, 0 replies; 47+ messages in thread
From: netdev-bot+sashiko @ 2026-12-01 1:50 UTC (permalink / raw)
To: cristian.ciocaltea
Cc: ansuelsmth, andrew, hkallweit1, linux, davem, edumazet, kuba,
pabeni, kernel, netdev
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
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 06/14] net: phy: as21xxx: Do not write the IPC reply to a NULL buffer
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-12-01 1:50 ` netdev-bot+sashiko
1 sibling, 0 replies; 47+ messages in thread
From: netdev-bot+sashiko @ 2026-12-01 1:50 UTC (permalink / raw)
To: cristian.ciocaltea
Cc: ansuelsmth, andrew, hkallweit1, linux, davem, edumazet, kuba,
pabeni, kernel, netdev
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message describes the NULL write in
aeon_ipc_send_msg() as hypothetical: "A caller supplying a payload but…
- [Low] The comment above aeon_ipc_send_msg()
(drivers/net/phy/as21xxx.c:453-456) still bases the return value on…
--
net: phy: as21xxx: Do not write the IPC reply to a NULL buffer
This commit changes aeon_ipc_send_msg() to decide whether to read the IPC
reply based on ret_data instead of data. This avoids writing the reply
through a NULL buffer. It also rejects a NULL data pointer with a non-zero
data_len when the function is entered.
> aeon_ipc_send_msg() intends to skip reading the IPC reply when the
> caller passes no buffer for it, but the check tests the input buffer
> (data) rather than the output buffer (ret_data). A caller supplying
> a payload but a NULL ret_data would have the reply written through a
> NULL pointer.
[Severity: Low]
This isn't a bug, but the description makes this case sound hypothetical.
Doesn't an in-tree caller already hit it on every probe?
drivers/net/phy/as21xxx.c:aeon_dpc_ra_enable() {
...
return aeon_ipc_send_msg(phydev, IPC_CMD_CFG_PARAM, data,
sizeof(data), NULL);
}
and as21xxx_probe() ends with:
return aeon_dpc_ra_enable(phydev);
So as21xxx_probe()->aeon_dpc_ra_enable()->aeon_ipc_send_msg() passes a
non-NULL data and a NULL ret_data. The old "if (!data)" check does not
fire for this call. If the firmware reports a non-zero AEON_IPC_STS_SIZE
for CFG_PARAM, the reply loop does ret_data[i] = ret through NULL during
probe.
The guard and this caller both came in with 830877d89edc, so the Fixes
tag looks right.
The commit message also leaves out a behaviour change. Before this patch,
a reply size above AEON_IPC_DATA_MAX made aeon_dpc_ra_enable() return
-EINVAL, so probe failed. With this patch, the size is not checked when
ret_data is NULL, so probe succeeds.
Could the commit message name aeon_dpc_ra_enable() as the affected
probe-time caller and mention this change, to help stable backporters?
> diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
> index 8d46fdfc279a7..592b4b7a78692 100644
> --- a/drivers/net/phy/as21xxx.c
> +++ b/drivers/net/phy/as21xxx.c
[ ... ]
> @@ -486,14 +489,14 @@ static int aeon_ipc_send_msg(struct phy_device *phydev,
> goto out;
> }
>
> - if (!data)
> - goto out;
> -
> if ((ret_sts & AEON_IPC_STS_STATUS) == AEON_IPC_STS_STATUS_ERROR) {
> ret = -EINVAL;
> goto out;
> }
>
> + if (!ret_data)
> + goto out;
> +
[Severity: Low]
Should the comment above aeon_ipc_send_msg() be updated as well? It still
bases the return value on data:
/* If data is NULL, return 0 or negative error.
* If data not NULL, return number of Bytes received from IPC or
* a negative error.
*/
After this change, a call with a non-NULL data and a NULL ret_data returns
0 on success, not a byte count.
aeon_dpc_ra_enable() is one such caller. Later in the series, "net: phy:
as21xxx: Configure autoneg advertisement via IPC" adds two CFG_PARAM/CU_AN
helpers that make the same kind of call. All three return the result
directly and rely on 0 meaning success.
The comment is still unchanged at the end of the series. Could it refer to
ret_data instead?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc%40collabora.com
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 07/14] net: phy: as21xxx: Write IPC payload under ipc_lock
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-12-01 1:50 ` netdev-bot+sashiko
1 sibling, 0 replies; 47+ messages in thread
From: netdev-bot+sashiko @ 2026-12-01 1:50 UTC (permalink / raw)
To: cristian.ciocaltea
Cc: ansuelsmth, andrew, hkallweit1, linux, davem, edumazet, kuba,
pabeni, kernel, netdev
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message describes a race that cannot happen on any
current path.
--
net: phy: as21xxx: Write IPC payload under ipc_lock
This patch moves mutex_lock(&priv->ipc_lock) in aeon_ipc_send_msg() above
the loop that writes the VEND1_IPC_DATA registers. The payload writes and
the command issue are then covered by the same critical section. The
argument checks stay outside the lock.
> aeon_ipc_send_msg() writes the message payload to the shared
> VEND1_IPC_DATA registers before taking ipc_lock. Two concurrent
> senders may interleave, so that one overwrites the payload of the
> other before the corresponding command is issued. The firmware would
> then execute a command with the wrong arguments.
[ ... ]
> Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
[Severity: Low]
Can two senders actually overlap on any current path?
In drivers/net/phy/as21xxx.c, aeon_ipc_send_msg() has only two callers:
aeon_ipc_get_fw_version() and aeon_dpc_ra_enable(). as21xxx_probe() calls
them one after the other, on the same thread:
as21xxx_probe() {
...
ret = aeon_ipc_get_fw_version(phydev);
...
return aeon_dpc_ra_enable(phydev);
}
That same probe allocates priv and priv->ipc_lock for each phydev, and the
driver core serializes probe of a device.
The only other IPC user is as21xxx_match_phy_device(). It uses its own
temporary priv and mutex, sends only zero-length NOOPs and never writes
VEND1_IPC_DATA. It also runs before probe.
The later patch in this series, "net: phy: as21xxx: Configure autoneg
advertisement via IPC", adds runtime senders from as21xxx_config_aneg():
aeon_set_top_speed() and aeon_restart_aneg(). Those paths already hold
phydev->lock:
- _phy_start_aneg() has lockdep_assert_held(&phydev->lock).
- phy_speed_down() and phy_speed_up() take phydev->lock around
phy_config_aneg().
The code change looks fine as hardening, because the lock now covers the
whole transaction.
Could the commit message describe this as hardening, or as preparation for
future runtime IPC users, rather than as a fix for a firmware
misconfiguration that can't currently happen?
Should the Fixes: tag also be dropped, so this isn't picked up for net and
stable as a bug fix?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc%40collabora.com
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 09/14] net: phy: as21xxx: Reject odd IPC payload lengths
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
1 sibling, 0 replies; 47+ messages in thread
From: netdev-bot+sashiko @ 2026-12-01 1:50 UTC (permalink / raw)
To: cristian.ciocaltea
Cc: ansuelsmth, andrew, hkallweit1, linux, davem, edumazet, kuba,
pabeni, kernel, netdev
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message and its `Fixes: 830877d89edc` tag present this
patch as a fix for a live defect: an odd `data_len` drops the last…
--
net: phy: as21xxx: Reject odd IPC payload lengths
This patch adds a check to aeon_ipc_send_msg() that rejects payload
lengths that are not a multiple of the 16-bit IPC data register width.
The commit message says an odd length drops the last byte and that the
firmware then reads stale register contents. The patch carries a Fixes:
tag for the original driver commit.
> The IPC payload is transferred through 16-bit data registers, but
> aeon_ipc_send_msg() advertises data_len bytes to the firmware while
> writing only data_len / 2 registers. For an odd length the last byte is
> silently dropped, and the firmware reads whatever was left in the next
> register.
>
> Reject payload lengths that are not a multiple of the register width.
>
> Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
[Severity: Low]
Can any in-tree caller actually pass an odd data_len to
aeon_ipc_send_msg()?
The function is static in drivers/net/phy/as21xxx.c. Every caller passes
sizeof() of a local u16 array, so data_len is always even:
drivers/net/phy/as21xxx.c:aeon_ipc_get_fw_version() {
u16 ret_data[AEON_IPC_DATA_NUM_REGISTERS], data[1];
...
ret = aeon_ipc_send_msg(phydev, IPC_CMD_INFO, data,
sizeof(data), ret_data);
...
}
drivers/net/phy/as21xxx.c:aeon_dpc_ra_enable() {
u16 data[2];
...
return aeon_ipc_send_msg(phydev, IPC_CMD_CFG_PARAM, data,
sizeof(data), NULL);
}
The callers added later in the series also pass even lengths.
aeon_restart_aneg() uses u16 data[3], which is 6 bytes, and
aeon_set_top_speed() uses u16 data[4], which is 8 bytes.
So the new check never fires on any current path. It looks like
hardening against future misuse rather than a fix for a reachable bug.
Could the commit message say that no existing caller is affected? Should
the Fixes: tag be dropped so this isn't picked up for stable as a bug
fix?
The commit message also doesn't say why odd lengths are rejected instead
of rounded up. The receive path in the same function accepts an odd byte
count and rounds up:
for (i = 0; i < DIV_ROUND_UP(ret_size, sizeof(u16)); i++) {
Could the commit message explain why the send side rejects odd lengths
instead?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc%40collabora.com
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 10/14] net: phy: as21xxx: Fix LED hw control set for unsupported rules
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-12-01 1:50 ` netdev-bot+sashiko
1 sibling, 0 replies; 47+ messages in thread
From: netdev-bot+sashiko @ 2026-12-01 1:50 UTC (permalink / raw)
To: cristian.ciocaltea
Cc: ansuelsmth, andrew, hkallweit1, linux, davem, edumazet, kuba,
pabeni, kernel, netdev
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The code fix in as21xxx_led_hw_control_set()
(drivers/net/phy/as21xxx.c) is correct.
--
net: phy: as21xxx: Fix LED hw control set for unsupported rules
With this patch, as21xxx_led_hw_control_set() returns -EOPNOTSUPP when
the requested rules match no entry in as21xxx_led_supported_pattern.
Before, it wrote event 0 to the LED register and returned success. The
patch also drops the zero initialization of val, which is no longer
needed.
> as21xxx_led_hw_control_set() looks up the requested rules in
> as21xxx_led_supported_pattern, but does not check whether a match was
> found. If the rules are not in the table, val keeps its initial value
> of 0, so phy_modify_mmd() still gets called, overwriting the current LED
> configuration with event 0, and the function returns success.
[Severity: Low]
The code change looks correct. Could the commit message also say how an
unsupported rule set reaches this callback, and what the user sees?
The only in-tree caller of hw_control_set() is set_baseline_state() in
drivers/leds/trigger/ledtrig-netdev.c. The usual ways into it are
netdev_led_attr_store() and NETDEV_UP. Both go through can_hw_control(),
which calls hw_control_is_supported() first. as21xxx_led_hw_is_supported()
checks the same as21xxx_led_supported_pattern table, so from the message
alone the bug can look unreachable.
It can be reached through netdev_trig_activate():
drivers/leds/trigger/ledtrig-netdev.c:netdev_trig_activate() {
...
trigger_data->hw_control = true;
set_device_name(trigger_data, name, strlen(name));
rc = led_cdev->hw_control_get(led_cdev, &mode);
if (!rc)
trigger_data->mode = mode;
...
}
as21xxx_led_hw_control_get() returns -EINVAL when the A_EVENT field holds
a value that is not in the table. as21xxx_led_brightness_set() writes two
such values: VEND1_LED_REG_A_EVENT_ON and VEND1_LED_REG_A_EVENT_OFF.
One way to trigger this is to set the trigger to none, which turns the
LED off and writes OFF, and then set it back to netdev. After that,
hw_control is true but trigger_data->mode is still 0.
Any later NETDEV_CHANGE, NETDEV_DOWN or NETDEV_CHANGENAME event, or a
write to device_name, then calls hw_control_set() with rules == 0:
drivers/leds/trigger/ledtrig-netdev.c:set_baseline_state() {
...
if (trigger_data->hw_control) {
led_cdev->hw_control_set(led_cdev, trigger_data->mode);
return;
}
...
}
Before this patch that wrote event 0, which is VEND1_LED_REG_A_EVENT_ON_10.
The LED was silently reprogrammed to "on at 10M link".
set_baseline_state() also ignores the return value, so the caller never
sees the new -EOPNOTSUPP. In practice, the fix just stops the register
from being overwritten.
Would it help reviewers and stable backporters if the commit message
described this path and the "on at 10M link" symptom?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc%40collabora.com
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 11/14] net: phy: as21xxx: Read 10/100/1000 link modes from C22 advertisement
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-12-01 1:50 ` netdev-bot+sashiko
1 sibling, 0 replies; 47+ messages in thread
From: netdev-bot+sashiko @ 2026-12-01 1:50 UTC (permalink / raw)
To: cristian.ciocaltea
Cc: ansuelsmth, andrew, hkallweit1, linux, davem, edumazet, kuba,
pabeni, kernel, netdev
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 0 · 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).
- [High] The commit message promises something the code does not deliver:
"The PHY is reset when the driver is unbound, so it reports the…
- [Low] as21xxx_get_features() falls back to the C45-derived modes when
either register lacks the relevant bits: `!(adv & ADVERTISE_ALL) ||…
--
net: phy: as21xxx: Read 10/100/1000 link modes from C22 advertisement
This adds an as21xxx_get_features() callback. It reads the 2.5G, 5G and
10G abilities from the Clause 45 registers, then takes the 10/100/1000
link modes from the C22 ADVERTISE and CTRL1000 registers mapped in the AN
MMD. If those registers do not have the expected bits set, the Clause 45
derived modes are kept.
> diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
> index 1c4a808bf01e9..3423448a0cb1c 100644
> --- a/drivers/net/phy/as21xxx.c
> +++ b/drivers/net/phy/as21xxx.c
> @@ -644,6 +644,61 @@ static int as21xxx_probe(struct phy_device *phydev)
> return aeon_dpc_ra_enable(phydev);
> }
>
> +static int as21xxx_get_features(struct phy_device *phydev)
> +{
> + int ret, adv, ctrl1000;
> +
[ ... ]
> + adv = phy_read_mmd(phydev, MDIO_MMD_AN,
> + AS21XXX_MDIO_AN_C22 + MII_ADVERTISE);
> + if (adv < 0)
> + return adv;
> +
> + ctrl1000 = phy_read_mmd(phydev, MDIO_MMD_AN,
> + AS21XXX_MDIO_AN_C22 + MII_CTRL1000);
> + if (ctrl1000 < 0)
> + return ctrl1000;
[Severity: High]
Does this always sample the firmware defaults? The commit message says:
The PHY is reset when the driver is unbound, so it reports the generic
pre-firmware ID again and the firmware is reloaded from
.match_phy_device() before the next probe.
Hence .get_features() always samples the firmware defaults.
as21xxx has no .remove or .soft_reset callback. The only reset on unbind
is the one in phy_remove():
drivers/net/phy/phy_device.c:phy_remove() {
...
/* Assert the reset signal */
phy_device_reset(phydev, 1);
...
}
That call ends in mdio_device_reset(), which returns immediately when the
board describes no reset line:
drivers/net/phy/mdio_device.c:mdio_device_reset() {
...
if (!mdiodev->reset_gpio && !mdiodev->reset_ctrl)
return;
...
}
On those boards the firmware keeps running across a sysfs unbind/bind or
a module reload. On rebind, as21xxx_match_phy_device() reads the
post-firmware ID and returns early without reloading the firmware:
if (phy_id != PHY_ID_AS21XXX)
return phy_id == phydrv->phy_id;
as21xxx_get_features() then reads ADVERTISE and CTRL1000 in whatever
state the previous session left them. The commit message itself says
these registers mirror the current advertisement.
The later patch in this series, "net: phy: as21xxx: Configure autoneg
advertisement via IPC", changes that advertisement through
aeon_set_top_speed(). Suppose the previous session limited it to 100M,
for example with "ethtool -s ethX advertise 100baseT/Full", which selects
IPC_CU_AN_TOP_SPD_100. CTRL1000 then reads back with no 1000 bits and the
fallback below is taken. That leaves 10baseT/Half and 100baseT/Half set
in phydev->supported again.
Doesn't that bring back the problem this patch is meant to fix? In the
final series, as21xxx_resolve_duplex() uses those Half bits to report
DUPLEX_HALF on parallel detection.
The same thing can happen if a bootloader loaded the firmware and changed
the advertisement before Linux probes.
Boards with a reset line have a separate problem at this commit: match
runs while the PHY is still held in reset, because phy_probe() deasserts
reset only after the bus match. The last patch in the series, "net: phy:
as21xxx: Release reset before reading ID in match", fixes that case. Its
own commit message says the deassert "does nothing when the PHY has no
reset described", though, so the case without a reset line is still open
at the end of the series.
Could the default top speed be restored before these registers are read?
Alternatively, the firmware could be reset or reloaded on unbind, or the
modes could come from a fixed capability source. Either way, the commit
message would need to be corrected.
> +
> + /* If the firmware defaults are not available, keep the C45-derived
> + * modes rather than dropping all 10/100/1000 link modes.
> + */
> + if (!(adv & ADVERTISE_ALL) ||
> + !(ctrl1000 & (ADVERTISE_1000HALF | ADVERTISE_1000FULL))) {
> + phydev_warn(phydev,
> + "Empty C22 advertisement, using C45 abilities\n");
> + return 0;
> + }
[Severity: Low]
This isn't a bug, but the check here ORs the two registers, while the
commit message says the fallback happens only "If the advertisement
reads back empty".
Take the case where ADVERTISE has valid 10/100 bits but CTRL1000 has no
1000 bits, which is the state an advertisement limited to 100M leaves
behind. The advertisement is not empty. Even so, the valid 10/100 data is
thrown away, the C45 modes with both duplexes are kept, and the warning
says "Empty C22 advertisement".
Could the two registers be handled separately, with ADVERTISE used for
10/100 and C45 or CTRL1000 used for 1G? If not, could the commit message
and the warning text describe the condition the code actually checks?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc%40collabora.com
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 12/14] net: phy: as21xxx: Configure autoneg advertisement via IPC
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-12-01 1:50 ` netdev-bot+sashiko
1 sibling, 0 replies; 47+ messages in thread
From: netdev-bot+sashiko @ 2026-12-01 1:50 UTC (permalink / raw)
To: cristian.ciocaltea
Cc: ansuelsmth, andrew, hkallweit1, linux, davem, edumazet, kuba,
pabeni, kernel, netdev
Thank you for your contribution! Sashiko AI review found 4 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 3 · 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] as21xxx_config_aneg() (drivers/net/phy/as21xxx.c, from line
914) is now the driver's .config_aneg, so phy_config_aneg()…
- [Medium] In as21xxx_config_aneg() (drivers/net/phy/as21xxx.c),
aeon_set_top_speed() (line 970) changes the firmware's top speed…
- [Medium] The commit message says the IPC top-speed command makes the
firmware advertise 'every slower speed the PHY supports', and that the…
- [Low] Both the comment in as21xxx_config_init()
(drivers/net/phy/as21xxx.c line 906-909) and the commit message say…
--
net: phy: as21xxx: Configure autoneg advertisement via IPC
This adds a .config_aneg callback for the AS21xxx PHYs. It sends the
highest advertised BASE-T speed to the firmware over IPC instead of using
genphy_c45_config_aneg(). The top speed is cached so autoneg only restarts
when it changes, and the slower speeds that the firmware advertises along
with it are added to phydev->advertising.
> diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
> index 3423448a0cb1c..967ff3020814e 100644
> --- a/drivers/net/phy/as21xxx.c
> +++ b/drivers/net/phy/as21xxx.c
[ ... ]
> +static int as21xxx_config_init(struct phy_device *phydev)
> +{
> + struct as21xxx_priv *priv = phydev->priv;
> +
> + /* The firmware might have lost the top speed, e.g. across a
> + * suspend/resume cycle, make sure the next .config_aneg sends it.
> + */
> + priv->top_spd = 0;
[Severity: Low]
Does this cover suspend/resume on systems where the MAC manages PM?
On resume, .config_init is only reached through mdio_bus_phy_resume() ->
phy_init_hw(), and mdio_bus_phy_resume() returns early:
drivers/net/phy/phy_device.c:mdio_bus_phy_resume() {
...
if (phydev->mac_managed_pm)
return 0;
...
}
phylink_bringup_phy() sets phy->mac_managed_pm when the MAC config asks
for it, and stmmac always asks. Neither phylink_resume() nor the stmmac
resume path calls phy_init_hw(), so priv->top_spd survives resume on those
systems.
If the firmware really did forget the top speed, the next
as21xxx_config_aneg() would take the top_spd == priv->top_spd early return
and not resend it.
Would clearing the cache from a .suspend or .resume callback cover both PM
models? As written, the comment and the commit message seem to promise
more than the code does.
> +
> + return 0;
> +}
[ ... ]
> + top_spd = aeon_top_speeds[i].top_spd;
> +
> + /* Let the advertisement reflect the slower speeds which go on the
> + * wire along with the highest one.
> + */
> + for (i = 0; i < ARRAY_SIZE(aeon_top_speeds); i++)
> + if (aeon_top_speeds[i].top_spd <= top_spd &&
> + linkmode_test_bit(aeon_top_speeds[i].linkmode,
> + phydev->supported))
> + linkmode_set_bit(aeon_top_speeds[i].linkmode,
> + phydev->advertising);
[Severity: Medium]
Can phydev->advertising still differ from what is on the wire?
The commit message says the firmware advertises "every slower speed the
PHY supports". It also says this loop makes phydev->advertising "reflect
what is actually advertised on the wire". But the loop filters on
phydev->supported, and MAC drivers can make that narrower than what the
firmware advertises.
Several non-phylink MAC drivers (ravb, rswitch, rtsn, tsnep, xgene, icssg
and others) call phy_remove_link_mode() to drop half duplex or 10M modes.
phy_set_max_speed() also narrows supported. The IPC can't describe a
subset, so the firmware still advertises those modes, but they never
appear in phydev->advertising.
Phylink MACs are not affected this way, because phylink_bringup_phy()
narrows phy->advertising rather than phy->supported.
The later patch "net: phy: as21xxx: Fix speed and duplex reporting" relies
on this claim. Its as21xxx_resolve_duplex() ANDs lp_advertising with
phydev->advertising.
Suppose the MAC removed 100baseT_Half and the link comes up at 100M with a
half-only partner. No duplex bit is common, so this fallback runs:
phydev->duplex = phydev->speed != SPEED_1000 &&
linkmode_test_bit(half, phydev->supported) ?
DUPLEX_HALF : DUPLEX_FULL;
Wouldn't that report DUPLEX_FULL and configure the MAC for full duplex
while the wire runs half duplex?
> +
> + /* Restarting autoneg takes the link down, so only do it when the
> + * advertisement changed, or has to be sent again.
> + */
> + if (top_spd == priv->top_spd)
> + return 0;
[Severity: Medium]
Now that .config_aneg is set, phy_config_aneg() no longer calls
genphy_c45_config_aneg() for these PHYs. Does that drop the EEE and pause
advertisement writes?
The generic path wrote them from genphy_c45_an_config_aneg():
ret = genphy_c45_an_config_eee_aneg(phydev);
...
ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_ADVERTISE,
ADVERTISE_ALL | ADVERTISE_100BASE4 |
ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM, adv);
It also ran genphy_c45_an_setup_master_slave(), which is now skipped as
well.
Phylib still tracks this state in software:
- phy_probe() trims advertising_eee by supported_eee and by the DT
eee-broken-* modes.
- phy_disable_eee() zeroes advertising_eee. It is used for MACs without
LPI support, including phylink's mac_supports_eee_ops path:
linkmode_zero(phydev->advertising_eee);
phydev->eee_cfg.tx_lpi_enabled = false;
phydev->eee_cfg.eee_enabled = false;
Both depend on config_aneg to push the state to the hardware. After this
patch, the only code that writes MDIO_AN_EEE_ADV is
genphy_c45_ethtool_set_eee(), and that only runs on an explicit ethtool
--set-eee.
Could MDIO_AN_EEE_ADV keep the firmware default at bring-up even when
phylib thinks EEE is disabled?
Pause changes look affected too. phy_set_asym_pause() does:
linkmode_set_pause(phydev->advertising, tx, rx);
if (!linkmode_equal(oldadv, phydev->advertising) &&
phydev->autoneg)
phy_start_aneg(phydev);
as21xxx_config_aneg() never writes the pause bits. Since the BASE-T top
speed hasn't changed, it returns 0 at the check above and autoneg is not
restarted. phydev->advertising then shows a pause advertisement that the
hardware may not be sending.
The commit message only says the C45 AN registers aren't "properly"
supported, and all its examples are about speed bits. Does the firmware
also ignore MDIO_AN_EEE_ADV and the pause bits in MDIO_AN_ADVERTISE? If
not, should this function still write them?
> +
> + ret = aeon_set_top_speed(phydev, top_spd);
> + if (ret)
> + return ret;
> +
> + if (!priv->top_spd) {
> + /* genphy_c45_pma_setup_forced() clears MDIO_AN_CTRL1_ENABLE,
> + * which restarting autoneg over the IPC doesn't set back.
> + */
> + ret = phy_set_bits_mmd(phydev, MDIO_MMD_AN, MDIO_CTRL1,
> + MDIO_AN_CTRL1_ENABLE);
> + if (ret)
> + return ret;
> + }
> +
> + ret = aeon_restart_aneg(phydev);
> + if (ret)
> + return ret;
> +
> + priv->top_spd = top_spd;
[Severity: Medium]
Can priv->top_spd go stale if aeon_restart_aneg() fails?
By this point aeon_set_top_speed() has already changed the firmware's top
speed. The error return leaves priv->top_spd at the old non-zero value,
although the struct comment defines it as the "Top speed last handed to
the firmware, 0 when it has to be sent again".
For example, take a cache value of IPC_CU_AN_TOP_SPD_2500:
1. A 10G request sends IPC_CU_AN_TOP_SPD_10000.
2. aeon_restart_aneg() fails with an IPC error status or an MDIO error.
3. phy_ethtool_ksettings_set() ignores the _phy_start_aneg() error when
the PHY isn't started.
4. The user goes back to 2500. The top_spd == priv->top_spd check
matches, so nothing is sent.
The firmware keeps the 10000 top speed and uses it at the next
renegotiation that the driver doesn't trigger, such as a cable replug or
a partner restart. Meanwhile phydev->advertising and the cache both say
2500.
The phy_set_bits_mmd() error path is only taken while priv->top_spd is
already 0, so it still gets resent.
Should priv->top_spd be reset to 0 on any error after aeon_set_top_speed()
succeeds?
> +
> + return 0;
> +}
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc%40collabora.com
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 13/14] net: phy: as21xxx: Fix speed and duplex reporting
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-12-01 1:51 ` netdev-bot+sashiko
1 sibling, 0 replies; 47+ messages in thread
From: netdev-bot+sashiko @ 2026-12-01 1:51 UTC (permalink / raw)
To: cristian.ciocaltea
Cc: ansuelsmth, andrew, hkallweit1, linux, davem, edumazet, kuba,
pabeni, kernel, netdev
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 0 · Low: 2
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).
- [High] Forced mode: as21xxx_read_status() can still leave phydev->speed
= SPEED_UNKNOWN, which is the failure this patch says it removes.
- [Low] The LPA_1000MSFAIL check in as21xxx_read_lpa() now only runs once
the link is up: as21xxx_read_status() returns early at 'if…
- [Low] The commit message justifies the duplex resolution with 'Since
aeon_config_aneg() makes phydev->advertising reflect what the firmware…
--
net: phy: as21xxx: Fix speed and duplex reporting
With autoneg enabled, this patch takes the speed from VEND1_SPEED_STATUS
instead of resolving the advertisements. Duplex and pause are then
resolved from the link partner abilities, which are read from the mapped
C22 registers and the 10GBASE-T status register. With autoneg disabled,
it reports the PMA-programmed settings via genphy_c45_read_pma(), and
overrides the speed from VEND1_SPEED_STATUS once the link is up.
> Use VEND1_SPEED_STATUS, the authoritative source, on the autoneg path
> too. Since aeon_config_aneg() makes phydev->advertising reflect what
> the firmware puts on the wire, it is still reliable for picking the
> duplex mode at that speed: resolve duplex from the link partner
[Severity: Low]
There is no aeon_config_aneg() in drivers/net/phy/as21xxx.c. Should this
be as21xxx_config_aneg()?
That function and its advertising expansion ("Let the advertisement
reflect the slower speeds which go on the wire along with the highest
one") come from the preceding patch, "net: phy: as21xxx: Configure
autoneg advertisement via IPC". The baseline driver has no config_aneg
callback at all.
Both patches carry only the Fixes: 830877d89edc tag, with no dependency
note. If this patch is backported alone, as21xxx_resolve_duplex() would
run this line without the implicitly advertised slower modes in
phydev->advertising:
linkmode_and(common, phydev->lp_advertising, phydev->advertising);
Could a partner that negotiated full duplex below the advertised maximum
speed then fall into the parallel detection fallback and be reported as
half duplex?
Would it be worth stating the dependency for stable?
> diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
> index 967ff3020814e..5eea6baa75bfc 100644
> --- a/drivers/net/phy/as21xxx.c
> +++ b/drivers/net/phy/as21xxx.c
[ ... ]
> @@ -781,15 +781,107 @@ static int as21xxx_read_c22_lpa(struct phy_device *phydev)
[ ... ]
> +static int as21xxx_read_speed(struct phy_device *phydev)
> +{
> + int val;
> +
> + val = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_SPEED_STATUS);
> + if (val < 0)
> + return val;
> +
> + switch (val & VEND1_SPEED_MASK) {
[ ... ]
> + default:
> + dev_warn_once(&phydev->mdio.dev,
> + "Unknown speed status 0x%04x\n", val);
> + phydev->speed = SPEED_UNKNOWN;
> + break;
> + }
> +
> + return 0;
> +}
[ ... ]
> @@ -797,64 +889,54 @@ static int as21xxx_read_status(struct phy_device *phydev)
> if (phydev->autoneg == AUTONEG_ENABLE && old_link && phydev->link)
> return 0;
>
> - phydev->speed = SPEED_UNKNOWN;
> - phydev->duplex = DUPLEX_UNKNOWN;
> phydev->pause = 0;
> phydev->asym_pause = 0;
>
> - if (phydev->autoneg == AUTONEG_ENABLE) {
> - ret = genphy_c45_read_lpa(phydev);
> + if (phydev->autoneg == AUTONEG_DISABLE) {
> + ret = genphy_c45_read_pma(phydev);
> if (ret)
> return ret;
>
> - ret = as21xxx_read_c22_lpa(phydev);
> - if (ret)
> - return ret;
> + if (phydev->link) {
> + ret = as21xxx_read_speed(phydev);
>
> - phy_resolve_aneg_linkmode(phydev);
> - } else {
> - int speed;
> + /* Hold the link down until the speed status settles */
> + if (!ret && phydev->speed == SPEED_UNKNOWN)
> + phydev->link = 0;
> + }
[Severity: High]
Can this branch still leave phydev->speed set to SPEED_UNKNOWN in forced
mode?
genphy_c45_read_pma() sets phydev->speed from PMA CTRL1, which holds the
forced speed the user configured. If the link bit is up while
VEND1_SPEED_STATUS reads an unrecognised code, the default case in
as21xxx_read_speed() overwrites phydev->speed with SPEED_UNKNOWN. Only the
link is held down, and the PMA speed is not restored.
In forced mode, phydev->speed is also the configuration. PHY_HALTED does
not reset speed when autoneg is disabled, so if phy_stop() lands in this
window, the next phy_start() goes through:
phy_start()
_phy_start_aneg()
phy_sanitize_settings()
phy_caps_lookup(SPEED_UNKNOWN, DUPLEX_FULL, supported, false)
as21xxx_config_aneg()
genphy_c45_pma_setup_forced()
When speed is -1, phy_caps_lookup() finds no entry with
lcap->speed <= speed and returns the slowest supported capability.
If 10baseT_Half is in phydev->supported, the result is 10/HALF.
genphy_c45_pma_setup_forced() returns -EINVAL for anything other than full
duplex, so the PHY goes to PHY_ERROR, and every later restart retries the
same sanitized setting. If 10baseT_Half is not supported, the slowest full
duplex speed is written into PMA CTRL1 instead, and the forced speed is
lost.
Isn't this the same problem the commit message says is being fixed?
"Otherwise phy_sanitize_settings() sees unknown values on the next
autoneg restart with the link down and falls back to the slowest
mode."
Could as21xxx_read_speed() return the speed in a local variable, or leave
phydev->speed untouched in its default case, so that the PMA-derived
speed is kept?
> - linkmode_zero(phydev->lp_advertising);
> + return ret;
> + }
[ ... ]
> + phydev->speed = SPEED_UNKNOWN;
> + phydev->duplex = DUPLEX_UNKNOWN;
> + linkmode_zero(phydev->lp_advertising);
[ ... ]
> + /* as21xxx_read_link() reports link up only once autoneg completed */
> + if (!phydev->link)
> + return 0;
[Severity: Low]
Because of this early return, as21xxx_read_lpa() is only reached once the
link is up. Before this patch, as21xxx_read_c22_lpa() ran on every
autoneg read_status where the link was not already up, including while
the link was down.
A 1000BASE-T master/slave configuration fault keeps the link down. Does
that mean the LPA_1000MSFAIL check in as21xxx_read_lpa(), and its
"Master/Slave resolution failed" message, are no longer reached in the
case they exist for?
If the check is reached with the link up, for example through a latched
fault bit, it still returns -ENOLINK. That moves the PHY to PHY_ERROR
while the link is actually up.
Should this follow the hold-the-link-down approach used here for an
unrecognised speed status instead?
The commit message says partner abilities are now read only once the
link is up, but it does not mention the lost diagnostic.
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc%40collabora.com
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net 14/14] net: phy: as21xxx: Release reset before reading ID in match
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-12-01 1:51 ` netdev-bot+sashiko
1 sibling, 0 replies; 47+ messages in thread
From: netdev-bot+sashiko @ 2026-12-01 1:51 UTC (permalink / raw)
To: cristian.ciocaltea
Cc: ansuelsmth, andrew, hkallweit1, linux, davem, edumazet, kuba,
pabeni, kernel, netdev
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 (1) · 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] The new phy_device_reset(phydev, 0) call in
as21xxx_match_phy_device() (as21xxx.c:1203) writes the reset line and…
Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but it is a
serious one.
--
net: phy: as21xxx: Release reset before reading ID in match
This patch deasserts the PHY reset in as21xxx_match_phy_device() before
the PHY ID is read from the hardware. Without it, a PHY that phy_remove()
left in reset reports an invalid ID on rebind and never matches. Once out
of reset, the PHY reports the generic ID again and the existing firmware
loading path runs.
> diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
> index 5eea6baa75bfc..761458c606a26 100644
> --- a/drivers/net/phy/as21xxx.c
> +++ b/drivers/net/phy/as21xxx.c
> @@ -1196,6 +1196,12 @@ static int as21xxx_match_phy_device(struct phy_device *phydev,
> PHY_VENDOR_AEONSEMI))
> return genphy_match_phy_device(phydev, phydrv);
>
> + /* phy_remove() leaves the PHY in reset and only phy_probe() releases
> + * it, so release it here to be able to read the ID on rebind. No-op
> + * if there is no reset or it is already released.
> + */
> + phy_device_reset(phydev, 0);
[Severity: High]
This is a pre-existing issue and was not introduced by this patch. The
comment above says "only phy_probe() releases it". Doesn't phy_init_hw()
also release the reset on a PHY that is still bound to the as21xxx driver?
phy_detach() always asserts the reset, but it only releases the driver
when genphy is in use:
drivers/net/phy/phy_device.c:phy_detach() {
...
if (phydev->is_genphy_driven) {
...
device_release_driver(&phydev->mdio.dev);
phydev->is_genphy_driven = 0;
}
/* Assert the reset signal */
phy_device_reset(phydev, 1);
...
}
On the next phy_attach_direct(), the as21xxx driver is still bound, so
neither match nor probe runs. phy_init_hw() then deasserts the reset:
drivers/net/phy/phy_device.c:phy_init_hw() {
...
/* Deassert the reset signal */
phy_device_reset(phydev, 0);
...
}
The commit message says the PHY comes out of reset with its firmware
unloaded. aeon_firmware_load() is only called from
as21xxx_match_phy_device(), and the driver has no .soft_reset.
as21xxx_config_init() only clears priv->top_spd:
drivers/net/phy/as21xxx.c:as21xxx_config_init() {
...
priv->top_spd = 0;
return 0;
}
Would the bound driver then send IPC commands (config_aneg, LEDs and so
on) to a PHY with no firmware running?
In that case aeon_ipc_wait_cmd() would time out, and priv->parity_status
would no longer match the hardware. The IPC parity sync, PTP clock enable
and DPC RA setup done in as21xxx_probe() would also be lost and never set
up again.
A plain ifdown/ifup looks enough to reach this on MACs that connect the
PHY in ndo_open and disconnect it in ndo_stop. stmmac is one example: it
calls stmmac_init_phy() at open and phylink_disconnect_phy() at release.
It needs a board that describes a reset GPIO or reset controller for the
PHY. The match-time deassert added here does not cover that path.
[Severity: Medium]
Can this new call race with other reset writers on the same PHY?
as21xxx_match_phy_device() is called through
__driver_attach()->driver_match_device()->phy_bus_match() before
device_lock is taken.
phy_attach_direct() probes genphy through phy_probe()->phy_device_reset(0),
and phy_detach() asserts the reset. Both run under RTNL only, so nothing
seems to serialize them against the match path.
mdio_device_reset() does an unlocked check-then-act. It only stores
reset_state after it has driven the line and slept:
drivers/net/phy/mdio_device.c:mdio_device_reset() {
...
if (mdiodev->reset_state == value)
return;
if (mdiodev->reset_gpio)
gpiod_set_value_cansleep(mdiodev->reset_gpio, value);
...
d = value ? mdiodev->reset_assert_delay : mdiodev->reset_deassert_delay;
if (d)
fsleep(d);
mdiodev->reset_state = value;
}
Take an unbound PHY held in reset (reset_state == 1). Could this sequence
happen?
match path (modprobe) ifup / ifdown path
mdio_device_reset(0)
GPIO = 0
fsleep()
phy_probe()->mdio_device_reset(0)
GPIO = 0, reset_state = 0
phy_detach()->mdio_device_reset(1)
GPIO = 1, reset_state = 1
reset_state = 0
The line would then be asserted while reset_state says it is released.
Every later phy_device_reset(phydev, 0) from phy_probe(), phy_init_hw() or
this match call would return early.
Wouldn't that leave the PHY stuck in reset, which is the state this patch
is meant to fix?
Before this patch, the match path only did MDIO reads under the bus lock
and never touched reset_state.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc%40collabora.com
^ permalink raw reply [flat|nested] 47+ messages in thread
end of thread, other threads:[~2026-12-01 1:51 UTC | newest]
Thread overview: 47+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox