Message ID | 20230721154424.11834-3-michal.michalik@intel.com |
---|---|
State | Changes Requested |
Headers | show |
Series | ice: add PTP auxiliary bus support | expand |
On 7/21/2023 8:44 AM, Michal Michalik wrote: ... > @@ -1927,9 +1945,9 @@ ice_ptp_settime64(struct ptp_clock_info *info, const struct timespec64 *ts) > /* Reenable periodic outputs */ > ice_ptp_enable_all_clkout(pf); > > - /* Recalibrate and re-enable timestamp block */ > - if (pf->ptp.port.link_up) > - ice_ptp_port_phy_restart(&pf->ptp.port); > + /* Recalibrate and re-enable timestamp blocks for E822/E823 */ > + if (!ice_is_e810(hw)) Should this use PHY model since this is coming after it [1]? > + ice_ptp_restart_all_phy(pf); > exit: > if (err) { > dev_err(ice_pf_to_dev(pf), "PTP failed to set time %d\n", err); [1] https://lore.kernel.org/intel-wired-lan/20230717221713.2249044-1-jacob.e.keller@intel.com/
On 25 July 2023 7:52 PM CEST, Nguyen, Anthony L wrote: > > On 7/21/2023 8:44 AM, Michal Michalik wrote: > > ... > >> @@ -1927,9 +1945,9 @@ ice_ptp_settime64(struct ptp_clock_info *info, const struct timespec64 *ts) >> /* Reenable periodic outputs */ >> ice_ptp_enable_all_clkout(pf); >> >> - /* Recalibrate and re-enable timestamp block */ >> - if (pf->ptp.port.link_up) >> - ice_ptp_port_phy_restart(&pf->ptp.port); >> + /* Recalibrate and re-enable timestamp blocks for E822/E823 */ >> + if (!ice_is_e810(hw)) > > Should this use PHY model since this is coming after it [1]? > Good catch Tony, I changed it before [1] was available and forgot to reverse it after it's here. Will update in v3. BR, M^2 >> + ice_ptp_restart_all_phy(pf); >> exit: >> if (err) { >> dev_err(ice_pf_to_dev(pf), "PTP failed to set time %d\n", err); > > [1] > https://lore.kernel.org/intel-wired-lan/20230717221713.2249044-1-jacob.e.keller@intel.com/
diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c index e144978..69a2bd0 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c @@ -1491,6 +1491,24 @@ static void ice_ptp_reset_phy_timestamping(struct ice_pf *pf) } /** + * ice_ptp_restart_all_phy - Restart all PHYs to recalibrate timestamping + * @pf: Board private structure + */ +static void ice_ptp_restart_all_phy(struct ice_pf *pf) +{ + struct list_head *entry; + + list_for_each(entry, &pf->ptp.ports_owner.ports) { + struct ice_ptp_port *port = list_entry(entry, + struct ice_ptp_port, + list_member); + + if (port->link_up) + ice_ptp_port_phy_restart(port); + } +} + +/** * ice_ptp_adjfine - Adjust clock increment rate * @info: the driver's PTP info structure * @scaled_ppm: Parts per million with 16-bit fractional field @@ -1927,9 +1945,9 @@ ice_ptp_settime64(struct ptp_clock_info *info, const struct timespec64 *ts) /* Reenable periodic outputs */ ice_ptp_enable_all_clkout(pf); - /* Recalibrate and re-enable timestamp block */ - if (pf->ptp.port.link_up) - ice_ptp_port_phy_restart(&pf->ptp.port); + /* Recalibrate and re-enable timestamp blocks for E822/E823 */ + if (!ice_is_e810(hw)) + ice_ptp_restart_all_phy(pf); exit: if (err) { dev_err(ice_pf_to_dev(pf), "PTP failed to set time %d\n", err);