OSDN Git Service

net: phy: micrel: Move KSZ9477 errata fixes to PHY driver
authorRobert Hancock <robert.hancock@calian.com>
Mon, 5 Jun 2023 15:39:42 +0000 (09:39 -0600)
committerJakub Kicinski <kuba@kernel.org>
Wed, 7 Jun 2023 04:08:37 +0000 (21:08 -0700)
commit26dd2974c5b5caef358784530c9e72715adc8f5b
tree47d917a22c5456c75d689019b776705e093bc764
parent2dc476404efa8546a08561877e88bfb2006facab
net: phy: micrel: Move KSZ9477 errata fixes to PHY driver

The ksz9477 DSA switch driver is currently updating some MMD registers
on the internal port PHYs to address some chip errata. However, these
errata are really a property of the PHY itself, not the switch they are
part of, so this is kind of a layering violation. It makes more sense for
these writes to be done inside the driver which binds to the PHY and not
the driver for the containing device.

This also addresses some issues where the ordering of when these writes
are done may have been incorrect, causing the link to erratically fail to
come up at the proper speed or at all. Doing this in the PHY driver
during config_init ensures that they happen before anything else tries to
change the state of the PHY on the port.

The new code also ensures that autonegotiation is disabled during the
register writes and re-enabled afterwards, as indicated by the latest
version of the errata documentation from Microchip.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/micrel.c