Skip to content

Aeonsemi driver 1.9.2 in 7.1-rc branch break SFP phy identification #180

Description

@LynxChaus

Aeonsemi driver 1.9.2 unconditionally overwrite phydev->phy_id in aeon_gen2_match_phy_device() and this prevent usage SFP modules with internal phy.

diff --git a/drivers/net/phy/as21xx_1.9.2/as21xxx.c b/drivers/net/phy/as21xx_1.9.2/as21xxx.c
index 2b2a96f1cddc..e1c27210a89b 100644
--- a/drivers/net/phy/as21xx_1.9.2/as21xxx.c
+++ b/drivers/net/phy/as21xx_1.9.2/as21xxx.c
@@ -1494,12 +1494,13 @@ static int aeon_gen2_match_phy_device(struct phy_device *phydev,
 				      const struct phy_driver *phydrv)
 {
 	/* AEONSEMI get pid. */
-	phydev->phy_id = aeon_gen2_read_pid(phydev);
+	u32 phy_id = aeon_gen2_read_pid(phydev);
 
-	if (phydev->phy_id == PHY_ID_AS22XXX)
-		return 1;
+	if (phy_id != PHY_ID_AS22XXX)
+		return 0;
 
-	return 0;
+	phydev->phy_id = phy_id;
+	return 1;
 }
 
 static void aeon_gen1_remove(struct phy_device *phydev)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions