On 8/12/2020 2:12 PM, Keller, Jacob E wrote:
>> -----Original Message-----
>> From: Richard Cochran <richardcoch...@gmail.com>
>> Sent: Wednesday, August 12, 2020 8:40 AM
>> To: Keller, Jacob E <jacob.e.kel...@intel.com>
>> Cc: linuxptp-devel@lists.sourceforge.net
>> Subject: Re: [Linuxptp-devel] [RFC PATCH 01/15] posix_clock_open: derive PHC
>> index from device name if possible
>>
>> On Wed, Aug 05, 2020 at 04:12:02PM -0700, Jacob Keller wrote:
>>> Here, we are making the implicit assumption that all ptp clock devices
>>> will always have /dev/ptpX format. I don't think anyone is crazy enough
>>> to rename these devices...
>>
>> (Not yet, anyways  ;^)
>>
>>> An alternative (requiring kernel implementation maybe?) would be to read
>>> the phc index from the kernel somehow. It doesn't look like this is
>>> exported anywhere else besides the name.
>>
>> How about /sys/class/ptp/ptpX/clock_index ?
>>
>> Is that something you would like to code up for the lkml?
>>
>> Thanks,
>> Richard
> 
> Yea, I can do that.
> 
> -Jake
>

I hadn't forgotten this. However, it turns out that this isn't a huge
value. Recent versions of udev don't seem to support re-naming devices
other than networking devices. For this reason, the primary way you
might "change" the name is a symlink device.

However, that won't impact the sysfs tree, and thus you can't actually
determine the clock index from the symlink device on its own.

I suppose if someone were to change how the device name was generated in
the kernel they could break this, but I tend to think that isn't really
a case we should support.

Thus.. I think this turns out not to be super valuable... I'm sending
the patch as RFC to the netdev list either way for some further
discussion, as it is quite trivial.

https://lore.kernel.org/netdev/20201002233743.1688517-1-jacob.e.kel...@intel.com/T/#u


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

Reply via email to