]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: phy: as21xxx: better handle PHY HW reset on soft-reboot
authorChristian Marangi <ansuelsmth@gmail.com>
Sat, 23 Aug 2025 13:44:29 +0000 (15:44 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 27 Aug 2025 00:09:27 +0000 (17:09 -0700)
commitb4d5cd20507b252c746fa6971d82ac96f3b3e5b7
treee07e39e0965c9653f65059831a640c44ca6a8920
parent1abe21ef1adf0c5b6dbb5878c2fa4573df8d29fc
net: phy: as21xxx: better handle PHY HW reset on soft-reboot

On soft-reboot, with a reset GPIO defined for an Aeonsemi PHY, the
special match_phy_device fails to correctly identify that the PHY
needs to load the firmware again.

This is caused by the fact that PHY ID is read BEFORE the PHY reset
GPIO (if present) is asserted, so we can be in the scenario where the
phydev have the previous PHY ID (with the PHY firmware loaded) but
after reset the generic AS21xxx PHY is present in the PHY ID registers.

To better handle this, skip reading the PHY ID register only for the PHY
that are not AS21xxx (by matching for the Aeonsemi Vendor) and always
read the PHY ID for the other case to handle both firmware already
loaded or an HW reset.

Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Link: https://patch.msgid.link/20250823134431.4854-2-ansuelsmth@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/as21xxx.c