Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't see SOF_TIMESTAMPING_TX_SOFTWARE listed #5

Open
yoyoyochen opened this issue Jul 10, 2019 · 6 comments
Open

can't see SOF_TIMESTAMPING_TX_SOFTWARE listed #5

yoyoyochen opened this issue Jul 10, 2019 · 6 comments

Comments

@yoyoyochen
Copy link

image

I patch similar to that this repo provides (which applies to drivers/net/usb/smsc95xx.c driver) needs to be crafted for drivers/net/usb/lan78xx.c,but I still can't see SOF_TIMESTAMPING_TX_SOFTWARE listed

@ArenAcikgoz
Copy link

I also have the same problem. I am using Rpi 3B+

@SvenNoakes
Copy link

SvenNoakes commented Oct 28, 2019

I spent hours, or days!, wrestling with this problem! The answer is in the comments to the ptp4l installation, see https://github.com/twteamware/raspberrypi-ptp/files/2780780/lan78xx_patch.zip

I solved the problem using this code, following advice in an "issue" raised on the installation of ptp4l (it is a 'closed' issue, "Not working with Linux 4.14.84-v7+ #2").
if ! grep 'ethtool_op_get_ts_info,' lan78xx.c
then
sed -i 's|lan78xx_get_regs,|lan78xx_get_regs,\n\t.get_ts_info = ethtool_op_get_ts_info,|' lan78xx.c
echo "lan78xx.c edited"
else
echo "lan78xx.c already correct"
fi
Obviously, this is a .cc file edit so then recompile/rebuilt kernel etc. lan78xx.c is found within the 'linux' folder tree that is downloaded.

It solves the problem that the software timestamp is implemented but not reported, so ptp doesn't know it is there and thus can't use it.

HTH

@ArenAcikgoz
Copy link

Thank you for the fast reply, however patching lan78xx.c did not fix the issue for me. I am currently using linux 4.19.66-v7+ and I built it using instructions given in the README.md. There were no problems or errors during my installation. Are you also using a Rpi 3B+ ?

@SvenNoakes
Copy link

SvenNoakes commented Nov 1, 2019

You are right, I found that it had failed shortly after posting the response above. This morning I found an error in my original comment (missing comma in replacement text, now corrected!); the correct version works! I now get SOF_TIMESTAMPING_TX_SOFTWARE reported with ethtool -T eth0 and nice, green Active when I use systemctl status ptp4l

Correct sed script:

sed -i 's|lan78xx_get_regs,|lan78xx_get_regs,\n\t.get_ts_info = ethtool_op_get_ts_info,|' lan78xx.c

lan78xx.c can be found in ~/linux/drivers/net/usb/ where ~ is the home directory or where you ran the download of new kernel from.

Yes - I am using an RPi 3B+. I have had it working for a few months on Raspbian Stretch; recently installed Raspbian Buster, hence the renewed interest. HTH.

@aehomay
Copy link

aehomay commented Aug 19, 2021

Folks
I am using Linux raspberrypi 5.10.52-v7+ #1 on my RPi 3B+ and I am trying to enable PTP. I went through all steps that is explained in here, but still SOF_TIMESTAMPING_TX_SOFTWARE is not being reported with ethtool -T eth0. My next step was to follow the steps explained in here but honestly when I ran that commands as they are it does not work. I am new to Linux maybe I don`t know how to apply a patch or doing something stupid. Can anyone help me?
I am not able to run this command:
git am /patches/0001-smsc95xx-use-generic-ethtool_op_get_ts_info-callback

@gizero

@tiagofreire-pt
Copy link

tiagofreire-pt commented Jan 29, 2022

You are right, I found that it had failed shortly after posting the response above. This morning I found an error in my original comment (missing comma in replacement text, now corrected!); the correct version works! I now get SOF_TIMESTAMPING_TX_SOFTWARE reported with ethtool -T eth0 and nice, green Active when I use systemctl status ptp4l

Correct sed script:

sed -i 's|lan78xx_get_regs,|lan78xx_get_regs,\n\t.get_ts_info = ethtool_op_get_ts_info,|' lan78xx.c

lan78xx.c can be found in ~/linux/drivers/net/usb/ where ~ is the home directory or where you ran the download of new kernel from.

Yes - I am using an RPi 3B+. I have had it working for a few months on Raspbian Stretch; recently installed Raspbian Buster, hence the renewed interest. HTH.

This had work for me with kernel 5.10.94.

Unbelievable in 2022 the need to patch a kernel driver to enable this...

Pull request for the rpi kernel repo: raspberrypi/linux#4856

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants