Netdev List
 help / color / mirror / Atom feed
* [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; 35+ 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] 35+ messages in thread

end of thread, other threads:[~2026-11-30 12:22 UTC | newest]

Thread overview: 35+ 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-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-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-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-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  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  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-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  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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox