Re: [Linuxptp-users] Regression - phc2sys fails with certain PHC char dev filenames
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
|
From: Ed B. <br...@ar...> - 2021-11-12 16:27:16
|
On 11/11/21 17:28, Ed Branch wrote: > > Thanks for the quick reply. Understood, digging this out properly (ie. > finding the /sys/class/ptp/ptp*/dev file with a matching minor to that > of the device node) would add a lot of complexity. However, looking at > the alloc_chardev_region() call in the ptp driver > (drivers/ptp/ptp_clock.c) reveals the first minor in the requested range > is always 0, so it might be ok to assume the PHC index is just the > device node minor. > > Of course your suggestion of just ignoring the failure in phc2sys would > be enough to fix my use case too. > > Thanks again for looking at this, > - Ed Branch Reading a bit further into posix_clock_open(...), I see it already relied on existence of device nodes named "/dev/ptp#". If these have to exist anyway then maybe there's no point accounting for other names. My actual failure is because I access them through a symlink created by udev based on the clock_name sysfs attribute. So simply resolving symlinks prior to the existing logic would also work. For now, my workaround is to rename the symlinks so they do not match the "/dev/ptp*" pattern. - Ed Branch |