Skip to content

Commit 84b8694

Browse files
kolacinskikarolanguy11
authored andcommitted
ice: fall back to TCXO on TSPLL lock fail
TSPLL can fail when trying to lock to TIME_REF as a clock source, e.g. when the external clock source is not stable or connected to the board. To continue operation after failure, try to lock again to internal TCXO and inform user about this. Reviewed-by: Milena Olech <milena.olech@intel.com> Signed-off-by: Karol Kolacinski <karol.kolacinski@intel.com> Tested-by: Rinitha S <sx.rinitha@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent df3f3c5 commit 84b8694

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,5 +605,17 @@ int ice_tspll_init(struct ice_hw *hw)
605605
/* Configure the TSPLL using the parameters from the function
606606
* capabilities.
607607
*/
608-
return ice_tspll_cfg(hw, tspll_freq, clk_src);
608+
err = ice_tspll_cfg(hw, tspll_freq, clk_src);
609+
if (err) {
610+
dev_warn(ice_hw_to_dev(hw), "Failed to lock TSPLL to predefined frequency. Retrying with fallback frequency.\n");
611+
612+
/* Try to lock to internal TCXO as a fallback. */
613+
tspll_freq = ice_tspll_default_freq(hw->mac_type);
614+
clk_src = ICE_CLK_SRC_TCXO;
615+
err = ice_tspll_cfg(hw, tspll_freq, clk_src);
616+
if (err)
617+
dev_warn(ice_hw_to_dev(hw), "Failed to lock TSPLL to fallback frequency.\n");
618+
}
619+
620+
return err;
609621
}

0 commit comments

Comments
 (0)