From: Greg Kroah-Hartman Date: Mon, 22 Jun 2026 12:35:05 +0000 (+0200) Subject: 6.12-stable patches X-Git-Tag: v6.18.37~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=32d843b605e541ef89fa1f9f3d4a4222e706189d;p=thirdparty%2Fkernel%2Fstable-queue.git 6.12-stable patches added patches: reapply-selftest-ptp-update-ptp-selftest-to-exercise-the-gettimex-options.patch --- diff --git a/queue-6.12/reapply-selftest-ptp-update-ptp-selftest-to-exercise-the-gettimex-options.patch b/queue-6.12/reapply-selftest-ptp-update-ptp-selftest-to-exercise-the-gettimex-options.patch new file mode 100644 index 0000000000..330de5d85d --- /dev/null +++ b/queue-6.12/reapply-selftest-ptp-update-ptp-selftest-to-exercise-the-gettimex-options.patch @@ -0,0 +1,133 @@ +From petrm@nvidia.com Mon Jun 22 14:23:50 2026 +From: Petr Machata +Date: Mon, 22 Jun 2026 13:53:25 +0200 +Subject: Reapply "selftest/ptp: update ptp selftest to exercise the gettimex options" +To: Greg KH +Cc: Petr Machata , , Sasha Levin , Wojtek Wasko , Mahesh Bandewar , Shuah Khan , Richard Cochran +Message-ID: + +From: Petr Machata + +This reverts commit 6b2176a5c99b33f3c4acc04faadaa9c75da7b163, which in turn +reverts commit fa361565a7275cc43c6ca1abec9ec4fcc9ec51f1, which is commit +3d07b691ee707c00afaf365440975e81bb96cd9b upstream. + +The reason for the original revert was that struct ptp_sys_offset_extended +does not contain the field clock_id in 6.12.y. However the claim was false: +6.12.y does in fact contain the field. Reapply therefore the original +patch. + +Signed-off-by: Petr Machata +Signed-off-by: Greg Kroah-Hartman +--- + tools/testing/selftests/ptp/testptp.c | 62 +++++++++++++++++++++++++++++++--- + 1 file changed, 57 insertions(+), 5 deletions(-) + +--- a/tools/testing/selftests/ptp/testptp.c ++++ b/tools/testing/selftests/ptp/testptp.c +@@ -147,6 +147,7 @@ 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); + } +@@ -191,6 +192,7 @@ 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; +@@ -200,7 +202,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:Xz"))) { ++ while (EOF != (c = getopt(argc, argv, "cd:e:f:F:ghH:i:k:lL:n:o:p:P:rsSt:T:w:x:Xy:z"))) { + switch (c) { + case 'c': + capabilities = 1; +@@ -283,6 +285,21 @@ 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; +@@ -575,6 +592,7 @@ 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"); +@@ -583,12 +601,46 @@ int main(int argc, char *argv[]) + getextended); + + for (i = 0; i < getextended; i++) { +- printf("sample #%2d: system time before: %lld.%09u\n", +- i, soe->ts[i][0].sec, soe->ts[i][0].nsec); ++ 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(" phc time: %lld.%09u\n", + soe->ts[i][1].sec, soe->ts[i][1].nsec); +- printf(" system time after: %lld.%09u\n", +- soe->ts[i][2].sec, soe->ts[i][2].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; ++ } + } + } + diff --git a/queue-6.12/series b/queue-6.12/series index 49364e9f4e..0aacead6bc 100644 --- a/queue-6.12/series +++ b/queue-6.12/series @@ -19,3 +19,4 @@ eventpoll-fix-ep_remove-struct-eventpoll-struct-file.patch iio-light-bh1780-fix-pm-runtime-leak-on-error-path.patch net-drop-the-lock-in-skb_may_tx_timestamp.patch ip6_vti-set-netns_immutable-on-the-fallback-device.patch +reapply-selftest-ptp-update-ptp-selftest-to-exercise-the-gettimex-options.patch