[Intel-wired-lan] [PATCH v10 iwl-next 06/11] idpf: add mailbox access to read PTP clock time

Jacob Keller jacob.e.keller at intel.com
Tue Apr 8 21:16:57 UTC 2025



On 4/8/2025 3:30 AM, Milena Olech wrote:
> +static int idpf_ptp_read_src_clk_reg_mailbox(struct idpf_adapter *adapter,
> +					     struct ptp_system_timestamp *sts,
> +					     u64 *src_clk)
> +{
> +	struct idpf_ptp_dev_timers clk_time;
> +	int err;
> +
> +	/* Read the system timestamp pre PHC read */
> +	ptp_read_system_prets(sts);
> +
> +	err = idpf_ptp_get_dev_clk_time(adapter, &clk_time);
> +	if (err)
> +		return err;
> +
> +	/* Read the system timestamp post PHC read */
> +	ptp_read_system_postts(sts);
> +
> +	*src_clk = clk_time.dev_clk_time_ns;
> +
> +	return 0;
> +}
Not an objection, since its obvious using the direct register access is
preferable when it is available. This will result in a fair amount of
jitter since mailbox timing is unlikely to be consistent. We also cannot
have sts be filled in somehow by the host because it might not be
operating on the same system clock.


More information about the Intel-wired-lan mailing list