Re: [PATCHv3 net-next 2/3] ptp: add ioctl interface for ptp_gettimex64any()

From: Mahesh Bandewar (महेश बंडेवार)
Date: Fri Jan 05 2024 - 12:52:18 EST


On Thu, Jan 4, 2024 at 2:37 PM Richard Cochran <richardcochran@xxxxxxxxx> wrote:
>
> On Thu, Jan 04, 2024 at 01:24:39PM -0800, Mahesh Bandewar wrote:
>
> > @@ -226,6 +238,8 @@ struct ptp_pin_desc {
> > _IOWR(PTP_CLK_MAGIC, 18, struct ptp_sys_offset_extended)
> > #define PTP_MASK_CLEAR_ALL _IO(PTP_CLK_MAGIC, 19)
> > #define PTP_MASK_EN_SINGLE _IOW(PTP_CLK_MAGIC, 20, unsigned int)
> > +#define PTP_SYS_OFFSET_ANY \
> > + _IOWR(PTP_CLK_MAGIC, 21, struct ptp_sys_offset_any)
>
> As I said before, this functionality really ought to be a new system call.
>
> Did you see these patch series posted on the list?
>
> 31.Dec'23 Sagi Maimon [PATCH v4] posix-timers: add multi_clock_gettime system call
> 31.Dec'23 Andy Lutomirski ├─>
> 01.Jan'24 Sagi Maimon │ └─>
> 01.Jan'24 kernel test rob ├─>
> 01.Jan'24 kernel test rob └─>
>
> 02.Jan'24 Sagi Maimon [PATCH v5] posix-timers: add multi_clock_gettime system call
> 02.Jan'24 Arnd Bergmann ├─>
> 03.Jan'24 Sagi Maimon │ └─>
> 04.Jan'24 kernel test rob └─>
>
> I think this will be the way forward.
>
> Please review the multi_clock_gettime series and help refine it.
>

While multi_clock_gettime streamlines POSIX clock reads (defined in
posix-timers.h: struct k_time), this proposal targets precision
enhancements for PTP hardware clocks (defined in ptp_clock_kernel.h:
struct ptp_clock_info).

Key distinctions:
1. Target clocks: multi_clock_gettime operates on POSIX clocks
(posix-timers.h), while this proposal focuses on PTP hardware clocks
(ptp_clock_kernel.h).
2. Purpose: multi_clock_gettime addresses scheduling latencies
by consolidating multiple clock reads. This proposal aims to enhance
PTP clock-read precision by measuring syscall width.

POSIX clocks are employed in this series for syscall width
measurement, potentially leading to misunderstandings about
overlapping functionality. However, their roles are distinct and serve
different purposes.
Both approaches address time-related challenges, but with different
goals and techniques.
multi_clock_gettime optimizes scheduling efficiency for POSIX clocks,
while this proposal refines PTP hardware clock-read accuracy.
They complement each other, catering to diverse application needs
within the timekeeping domain.

Hope this helps.

Thanks,
--mahesh..

> Thanks,
> Richard
>