RE: [PATCH net-next 2/2] net: ethernet: ti: am65-cpsw: Enable RX HW timestamp only for PTP packets

From: Keller, Jacob E
Date: Fri Mar 01 2024 - 16:32:35 EST




> -----Original Message-----
> From: Chintan Vankar <c-vankar@xxxxxx>
> Sent: Friday, March 1, 2024 2:49 AM
> To: Keller, Jacob E <jacob.e.keller@xxxxxxxxx>; Dan Carpenter
> <dan.carpenter@xxxxxxxxxx>; Roger Quadros <rogerq@xxxxxxxxxx>; Siddharth
> Vadapalli <s-vadapalli@xxxxxx>; Richard Cochran <richardcochran@xxxxxxxxx>;
> Paolo Abeni <pabeni@xxxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>; Eric
> Dumazet <edumazet@xxxxxxxxxx>; David S. Miller <davem@xxxxxxxxxxxxx>
> Cc: linux-kernel@xxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH net-next 2/2] net: ethernet: ti: am65-cpsw: Enable RX HW
> timestamp only for PTP packets
>
>
>
> On 17/02/24 03:51, Jacob Keller wrote:
> >
> >
> > On 2/15/2024 3:09 AM, Chintan Vankar wrote:
> >> The CPSW peripherals on J7AHP, J7VCL, J7AEP, J7ES, AM64 SoCs have
> >> an errata i2401 "CPSW: Host Timestamps Cause CPSW Port to Lock up".
> >>
> >
> > What's different about timestamping only PTP packets that prevents this
> > port lock up?
>
> The difference is the way we are timestamping the packets. Instead of
> getting the timestamp from CPTS module, we are getting the timestamp
> from CPTS Event FIFO.
>
> In the current mechanism of timestamping, am65-cpsw-nuss driver
> timestamps all received packets by setting the TSTAMP_EN bit in
> CPTS_CONTROL register, which directs the CPTS module to timestamp all
> received packets, followed by passing timestamp via DMA descriptors.
> This mechanism was responsible for the CPSW port to lock up in certain
> condition. We are preventing port lock up by disabling TSTAMP_EN bit in
> CPTS_CONTROL register.
>
> The mechanism we are following in this patch, utilizes the CPTS Event
> FIFO that records timestamps corresponding to certain events, with one
> such event being the reception of an Ethernet packet with EtherType
> field set to PTP.

Ok that explains it. Thanks!

Regards,
Jake