Skip to content

Commit d79c304

Browse files
kolacinskikarolanguy11
authored andcommitted
ice: Fix E825 initialization
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]>
1 parent 76201b5 commit d79c304

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
@@ -2687,14 +2687,15 @@ static bool ice_is_muxed_topo(struct ice_hw *hw)
26872687
}
26882688

26892689
/**
2690-
* ice_ptp_init_phy_e825c - initialize PHY parameters
2690+
* ice_ptp_init_phy_e825 - initialize PHY parameters
26912691
* @hw: pointer to the HW struct
26922692
*/
2693-
static void ice_ptp_init_phy_e825c(struct ice_hw *hw)
2693+
static void ice_ptp_init_phy_e825(struct ice_hw *hw)
26942694
{
26952695
struct ice_ptp_hw *ptp = &hw->ptp;
26962696
struct ice_eth56g_params *params;
2697-
u8 phy;
2697+
u32 phy_rev;
2698+
int err;
26982699

26992700
ptp->phy_model = ICE_PHY_ETH56G;
27002701
params = &ptp->phy.eth56g;
@@ -2708,15 +2709,10 @@ static void ice_ptp_init_phy_e825c(struct ice_hw *hw)
27082709
ptp->num_lports = params->num_phys * ptp->ports_per_phy;
27092710

27102711
ice_sb_access_ena_eth56g(hw, true);
2711-
for (phy = 0; phy < params->num_phys; phy++) {
2712-
u32 phy_rev;
2713-
int err;
2714-
2715-
err = ice_read_phy_eth56g(hw, phy, PHY_REG_REVISION, &phy_rev);
2716-
if (err || phy_rev != PHY_REVISION_ETH56G) {
2717-
ptp->phy_model = ICE_PHY_UNSUP;
2718-
return;
2719-
}
2712+
err = ice_read_phy_eth56g(hw, hw->pf_id, PHY_REG_REVISION, &phy_rev);
2713+
if (err || phy_rev != PHY_REVISION_ETH56G) {
2714+
ptp->phy_model = ICE_PHY_UNSUP;
2715+
return;
27202716
}
27212717

27222718
ptp->is_2x50g_muxed_topo = ice_is_muxed_topo(hw);
@@ -5478,7 +5474,7 @@ void ice_ptp_init_hw(struct ice_hw *hw)
54785474
else if (ice_is_e810(hw))
54795475
ice_ptp_init_phy_e810(ptp);
54805476
else if (ice_is_e825c(hw))
5481-
ice_ptp_init_phy_e825c(hw);
5477+
ice_ptp_init_phy_e825(hw);
54825478
else
54835479
ptp->phy_model = ICE_PHY_UNSUP;
54845480
}

0 commit comments

Comments
 (0)