All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: davem@davemloft.net, pabeni@redhat.com, edumazet@google.com,
	andrew+netdev@lunn.ch, netdev@vger.kernel.org,
	Milena Olech <milena.olech@intel.com>,
	przemyslaw.kitszel@intel.com, karol.kolacinski@intel.com,
	richardcochran@gmail.com,
	Alexander Lobakin <aleksander.lobakin@intel.com>,
	Willem de Bruijn <willemb@google.com>,
	Mina Almasry <almasrymina@google.com>,
	Samuel Salin <Samuel.salin@intel.com>
Subject: Re: [PATCH net-next 04/10] idpf: negotiate PTP capabilities and get PTP clock
Date: Tue, 25 Mar 2025 05:49:56 -0700	[thread overview]
Message-ID: <20250325054956.3f62eef8@kernel.org> (raw)
In-Reply-To: <20250318161327.2532891-5-anthony.l.nguyen@intel.com>

On Tue, 18 Mar 2025 09:13:19 -0700 Tony Nguyen wrote:
> +/**
> + * idpf_ptp_read_src_clk_reg_direct - Read directly the main timer value
> + * @adapter: Driver specific private structure
> + * @sts: Optional parameter for holding a pair of system timestamps from
> + *	 the system clock. Will be ignored when NULL is given.
> + *
> + * Return: the device clock time on success, -errno otherwise.

I don't see no -errno in this function.
The whole kdoc looks like complete boilerplate, but I guess 
it's required of your internal coding style :(

> + */
> +static u64 idpf_ptp_read_src_clk_reg_direct(struct idpf_adapter *adapter,
> +					    struct ptp_system_timestamp *sts)
> +{
> +	struct idpf_ptp *ptp = adapter->ptp;
> +	u32 hi, lo;
> +
> +	/* Read the system timestamp pre PHC read */
> +	ptp_read_system_prets(sts);
> +
> +	idpf_ptp_enable_shtime(adapter);
> +	lo = readl(ptp->dev_clk_regs.dev_clk_ns_l);
> +
> +	/* Read the system timestamp post PHC read */
> +	ptp_read_system_postts(sts);
> +
> +	hi = readl(ptp->dev_clk_regs.dev_clk_ns_h);

So hi is latched when lo is read? Or the timer may wrap between 
the reads? Can reads happen in parallel (re-latching hi)?

> +	return ((u64)hi << 32) | lo;
> +}

> +#if IS_ENABLED(CONFIG_X86)
> +	system->cycles = ns_time_sys;
> +	system->cs_id = CSID_X86_ART;
> +#endif /* CONFIG_X86 */
> +
> +	return 0;

Please split the cross-stamping into separate patches.

  reply	other threads:[~2025-03-25 12:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-18 16:13 [PATCH net-next 00/10][pull request] idpf: add initial PTP support Tony Nguyen
2025-03-18 16:13 ` [PATCH net-next 01/10] " Tony Nguyen
2025-03-25 12:44   ` Jakub Kicinski
2025-03-25 21:05     ` Jacob Keller
2025-04-02 13:16       ` Olech, Milena
2025-03-18 16:13 ` [PATCH net-next 02/10] virtchnl: add PTP virtchnl definitions Tony Nguyen
2025-03-18 16:13 ` [PATCH net-next 03/10] idpf: move virtchnl structures to the header file Tony Nguyen
2025-03-18 16:13 ` [PATCH net-next 04/10] idpf: negotiate PTP capabilities and get PTP clock Tony Nguyen
2025-03-25 12:49   ` Jakub Kicinski [this message]
2025-03-25 21:07     ` Jacob Keller
2025-03-26  8:24     ` Przemek Kitszel
2025-04-02 15:23     ` Olech, Milena
2025-04-02 16:37       ` Jakub Kicinski
2025-03-18 16:13 ` [PATCH net-next 05/10] idpf: add mailbox access to read PTP clock time Tony Nguyen
2025-03-18 16:13 ` [PATCH net-next 06/10] idpf: add PTP clock configuration Tony Nguyen
2025-03-18 16:13 ` [PATCH net-next 07/10] idpf: add Tx timestamp capabilities negotiation Tony Nguyen
2025-03-18 16:13 ` [PATCH net-next 08/10] idpf: add Tx timestamp flows Tony Nguyen
2025-03-25 13:00   ` Jakub Kicinski
2025-03-25 21:10     ` Jacob Keller
2025-04-02 14:57     ` Olech, Milena
2025-03-18 16:13 ` [PATCH net-next 09/10] idpf: add support for Rx timestamping Tony Nguyen
2025-03-18 16:13 ` [PATCH net-next 10/10] idpf: change the method for mailbox workqueue allocation Tony Nguyen
2025-03-25 21:08   ` Jacob Keller
2025-04-02 13:22     ` Olech, Milena

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250325054956.3f62eef8@kernel.org \
    --to=kuba@kernel.org \
    --cc=Samuel.salin@intel.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=almasrymina@google.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=karol.kolacinski@intel.com \
    --cc=milena.olech@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=richardcochran@gmail.com \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.