Skip to content

Commit 386de12

Browse files
committed
ice: move TSPLL init calls to ice_ptp.c
jira LE-4694 Rebuild_History Non-Buildable kernel-6.12.0-55.43.1.el10_0 commit-author Karol Kolacinski <karol.kolacinski@intel.com> commit e980aa6 Initialize TSPLL after initializing PHC in ice_ptp.c instead of calling for each product in PHC init in ice_ptp_hw.c. Reviewed-by: Michal Kubiak <michal.kubiak@intel.com> 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> (cherry picked from commit e980aa6) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent c3196fb commit 386de12

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2994,6 +2994,10 @@ static int ice_ptp_rebuild_owner(struct ice_pf *pf)
29942994
if (err)
29952995
return err;
29962996

2997+
err = ice_tspll_init(hw);
2998+
if (err)
2999+
return err;
3000+
29973001
/* Acquire the global hardware lock */
29983002
if (!ice_ptp_lock(hw)) {
29993003
err = -EBUSY;
@@ -3161,6 +3165,13 @@ static int ice_ptp_init_owner(struct ice_pf *pf)
31613165
return err;
31623166
}
31633167

3168+
err = ice_tspll_init(hw);
3169+
if (err) {
3170+
dev_err(ice_pf_to_dev(pf), "Failed to initialize CGU, status %d\n",
3171+
err);
3172+
return err;
3173+
}
3174+
31643175
/* Acquire the global hardware lock */
31653176
if (!ice_ptp_lock(hw)) {
31663177
err = -EBUSY;

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

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,20 +2103,6 @@ int ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port)
21032103
return 0;
21042104
}
21052105

2106-
/**
2107-
* ice_ptp_init_phc_e825 - Perform E825 specific PHC initialization
2108-
* @hw: pointer to HW struct
2109-
*
2110-
* Perform E825-specific PTP hardware clock initialization steps.
2111-
*
2112-
* Return: 0 on success, negative error code otherwise.
2113-
*/
2114-
static int ice_ptp_init_phc_e825(struct ice_hw *hw)
2115-
{
2116-
/* Initialize the Clock Generation Unit */
2117-
return ice_tspll_init(hw);
2118-
}
2119-
21202106
/**
21212107
* ice_ptp_read_tx_hwtstamp_status_eth56g - Get TX timestamp status
21222108
* @hw: pointer to the HW struct
@@ -2776,7 +2762,6 @@ static int ice_ptp_set_vernier_wl(struct ice_hw *hw)
27762762
*/
27772763
static int ice_ptp_init_phc_e82x(struct ice_hw *hw)
27782764
{
2779-
int err;
27802765
u32 val;
27812766

27822767
/* Enable reading switch and PHY registers over the sideband queue */
@@ -2786,11 +2771,6 @@ static int ice_ptp_init_phc_e82x(struct ice_hw *hw)
27862771
val |= (PF_SB_REM_DEV_CTL_SWITCH_READ | PF_SB_REM_DEV_CTL_PHY0);
27872772
wr32(hw, PF_SB_REM_DEV_CTL, val);
27882773

2789-
/* Initialize the Clock Generation Unit */
2790-
err = ice_tspll_init(hw);
2791-
if (err)
2792-
return err;
2793-
27942774
/* Set window length for all the ports */
27952775
return ice_ptp_set_vernier_wl(hw);
27962776
}
@@ -5425,7 +5405,7 @@ int ice_ptp_init_phc(struct ice_hw *hw)
54255405
case ICE_MAC_GENERIC:
54265406
return ice_ptp_init_phc_e82x(hw);
54275407
case ICE_MAC_GENERIC_3K_E825:
5428-
return ice_ptp_init_phc_e825(hw);
5408+
return 0;
54295409
default:
54305410
return -EOPNOTSUPP;
54315411
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,11 @@ int ice_tspll_init(struct ice_hw *hw)
592592
enum ice_clk_src clk_src;
593593
int err;
594594

595+
/* Only E822, E823 and E825 products support TSPLL */
596+
if (hw->mac_type != ICE_MAC_GENERIC &&
597+
hw->mac_type != ICE_MAC_GENERIC_3K_E825)
598+
return 0;
599+
595600
tspll_freq = (enum ice_tspll_freq)ts_info->time_ref;
596601
clk_src = (enum ice_clk_src)ts_info->clk_src;
597602
if (!ice_tspll_check_params(hw, tspll_freq, clk_src))

0 commit comments

Comments
 (0)