> -----Original Message-----
> From: Miroslav Lichvar <mlich...@redhat.com>
> Sent: Wednesday, March 16, 2022 1:58 AM
> To: Keller, Jacob E <jacob.e.kel...@intel.com>
> Cc: linuxptp-devel@lists.sourceforge.net
> Subject: Re: [Linuxptp-devel] [PATCH] phc2sys: Don't exit when reading of PHC
> fails.
> 
> On Tue, Mar 15, 2022 at 10:40:02PM +0000, Keller, Jacob E wrote:
> > The ice hardware has a semaphore to protect accesses to the clock register.
> Multiple functions might access the clock at the same time. The semaphore
> prevents this. If we fail to acquire the semaphore in a short time, we give 
> up on
> the gettime function and exit with -EBUSY.
> >
> > Does the inner call log a debug message? if not perhaps we might want to add
> such a debug message to this as well?
> 
> Yes, there is a debug message for that:
> 
> phc2sys[497426.052]: ioctl PTP_SYS_OFFSET_EXTENDED: Device or resource busy
> phc2sys[497434.057]: ioctl PTP_SYS_OFFSET_EXTENDED: Device or resource busy
> phc2sys[497452.132]: ioctl PTP_SYS_OFFSET_EXTENDED: Device or resource busy
> 

Ok great.

> A potential issue is that if the ioctl happens to fail on the first
> use in sysoff_probe(), phc2sys will fall back to a worse ioctl. We
> could repeat the probe multiple times and use the best result, or
> maybe specifically check for the known error numbers like -EBUSY, -EIO.
> 

Repeating it a couple times seems reasonable to me. Depending on specific error 
codes is also nice, but we should ideally document those if we do. Specifically 
document them in the ioctl and in the ptp_clock_info callback descriptions.

Thanks,
Jake

> --
> Miroslav Lichvar



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

Reply via email to