Skip to content

Commit c92621b

Browse files
nbuchwitzpopcornmix
authored andcommitted
net: phy: broadcom: fix BCM54213PE per-PHY init never called
BCM54213PE (PHY_ID = 0x600d84a2) and BCM54210E share the same model ID when masked by PHY_ID_MATCH_MODEL_MASK (0xfffffff0): both reduce to 0x600d84a0. The dispatch switch in bcm54xx_config_init() switches on phydev->drv->phy_id & PHY_ID_MATCH_MODEL_MASK, so the separate case PHY_ID_BCM54213PE: could never match — the expression always evaluated to 0x600d84a0, not 0x600d84a2. bcm54213pe_config_init() was silently never called; BCM54213PE instead fell through to the BCM54210E path. Replace the dead case label with an exact driver ID check inside the BCM54210E case, which already handles the same model ID family. Fixes: 1001c6f ("phy: broadcom: Add bcm54213pe configuration") Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
1 parent 394ae0d commit c92621b

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

drivers/net/phy/broadcom.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -498,14 +498,17 @@ static int bcm54xx_config_init(struct phy_device *phydev)
498498
err = bcm54xx_config_clock_delay(phydev);
499499
break;
500500
case PHY_ID_BCM54210E:
501-
err = bcm54210e_config_init(phydev);
501+
/* BCM54213PE shares the same model ID as BCM54210E; use the
502+
* exact driver ID to dispatch to the right per-PHY init.
503+
*/
504+
if (phydev->drv->phy_id == PHY_ID_BCM54213PE)
505+
err = bcm54213pe_config_init(phydev);
506+
else
507+
err = bcm54210e_config_init(phydev);
502508
break;
503509
case PHY_ID_BCM54612E:
504510
err = bcm54612e_config_init(phydev);
505511
break;
506-
case PHY_ID_BCM54213PE:
507-
err = bcm54213pe_config_init(phydev);
508-
break;
509512
case PHY_ID_BCM54616S:
510513
err = bcm54616s_config_init(phydev);
511514
break;

0 commit comments

Comments
 (0)