Skip to content

Commit e49f7cb

Browse files
kolacinskikaroljfvogel
authored andcommitted
ice: Fix E825 initialization
[ Upstream commit d79c304 ] Current implementation checks revision of all PHYs on all PFs, which is incorrect and may result in initialization failure. Check only the revision of the current PHY. Fixes: 7cab44f ("ice: Introduce ETH56G PHY model for E825C products") Reviewed-by: Arkadiusz Kubalewski <[email protected]> Signed-off-by: Karol Kolacinski <[email protected]> Signed-off-by: Grzegorz Nitka <[email protected]> Tested-by: Pucha Himasekhar Reddy <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 605c7381b5d820905850ffd76401f1582dc59837) Signed-off-by: Jack Vogel <[email protected]>
1 parent d831d03 commit e49f7cb

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

drivers/net/ethernet/intel/ice/ice_ptp_hw.c

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2664,14 +2664,15 @@ static bool ice_is_muxed_topo(struct ice_hw *hw)
26642664
}
26652665

26662666
/**
2667-
* ice_ptp_init_phy_e825c - initialize PHY parameters
2667+
* ice_ptp_init_phy_e825 - initialize PHY parameters
26682668
* @hw: pointer to the HW struct
26692669
*/
2670-
static void ice_ptp_init_phy_e825c(struct ice_hw *hw)
2670+
static void ice_ptp_init_phy_e825(struct ice_hw *hw)
26712671
{
26722672
struct ice_ptp_hw *ptp = &hw->ptp;
26732673
struct ice_eth56g_params *params;
2674-
u8 phy;
2674+
u32 phy_rev;
2675+
int err;
26752676

26762677
ptp->phy_model = ICE_PHY_ETH56G;
26772678
params = &ptp->phy.eth56g;
@@ -2685,15 +2686,10 @@ static void ice_ptp_init_phy_e825c(struct ice_hw *hw)
26852686
ptp->num_lports = params->num_phys * ptp->ports_per_phy;
26862687

26872688
ice_sb_access_ena_eth56g(hw, true);
2688-
for (phy = 0; phy < params->num_phys; phy++) {
2689-
u32 phy_rev;
2690-
int err;
2691-
2692-
err = ice_read_phy_eth56g(hw, phy, PHY_REG_REVISION, &phy_rev);
2693-
if (err || phy_rev != PHY_REVISION_ETH56G) {
2694-
ptp->phy_model = ICE_PHY_UNSUP;
2695-
return;
2696-
}
2689+
err = ice_read_phy_eth56g(hw, hw->pf_id, PHY_REG_REVISION, &phy_rev);
2690+
if (err || phy_rev != PHY_REVISION_ETH56G) {
2691+
ptp->phy_model = ICE_PHY_UNSUP;
2692+
return;
26972693
}
26982694

26992695
ptp->is_2x50g_muxed_topo = ice_is_muxed_topo(hw);
@@ -5395,7 +5391,7 @@ void ice_ptp_init_hw(struct ice_hw *hw)
53955391
else if (ice_is_e810(hw))
53965392
ice_ptp_init_phy_e810(ptp);
53975393
else if (ice_is_e825c(hw))
5398-
ice_ptp_init_phy_e825c(hw);
5394+
ice_ptp_init_phy_e825(hw);
53995395
else
54005396
ptp->phy_model = ICE_PHY_UNSUP;
54015397
}

0 commit comments

Comments
 (0)