Skip to content

Commit bf6dbad

Browse files
orospanguy11
authored andcommitted
ice: fix PTP timestamping broken by SyncE code on E825C
The E825C SyncE support added in commit ad1df4f ("ice: dpll: Support E825-C SyncE and dynamic pin discovery") introduced a SyncE reconfiguration block in ice_ptp_link_change() that prevents ice_ptp_port_phy_restart() from being called in several error paths. Without the PHY restart, PTP timestamps stop working after any link change event. There are three ways the PHY restart gets blocked: 1. When DPLL initialization fails (e.g. missing ACPI firmware node properties), ICE_FLAG_DPLL is not set and the function returns early before reaching the PHY restart. 2. When ice_tspll_bypass_mux_active_e825c() fails to read the CGU register, WARN_ON_ONCE fires and the function returns early. 3. When ice_tspll_cfg_synce_ethdiv_e825c() fails to configure the clock divider for an active pin, same early return. SyncE and PTP are independent features. SyncE reconfiguration failures must not prevent the PTP PHY restart that is essential for timestamp recovery after link changes. Fix by making the entire SyncE block conditional on ICE_FLAG_DPLL without an early return, and replacing the WARN_ON_ONCE + return error handling inside the loop with dev_err_once + break. The function always proceeds to ice_ptp_port_phy_restart() regardless of SyncE errors. Fixes: ad1df4f ("ice: dpll: Support E825-C SyncE and dynamic pin discovery") Signed-off-by: Petr Oros <poros@redhat.com> Reviewed-by: Grzegorz Nitka <grzegorz.nitka@intel.com> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Tested-by: Sunitha Mekala <sunithax.d.mekala@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent bb3f21e commit bf6dbad

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,12 +1296,10 @@ void ice_ptp_link_change(struct ice_pf *pf, bool linkup)
12961296
if (pf->hw.reset_ongoing)
12971297
return;
12981298

1299-
if (hw->mac_type == ICE_MAC_GENERIC_3K_E825) {
1299+
if (hw->mac_type == ICE_MAC_GENERIC_3K_E825 &&
1300+
test_bit(ICE_FLAG_DPLL, pf->flags)) {
13001301
int pin, err;
13011302

1302-
if (!test_bit(ICE_FLAG_DPLL, pf->flags))
1303-
return;
1304-
13051303
mutex_lock(&pf->dplls.lock);
13061304
for (pin = 0; pin < ICE_SYNCE_CLK_NUM; pin++) {
13071305
enum ice_synce_clk clk_pin;
@@ -1314,15 +1312,19 @@ void ice_ptp_link_change(struct ice_pf *pf, bool linkup)
13141312
port_num,
13151313
&active,
13161314
clk_pin);
1317-
if (WARN_ON_ONCE(err)) {
1318-
mutex_unlock(&pf->dplls.lock);
1319-
return;
1315+
if (err) {
1316+
dev_err_once(ice_pf_to_dev(pf),
1317+
"Failed to read SyncE bypass mux for pin %d, err %d\n",
1318+
pin, err);
1319+
break;
13201320
}
13211321

13221322
err = ice_tspll_cfg_synce_ethdiv_e825c(hw, clk_pin);
1323-
if (active && WARN_ON_ONCE(err)) {
1324-
mutex_unlock(&pf->dplls.lock);
1325-
return;
1323+
if (active && err) {
1324+
dev_err_once(ice_pf_to_dev(pf),
1325+
"Failed to configure SyncE ETH divider for pin %d, err %d\n",
1326+
pin, err);
1327+
break;
13261328
}
13271329
}
13281330
mutex_unlock(&pf->dplls.lock);

0 commit comments

Comments
 (0)