[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CO1PR11MB50891BE5E377FFB7DB6D8314D694A@CO1PR11MB5089.namprd11.prod.outlook.com>
Date: Fri, 23 Jan 2026 23:48:02 +0000
From: "Keller, Jacob E" <jacob.e.keller@...el.com>
To: "Nguyen, Anthony L" <anthony.l.nguyen@...el.com>, "davem@...emloft.net"
<davem@...emloft.net>, "kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>, "edumazet@...gle.com"
<edumazet@...gle.com>, "andrew+netdev@...n.ch" <andrew+netdev@...n.ch>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: Mina Almasry <almasrymina@...gle.com>, "richardcochran@...il.com"
<richardcochran@...il.com>, "lrizzo@...gle.com" <lrizzo@...gle.com>,
"namangulati@...gle.com" <namangulati@...gle.com>, "willemb@...gle.com"
<willemb@...gle.com>, "intel-wired-lan@...ts.osuosl.org"
<intel-wired-lan@...ts.osuosl.org>, "Olech, Milena" <milena.olech@...el.com>,
Shachar Raindel <shacharr@...gle.com>, "Loktionov, Aleksandr"
<aleksandr.loktionov@...el.com>, "Salin, Samuel" <samuel.salin@...el.com>
Subject: RE: [PATCH net 4/4] idpf: read lower clock bits inside the time
sandwich
> -----Original Message-----
> From: Nguyen, Anthony L <anthony.l.nguyen@...el.com>
> Sent: Tuesday, January 20, 2026 2:44 PM
> To: davem@...emloft.net; kuba@...nel.org; pabeni@...hat.com;
> edumazet@...gle.com; andrew+netdev@...n.ch; netdev@...r.kernel.org
> Cc: Mina Almasry <almasrymina@...gle.com>; Nguyen, Anthony L
> <anthony.l.nguyen@...el.com>; richardcochran@...il.com;
> lrizzo@...gle.com; namangulati@...gle.com; willemb@...gle.com; intel-
> wired-lan@...ts.osuosl.org; Olech, Milena <milena.olech@...el.com>; Keller,
> Jacob E <jacob.e.keller@...el.com>; Shachar Raindel <shacharr@...gle.com>;
> Loktionov, Aleksandr <aleksandr.loktionov@...el.com>; Salin, Samuel
> <samuel.salin@...el.com>
> Subject: [PATCH net 4/4] idpf: read lower clock bits inside the time sandwich
>
> From: Mina Almasry <almasrymina@...gle.com>
>
> PCIe reads need to be done inside the time sandwich because PCIe
> writes may get buffered in the PCIe fabric and posted to the device
> after the _postts completes. Doing the PCIe read inside the time
> sandwich guarantees that the write gets flushed before the _postts
> timestamp is taken.
>
> Cc: lrizzo@...gle.com
> Cc: namangulati@...gle.com
> Cc: willemb@...gle.com
> Cc: intel-wired-lan@...ts.osuosl.org
> Cc: milena.olech@...el.com
> Cc: jacob.e.keller@...el.com
>
> Fixes: 5cb8805d2366 ("idpf: negotiate PTP capabilities and get PTP clock")
> Suggested-by: Shachar Raindel <shacharr@...gle.com>
> Signed-off-by: Mina Almasry <almasrymina@...gle.com>
> Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@...el.com>
> Tested-by: Samuel Salin <Samuel.salin@...el.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@...el.com>
> ---
> drivers/net/ethernet/intel/idpf/idpf_ptp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/intel/idpf/idpf_ptp.c
> b/drivers/net/ethernet/intel/idpf/idpf_ptp.c
> index 3e1052d070cf..0a8b50350b86 100644
> --- a/drivers/net/ethernet/intel/idpf/idpf_ptp.c
> +++ b/drivers/net/ethernet/intel/idpf/idpf_ptp.c
> @@ -108,11 +108,11 @@ static u64 idpf_ptp_read_src_clk_reg_direct(struct
> idpf_adapter *adapter,
> ptp_read_system_prets(sts);
>
> idpf_ptp_enable_shtime(adapter);
I thought idpf_ptp_enable_shtime did a snapshot of the system time, but perhaps it didn't get flushed until after a read...
> + lo = readl(ptp->dev_clk_regs.dev_clk_ns_l);
>
In that case, doing this read makes sense, as it would trigger a flush to ensure that we have flushed the timestamp snapshot. There's no reason to use something like idpf_flush() here because we're already going to do an important read anyways.
Acked-by: Jacob Keller <Jacob.e.keller@...el.com>
> /* Read the system timestamp post PHC read */
> ptp_read_system_postts(sts);
>
> - lo = readl(ptp->dev_clk_regs.dev_clk_ns_l);
> hi = readl(ptp->dev_clk_regs.dev_clk_ns_h);
>
> spin_unlock(&ptp->read_dev_clk_lock);
> --
> 2.47.1
Powered by blists - more mailing lists