quote on Fri, Jul 01, 2016 at 05:16:27PM +0200 (Richard Cochran):

> On Fri, Jul 01, 2016 at 01:43:11PM +0300, Ivan Oleynikov wrote:
> > Some network interfaces do not specify PTP clock id that provides interface 
> > to
> > their hardware clock. In this case the interface driver returns -1 in
> > `ethtool_ts_info` to SIOCETHTOOL. This commit makes linuxptp ignore it 
> > instead
> > of failing with error "PHC device mismatch".
>
> What drivers are incorrectly returning -1 in phc_index?

Doing

  git clone https://github.com/trovalds/linux.git
  cd linux
  git grep '\->phc_index.*=.*-1' -- drivers/net/

gave me 13 matches. I've skimmed through a few of them, they usually return
phc_index = -1 when the netdev has no PHC associated with it. I guess this is
expected behaviour.

This is not my case. I'm working on two separate drivers: first one provides
netdev with SOF_TIMESTAMPING_{RX,TX}_HARDWARE support enabled, the second one
provides ptp clock.

Actual devices are implemented in FPGA and can be present or not in the current
firmware independent of each other. I want the the same from drivers: to know
nothing about each other. Thus making user explicitly define (ptp4l -p) what ptp
clock to use.

> Instead of this workaround, let's get those fixed, please.

Looks like drivers return phc_index = -1 to specify that this netdevice doesn't
have a phc. Is there something that I can return to show that my netdevice knows
nothing about its PHC and is ready to synchronize with whatever PTP clock user
wants?

On the other hand if ptp4l supports only those netdevices that report their PHC
device index, what is the purpose of flag -p?

--
Ivan Oleynikov
STC Metrotek
St.Petersburg

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to