On Wed, 29 Mar 2023 at 11:27, Martin Pecka <pecka...@fel.cvut.cz> wrote:

> Hello,
>
> I'm using linuxptp from master branch on a Jetson TX2 device, where
> unfortunately only kernel 4.9.299 is available from the manufacturer.
>

commit 224d99f50f25ec3234b99556c0076a7130e230c6 (tag: v4.9.299)
Author: Greg Kroah-Hartman <gre...@linuxfoundation.org>
Date:   Sat Jan 29 10:15:58 2022 +0100
    Linux 4.9.299

The kernel is 1 year and 3 month old, it should work.
You mean this device: https://developer.nvidia.com/embedded/jetson-tx2


>
> The device's NIC uses eqos driver and reports all the timestamping
> capabilities required for ptp4l:
>

I do not find any 'eqos' driver in kernel  4.9.299.
It is probably a private driver. Please ask your manufacturer for a full
source code of the kernel.
As it is a GPL 2 software, he should.


>
> $ ethtool -T eth0
> Time stamping parameters for eth0:
> Capabilities:
>      hardware-transmit     (SOF_TIMESTAMPING_TX_HARDWARE)
>      software-transmit     (SOF_TIMESTAMPING_TX_SOFTWARE)
>      hardware-receive      (SOF_TIMESTAMPING_RX_HARDWARE)
>      software-receive      (SOF_TIMESTAMPING_RX_SOFTWARE)
>      software-system-clock (SOF_TIMESTAMPING_SOFTWARE)
>      hardware-raw-clock    (SOF_TIMESTAMPING_RAW_HARDWARE)
> PTP Hardware Clock: 0
> Hardware Transmit Timestamp Modes:
>      off                   (HWTSTAMP_TX_OFF)
>      on                    (HWTSTAMP_TX_ON)
> Hardware Receive Filter Modes:
>      none                  (HWTSTAMP_FILTER_NONE)
>      ptpv1-l4-sync         (HWTSTAMP_FILTER_PTP_V1_L4_SYNC)
>      ptpv1-l4-delay-req    (HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ)
>      ptpv2-l4-sync         (HWTSTAMP_FILTER_PTP_V2_L4_SYNC)
>      ptpv2-l4-delay-req    (HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ)
>      ptpv2-l2-sync         (HWTSTAMP_FILTER_PTP_V2_L2_SYNC)
>      ptpv2-l2-delay-req    (HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ)
>      ptpv2-event           (HWTSTAMP_FILTER_PTP_V2_EVENT)
>
> After updating to v4.0, I've noticed ptp4l cannot run with hardware
> timestamping:
>

linuxptp version 4 is not published yet, I assume you use the last master
version, which you build yourself.


>
> $ sudo ptp4l -H -i eth0 -f /etc/linuxptp/automotive-slave.cfg -m -l6
> ptp4l[1045.377]: selected /dev/ptp0 as PTP clock
> ptp4l[1045.420]: driver rejected most general HWTSTAMP filter
> ptp4l[1045.421]: ioctl SIOCSHWTSTAMP failed: Numerical result out of range
> ptp4l[1045.456]: port 1 (eth0): INITIALIZING to FAULTY on FAULT_DETECTED
> (FT_UNSPECIFIED)
>
> With the older version I used before (something after v3.1), it worked
> flawlessly.
>

I remember we did some upgrades regarding very old kernels,
 yet Linux 4.9 should work.
However as the 'eqos' driver is private, the problem might be there.


>
> Using git bisect, I've concluded that commit afeabf3 "ptp4l: add VLAN
> over bond support" is the bad one.
>
> If I comment out this part in sk.c, I get HW timestamping working again
> (line 67 onwards on current master):
>

Could be, then find the bug, please :-)
Do you use VLANs or bonds?
As the linuxptp should work the same without them.



>
>          init_ifreq(&ifreq, &cfg, device);
>
>          //cfg.flags = HWTSTAMP_FLAG_BONDED_PHC_INDEX;
>          /* Fall back without flag if user run new build on old kernel */
>          //if (ioctl(fd, SIOCGHWTSTAMP, &ifreq) == -EINVAL)
>          //      init_ifreq(&ifreq, &cfg, device);
>
> What would be the best way to fix this properly?
>

If linuxptp has a bug, we should fix it.
If the bug is in the 'eqos' driver, then the fix should be there. :-)

Richard, do you think we should wait with commit afeabf3 "ptp4l: add VLAN
over bond support"?

Erez


> Thanks,
>
> Martin
>
> _______________________________________________
> Linuxptp-devel mailing list
> Linuxptp-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxptp-devel
>
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to