]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: phy: micrel: fix LAN8814 QSGMII soft reset
authorRobert Marko <robert.marko@sartura.hr>
Tue, 28 Apr 2026 13:41:01 +0000 (15:41 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 30 Apr 2026 23:49:23 +0000 (16:49 -0700)
LAN8814 QSGMII soft reset was moved into the probe function to avoid
triggering it for each of 4 PHY-s in the package.

However, that broke QSGMII link between the MAC and PHY on most LAN8814
PHY-s, specificaly for us on the Microchip LAN969x switch.
Reading the QSGMII status registers it was visible that lanes were only
partially synced.

It looks like the reset timing is crucial, so lets move the reset back
into the .config_init function but guard it with phy_package_init_once()
to avoid it being triggered on each of 4 PHY-s in the package.
Change the probe function to use phy_package_probe_once() for coma and PtP
setup.

Fixes: 96a9178a29a6 ("net: phy: micrel: lan8814 fix reset of the QSGMII interface")
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Link: https://patch.msgid.link/20260428134138.1741253-1-robert.marko@sartura.hr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/micrel.c

index 2aa1dedd21b8eba9320c54e6d55ce1005f6b7706..e211a523c2584eee3e0f9ca6d7e3537a354786aa 100644 (file)
@@ -4548,6 +4548,13 @@ static int lan8814_config_init(struct phy_device *phydev)
        struct kszphy_priv *lan8814 = phydev->priv;
        int ret;
 
+       if (phy_package_init_once(phydev))
+               /* Reset the PHY */
+               lanphy_modify_page_reg(phydev, LAN8814_PAGE_COMMON_REGS,
+                                      LAN8814_QSGMII_SOFT_RESET,
+                                      LAN8814_QSGMII_SOFT_RESET_BIT,
+                                      LAN8814_QSGMII_SOFT_RESET_BIT);
+
        /* Based on the interface type select how the advertise ability is
         * encoded, to set as SGMII or as USGMII.
         */
@@ -4655,13 +4662,7 @@ static int lan8814_probe(struct phy_device *phydev)
        priv->is_ptp_available = err == LAN8814_REV_LAN8814 ||
                                 err == LAN8814_REV_LAN8818;
 
-       if (phy_package_init_once(phydev)) {
-               /* Reset the PHY */
-               lanphy_modify_page_reg(phydev, LAN8814_PAGE_COMMON_REGS,
-                                      LAN8814_QSGMII_SOFT_RESET,
-                                      LAN8814_QSGMII_SOFT_RESET_BIT,
-                                      LAN8814_QSGMII_SOFT_RESET_BIT);
-
+       if (phy_package_probe_once(phydev)) {
                err = lan8814_release_coma_mode(phydev);
                if (err)
                        return err;