[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87v84ybghc.ffs@tglx>
Date: Wed, 03 Apr 2024 17:42:07 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Mahesh Bandewar (महेश बंडेवार) <maheshb@...gle.com>
Cc: Sagi Maimon <maimon.sagi@...il.com>, richardcochran@...il.com,
luto@...nel.org, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com, arnd@...db.de,
geert@...ux-m68k.org, peterz@...radead.org, hannes@...xchg.org,
sohil.mehta@...el.com, rick.p.edgecombe@...el.com, nphamcs@...il.com,
palmer@...ive.com, keescook@...omium.org, legion@...nel.org,
mark.rutland@....com, mszeredi@...hat.com, casey@...aufler-ca.com,
reibax@...il.com, davem@...emloft.net, brauner@...nel.org,
linux-kernel@...r.kernel.org, linux-api@...r.kernel.org,
linux-arch@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH v7] posix-timers: add clock_compare system call
On Wed, Apr 03 2024 at 15:48, Thomas Gleixner wrote:
> On Tue, Apr 02 2024 at 16:37, Mahesh Bandewar (महेश बंडेवार) wrote:
> It is just an implementation detail whether you use a flag or a
> clockid. You can carry the clockid for the clocks which actually can be
> read in that context in a reserved field of PTP_SYS_OFFSET_EXTENDED:
>
> struct ptp_sys_offset_extended {
> unsigned int n_samples; /* Desired number of measurements. */
> clockid_t clockid;
> unsigned int rsv[2]; /* Reserved for future use. */
> };
>
> and in the IOCTL:
>
> if (extoff->clockid != CLOCK_MONOTONIC_RAW)
> return -EINVAL;
That should obviously be:
switch (extoff->clockid) {
case CLOCK_REALTIME:
case CLOCK_MONOTONIC_RAW:
break;
default:
return -EINVAL;
}
...
> sts.clockid = extoff->clockid;
>
> and it all just works, no?
>
> I have no problem to decide that PTP_SYS_OFFSET will not get this
> treatment and the drivers have to be converted over to
> PTP_SYS_OFFSET_EXTENDED.
>
> But adding yet another callback just to carry a clockid as argument is a
> more than pointless exercise as I demonstrated.
>
> Thanks,
>
> tglx
Powered by blists - more mailing lists