Subject: Re: [PATCH net-next 2/5] eth: fbnic: add initial PHC support

From: Jakub Kicinski <[email-masked]>
Date: Wed, 11 Sep 2024 11:47:08 -0700

On Wed, 11 Sep 2024 18:25:11 +0200 Andrew Lunn wrote:
> > +#define FBNIC_PTP_CDC_FIFO_STATUS	0x0480c		/* 0x12030 */
> > +#define FBNIC_PTP_SPARE			0x0480d		/* 0x12034 */
> > +#define FBNIC_CSR_END_PTP		0x0480d /* CSR section delimiter */  
> 
> We know the PCS is a licensed block. Is this also licensed? Should it
> be placed in driver/ptp so others who licence the same block can
> re-uses it?

Nope, the timestamping itself happens in the MAC, obviously,
but the clock / ticker module is fairly straightforward.
IDK if there's even shared IPs for that.

> > +/* FBNIC timing & PTP implementation
> > + * Datapath uses truncated 40b timestamps for scheduling and event reporting.
> > + * We need to promote those to full 64b, hence we periodically cache the top
> > + * 32bit of the HW time counter. Since this makes our time reporting non-atomic
> > + * we leave the HW clock free running and adjust time offsets in SW as needed.
> > + * Time offset is 64bit - we need a seq counter for 32bit machines.
> > + * Time offset and the cache of top bits are independent so we don't need
> > + * a coherent snapshot of both - READ_ONCE()/WRITE_ONCE() + writer side lock
> > + * are enough.
> > + *
> > + * TBD: alias u64_stats_sync & co. with some more appropriate names upstream.  
> 
> This is upstream, so maybe now is a good time to decide?

Ha!