* [PATCH 6.1.y] Revert "selftest/ptp: update ptp selftest to exercise the gettimex options"
@ 2026-05-15 13:53 Petr Machata
2026-06-16 13:28 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Petr Machata @ 2026-05-15 13:53 UTC (permalink / raw)
To: Sasha Levin
Cc: Petr Machata, stable, Wojtek Wasko, Mahesh Bandewar, Shuah Khan,
Richard Cochran, Yong Wang
This reverts commit 06954f715deb0ed053f8bf85547370db6870225d, which is
commit 3d07b691ee707c00afaf365440975e81bb96cd9b upstream.
The cited commit allows testptp to set a configurable clock_id. That is
done via a PTP_SYS_OFFSET_EXTENDED ioctl call, whose argument is struct
ptp_sys_offset_extended, where the clock_id is set. However, this Linux
version does not support the ptp_sys_offset_extended.clockid field, and
the test case cannot be built against this tree's own UAPI headers.
The reverted commit was introduced to resolve a missing dependency of
commit c6dc458227a3 ("testptp: Add option to open PHC in readonly mode"),
which is 76868642e427 upstream. My suspicion is that the only conflict
between the two is the getopt string, and there is otherwise no direct
dependency between the two.
This patch therefore reverts the cited commit, with hand-resolving the
getopt string to include 'r' (as introduced by c6dc458227a3), but not
'y' (introduced by 06954f715deb).
Reported-by: Yong Wang <yongwang@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
---
Note: the issue appears to exist in 6.6, 6.12 and 6.18 as well.
Depending on your preference, I can prepare separate
patches for those branches as well. Let me know.
---
tools/testing/selftests/ptp/testptp.c | 62 +++------------------------
1 file changed, 5 insertions(+), 57 deletions(-)
diff --git a/tools/testing/selftests/ptp/testptp.c b/tools/testing/selftests/ptp/testptp.c
index 532fb6a5d059..7030bae8e5e0 100644
--- a/tools/testing/selftests/ptp/testptp.c
+++ b/tools/testing/selftests/ptp/testptp.c
@@ -147,7 +147,6 @@ static void usage(char *progname)
" -T val set the ptp clock time to 'val' seconds\n"
" -x val get an extended ptp clock time with the desired number of samples (up to %d)\n"
" -X get a ptp clock cross timestamp\n"
- " -y val pre/post tstamp timebase to use {realtime|monotonic|monotonic-raw}\n"
" -z test combinations of rising/falling external time stamp flags\n",
progname, PTP_MAX_SAMPLES);
}
@@ -192,7 +191,6 @@ int main(int argc, char *argv[])
int readonly = 0;
int settime = 0;
int channel = -1;
- clockid_t ext_clockid = CLOCK_REALTIME;
int64_t t1, t2, tp;
int64_t interval, offset;
@@ -202,7 +200,7 @@ int main(int argc, char *argv[])
progname = strrchr(argv[0], '/');
progname = progname ? 1+progname : argv[0];
- while (EOF != (c = getopt(argc, argv, "cd:e:f:F:ghH:i:k:lL:n:o:p:P:rsSt:T:w:x:Xy:z"))) {
+ while (EOF != (c = getopt(argc, argv, "cd:e:f:F:ghH:i:k:lL:n:o:p:P:rsSt:T:w:x:Xz"))) {
switch (c) {
case 'c':
capabilities = 1;
@@ -285,21 +283,6 @@ int main(int argc, char *argv[])
case 'X':
getcross = 1;
break;
- case 'y':
- if (!strcasecmp(optarg, "realtime"))
- ext_clockid = CLOCK_REALTIME;
- else if (!strcasecmp(optarg, "monotonic"))
- ext_clockid = CLOCK_MONOTONIC;
- else if (!strcasecmp(optarg, "monotonic-raw"))
- ext_clockid = CLOCK_MONOTONIC_RAW;
- else {
- fprintf(stderr,
- "type needs to be realtime, monotonic or monotonic-raw; was given %s\n",
- optarg);
- return -1;
- }
- break;
-
case 'z':
flagtest = 1;
break;
@@ -590,7 +573,6 @@ int main(int argc, char *argv[])
}
soe->n_samples = getextended;
- soe->clockid = ext_clockid;
if (ioctl(fd, PTP_SYS_OFFSET_EXTENDED, soe)) {
perror("PTP_SYS_OFFSET_EXTENDED");
@@ -599,46 +581,12 @@ int main(int argc, char *argv[])
getextended);
for (i = 0; i < getextended; i++) {
- switch (ext_clockid) {
- case CLOCK_REALTIME:
- printf("sample #%2d: real time before: %lld.%09u\n",
- i, soe->ts[i][0].sec,
- soe->ts[i][0].nsec);
- break;
- case CLOCK_MONOTONIC:
- printf("sample #%2d: monotonic time before: %lld.%09u\n",
- i, soe->ts[i][0].sec,
- soe->ts[i][0].nsec);
- break;
- case CLOCK_MONOTONIC_RAW:
- printf("sample #%2d: monotonic-raw time before: %lld.%09u\n",
- i, soe->ts[i][0].sec,
- soe->ts[i][0].nsec);
- break;
- default:
- break;
- }
+ printf("sample #%2d: system time before: %lld.%09u\n",
+ i, soe->ts[i][0].sec, soe->ts[i][0].nsec);
printf(" phc time: %lld.%09u\n",
soe->ts[i][1].sec, soe->ts[i][1].nsec);
- switch (ext_clockid) {
- case CLOCK_REALTIME:
- printf(" real time after: %lld.%09u\n",
- soe->ts[i][2].sec,
- soe->ts[i][2].nsec);
- break;
- case CLOCK_MONOTONIC:
- printf(" monotonic time after: %lld.%09u\n",
- soe->ts[i][2].sec,
- soe->ts[i][2].nsec);
- break;
- case CLOCK_MONOTONIC_RAW:
- printf(" monotonic-raw time after: %lld.%09u\n",
- soe->ts[i][2].sec,
- soe->ts[i][2].nsec);
- break;
- default:
- break;
- }
+ printf(" system time after: %lld.%09u\n",
+ soe->ts[i][2].sec, soe->ts[i][2].nsec);
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 6.1.y] Revert "selftest/ptp: update ptp selftest to exercise the gettimex options"
2026-05-15 13:53 [PATCH 6.1.y] Revert "selftest/ptp: update ptp selftest to exercise the gettimex options" Petr Machata
@ 2026-06-16 13:28 ` Greg KH
2026-06-16 13:29 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2026-06-16 13:28 UTC (permalink / raw)
To: Petr Machata
Cc: Sasha Levin, stable, Wojtek Wasko, Mahesh Bandewar, Shuah Khan,
Richard Cochran, Yong Wang
On Fri, May 15, 2026 at 03:53:53PM +0200, Petr Machata wrote:
> This reverts commit 06954f715deb0ed053f8bf85547370db6870225d, which is
> commit 3d07b691ee707c00afaf365440975e81bb96cd9b upstream.
>
> The cited commit allows testptp to set a configurable clock_id. That is
> done via a PTP_SYS_OFFSET_EXTENDED ioctl call, whose argument is struct
> ptp_sys_offset_extended, where the clock_id is set. However, this Linux
> version does not support the ptp_sys_offset_extended.clockid field, and
> the test case cannot be built against this tree's own UAPI headers.
>
> The reverted commit was introduced to resolve a missing dependency of
> commit c6dc458227a3 ("testptp: Add option to open PHC in readonly mode"),
> which is 76868642e427 upstream. My suspicion is that the only conflict
> between the two is the getopt string, and there is otherwise no direct
> dependency between the two.
>
> This patch therefore reverts the cited commit, with hand-resolving the
> getopt string to include 'r' (as introduced by c6dc458227a3), but not
> 'y' (introduced by 06954f715deb).
>
> Reported-by: Yong Wang <yongwang@nvidia.com>
> Signed-off-by: Petr Machata <petrm@nvidia.com>
> ---
>
> Note: the issue appears to exist in 6.6, 6.12 and 6.18 as well.
> Depending on your preference, I can prepare separate
> patches for those branches as well. Let me know.
No need, I did it now for those branches too, thanks!
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 6.1.y] Revert "selftest/ptp: update ptp selftest to exercise the gettimex options"
2026-06-16 13:28 ` Greg KH
@ 2026-06-16 13:29 ` Greg KH
2026-06-17 15:22 ` Petr Machata
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2026-06-16 13:29 UTC (permalink / raw)
To: Petr Machata
Cc: Sasha Levin, stable, Wojtek Wasko, Mahesh Bandewar, Shuah Khan,
Richard Cochran, Yong Wang
On Tue, Jun 16, 2026 at 06:58:53PM +0530, Greg KH wrote:
> On Fri, May 15, 2026 at 03:53:53PM +0200, Petr Machata wrote:
> > This reverts commit 06954f715deb0ed053f8bf85547370db6870225d, which is
> > commit 3d07b691ee707c00afaf365440975e81bb96cd9b upstream.
> >
> > The cited commit allows testptp to set a configurable clock_id. That is
> > done via a PTP_SYS_OFFSET_EXTENDED ioctl call, whose argument is struct
> > ptp_sys_offset_extended, where the clock_id is set. However, this Linux
> > version does not support the ptp_sys_offset_extended.clockid field, and
> > the test case cannot be built against this tree's own UAPI headers.
> >
> > The reverted commit was introduced to resolve a missing dependency of
> > commit c6dc458227a3 ("testptp: Add option to open PHC in readonly mode"),
> > which is 76868642e427 upstream. My suspicion is that the only conflict
> > between the two is the getopt string, and there is otherwise no direct
> > dependency between the two.
> >
> > This patch therefore reverts the cited commit, with hand-resolving the
> > getopt string to include 'r' (as introduced by c6dc458227a3), but not
> > 'y' (introduced by 06954f715deb).
> >
> > Reported-by: Yong Wang <yongwang@nvidia.com>
> > Signed-off-by: Petr Machata <petrm@nvidia.com>
> > ---
> >
> > Note: the issue appears to exist in 6.6, 6.12 and 6.18 as well.
> > Depending on your preference, I can prepare separate
> > patches for those branches as well. Let me know.
>
> No need, I did it now for those branches too, thanks!
Oops, nope, spoke too soon, 6.18.y still needs it, this one doesn't
apply there. Can you send that revert?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 6.1.y] Revert "selftest/ptp: update ptp selftest to exercise the gettimex options"
2026-06-16 13:29 ` Greg KH
@ 2026-06-17 15:22 ` Petr Machata
2026-06-17 15:40 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Petr Machata @ 2026-06-17 15:22 UTC (permalink / raw)
To: Greg KH
Cc: Petr Machata, Sasha Levin, stable, Wojtek Wasko, Mahesh Bandewar,
Shuah Khan, Richard Cochran, Yong Wang
Greg KH <gregkh@linuxfoundation.org> writes:
> On Tue, Jun 16, 2026 at 06:58:53PM +0530, Greg KH wrote:
>> On Fri, May 15, 2026 at 03:53:53PM +0200, Petr Machata wrote:
>> > This reverts commit 06954f715deb0ed053f8bf85547370db6870225d, which is
>> > commit 3d07b691ee707c00afaf365440975e81bb96cd9b upstream.
>> >
>> > The cited commit allows testptp to set a configurable clock_id. That is
>> > done via a PTP_SYS_OFFSET_EXTENDED ioctl call, whose argument is struct
>> > ptp_sys_offset_extended, where the clock_id is set. However, this Linux
>> > version does not support the ptp_sys_offset_extended.clockid field, and
>> > the test case cannot be built against this tree's own UAPI headers.
>> >
>> > The reverted commit was introduced to resolve a missing dependency of
>> > commit c6dc458227a3 ("testptp: Add option to open PHC in readonly mode"),
>> > which is 76868642e427 upstream. My suspicion is that the only conflict
>> > between the two is the getopt string, and there is otherwise no direct
>> > dependency between the two.
>> >
>> > This patch therefore reverts the cited commit, with hand-resolving the
>> > getopt string to include 'r' (as introduced by c6dc458227a3), but not
>> > 'y' (introduced by 06954f715deb).
>> >
>> > Reported-by: Yong Wang <yongwang@nvidia.com>
>> > Signed-off-by: Petr Machata <petrm@nvidia.com>
>> > ---
>> >
>> > Note: the issue appears to exist in 6.6, 6.12 and 6.18 as well.
>> > Depending on your preference, I can prepare separate
>> > patches for those branches as well. Let me know.
>>
>> No need, I did it now for those branches too, thanks!
>
> Oops, nope, spoke too soon, 6.18.y still needs it, this one doesn't
> apply there. Can you send that revert?
My bad, 6.18 does appear to have the field already.
In fact, looking at 6.12, I see it as well. I am not sure why I thought
6.12 and 6.18 are impacted. I wonder if I looked at at 5.12 and 5.18 by
mistake.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 6.1.y] Revert "selftest/ptp: update ptp selftest to exercise the gettimex options"
2026-06-17 15:22 ` Petr Machata
@ 2026-06-17 15:40 ` Greg KH
2026-06-22 8:11 ` Petr Machata
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2026-06-17 15:40 UTC (permalink / raw)
To: Petr Machata
Cc: Sasha Levin, stable, Wojtek Wasko, Mahesh Bandewar, Shuah Khan,
Richard Cochran, Yong Wang
On Wed, Jun 17, 2026 at 05:22:44PM +0200, Petr Machata wrote:
>
> Greg KH <gregkh@linuxfoundation.org> writes:
>
> > On Tue, Jun 16, 2026 at 06:58:53PM +0530, Greg KH wrote:
> >> On Fri, May 15, 2026 at 03:53:53PM +0200, Petr Machata wrote:
> >> > This reverts commit 06954f715deb0ed053f8bf85547370db6870225d, which is
> >> > commit 3d07b691ee707c00afaf365440975e81bb96cd9b upstream.
> >> >
> >> > The cited commit allows testptp to set a configurable clock_id. That is
> >> > done via a PTP_SYS_OFFSET_EXTENDED ioctl call, whose argument is struct
> >> > ptp_sys_offset_extended, where the clock_id is set. However, this Linux
> >> > version does not support the ptp_sys_offset_extended.clockid field, and
> >> > the test case cannot be built against this tree's own UAPI headers.
> >> >
> >> > The reverted commit was introduced to resolve a missing dependency of
> >> > commit c6dc458227a3 ("testptp: Add option to open PHC in readonly mode"),
> >> > which is 76868642e427 upstream. My suspicion is that the only conflict
> >> > between the two is the getopt string, and there is otherwise no direct
> >> > dependency between the two.
> >> >
> >> > This patch therefore reverts the cited commit, with hand-resolving the
> >> > getopt string to include 'r' (as introduced by c6dc458227a3), but not
> >> > 'y' (introduced by 06954f715deb).
> >> >
> >> > Reported-by: Yong Wang <yongwang@nvidia.com>
> >> > Signed-off-by: Petr Machata <petrm@nvidia.com>
> >> > ---
> >> >
> >> > Note: the issue appears to exist in 6.6, 6.12 and 6.18 as well.
> >> > Depending on your preference, I can prepare separate
> >> > patches for those branches as well. Let me know.
> >>
> >> No need, I did it now for those branches too, thanks!
> >
> > Oops, nope, spoke too soon, 6.18.y still needs it, this one doesn't
> > apply there. Can you send that revert?
>
> My bad, 6.18 does appear to have the field already.
>
> In fact, looking at 6.12, I see it as well. I am not sure why I thought
> 6.12 and 6.18 are impacted. I wonder if I looked at at 5.12 and 5.18 by
> mistake.
So should this be dropped from 6.12?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 6.1.y] Revert "selftest/ptp: update ptp selftest to exercise the gettimex options"
2026-06-17 15:40 ` Greg KH
@ 2026-06-22 8:11 ` Petr Machata
0 siblings, 0 replies; 6+ messages in thread
From: Petr Machata @ 2026-06-22 8:11 UTC (permalink / raw)
To: Greg KH
Cc: Petr Machata, Sasha Levin, stable, Wojtek Wasko, Mahesh Bandewar,
Shuah Khan, Richard Cochran, Yong Wang
Greg KH <gregkh@linuxfoundation.org> writes:
> On Wed, Jun 17, 2026 at 05:22:44PM +0200, Petr Machata wrote:
>>
>> Greg KH <gregkh@linuxfoundation.org> writes:
>>
>> > On Tue, Jun 16, 2026 at 06:58:53PM +0530, Greg KH wrote:
>> >> On Fri, May 15, 2026 at 03:53:53PM +0200, Petr Machata wrote:
>> >> > This reverts commit 06954f715deb0ed053f8bf85547370db6870225d, which is
>> >> > commit 3d07b691ee707c00afaf365440975e81bb96cd9b upstream.
>> >> >
>> >> > The cited commit allows testptp to set a configurable clock_id. That is
>> >> > done via a PTP_SYS_OFFSET_EXTENDED ioctl call, whose argument is struct
>> >> > ptp_sys_offset_extended, where the clock_id is set. However, this Linux
>> >> > version does not support the ptp_sys_offset_extended.clockid field, and
>> >> > the test case cannot be built against this tree's own UAPI headers.
>> >> >
>> >> > The reverted commit was introduced to resolve a missing dependency of
>> >> > commit c6dc458227a3 ("testptp: Add option to open PHC in readonly mode"),
>> >> > which is 76868642e427 upstream. My suspicion is that the only conflict
>> >> > between the two is the getopt string, and there is otherwise no direct
>> >> > dependency between the two.
>> >> >
>> >> > This patch therefore reverts the cited commit, with hand-resolving the
>> >> > getopt string to include 'r' (as introduced by c6dc458227a3), but not
>> >> > 'y' (introduced by 06954f715deb).
>> >> >
>> >> > Reported-by: Yong Wang <yongwang@nvidia.com>
>> >> > Signed-off-by: Petr Machata <petrm@nvidia.com>
>> >> > ---
>> >> >
>> >> > Note: the issue appears to exist in 6.6, 6.12 and 6.18 as well.
>> >> > Depending on your preference, I can prepare separate
>> >> > patches for those branches as well. Let me know.
>> >>
>> >> No need, I did it now for those branches too, thanks!
>> >
>> > Oops, nope, spoke too soon, 6.18.y still needs it, this one doesn't
>> > apply there. Can you send that revert?
>>
>> My bad, 6.18 does appear to have the field already.
>> In fact, looking at 6.12, I see it as well.
>
> So should this be dropped from 6.12?
Yes.
I was AFK Thu+Fri last week, and it's now out including the revert.
I'll send a revert revert.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-06-22 9:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-15 13:53 [PATCH 6.1.y] Revert "selftest/ptp: update ptp selftest to exercise the gettimex options" Petr Machata
2026-06-16 13:28 ` Greg KH
2026-06-16 13:29 ` Greg KH
2026-06-17 15:22 ` Petr Machata
2026-06-17 15:40 ` Greg KH
2026-06-22 8:11 ` Petr Machata
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).