From 2baa8dd2c849605165aa264287327ebd45ce3bcc Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Thu, 25 Jun 2026 14:31:52 +0200 Subject: [PATCH] Revert "ptp: add testptp mask test" This reverts commit 8510559c0fa1e228b18fcf77cfbcf5b970793a8a, which is commit 26285e689c6cd2cf3849568c83b2ebe53f467143 upstream. The reverted commit extends the selftest to test timestamp event queue mask manipulation in testptp. It exercises masks PTP_MASK_CLEAR_ALL and PTP_MASK_EN_SINGLE, introduced in commit c5a445b1e934 ("ptp: support event queue reader channel masks"), which is not on this stable branch. The test case thus cannot be built against this tree's own UAPI headers. The reverted commit was introduced to resolve a missing dependency of commit bef3a83a9a67 ("testptp: Add option to open PHC in readonly mode"), which is 76868642e427 upstream. 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 'F' (introduced by c1c50689799d). Reported-by: Yong Wang Signed-off-by: Petr Machata Signed-off-by: Sasha Levin --- tools/testing/selftests/ptp/testptp.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/tools/testing/selftests/ptp/testptp.c b/tools/testing/selftests/ptp/testptp.c index d78d52f028ab..84e86898f4b4 100644 --- a/tools/testing/selftests/ptp/testptp.c +++ b/tools/testing/selftests/ptp/testptp.c @@ -121,7 +121,6 @@ static void usage(char *progname) " -d name device to open\n" " -e val read 'val' external time stamp events\n" " -f val adjust the ptp clock frequency by 'val' ppb\n" - " -F chan Enable single channel mask and keep device open for debugfs verification.\n" " -g get the ptp clock time\n" " -h prints this message\n" " -i val index for event/trigger\n" @@ -190,7 +189,6 @@ int main(int argc, char *argv[]) int seconds = 0; int readonly = 0; int settime = 0; - int channel = -1; int64_t t1, t2, tp; int64_t interval, offset; @@ -200,7 +198,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:ghH:i:k:lL:n:o:p:P:rsSt:T:w:x:Xz"))) { switch (c) { case 'c': capabilities = 1; @@ -214,9 +212,6 @@ int main(int argc, char *argv[]) case 'f': adjfreq = atoi(optarg); break; - case 'F': - channel = atoi(optarg); - break; case 'g': gettime = 1; break; @@ -616,18 +611,6 @@ int main(int argc, char *argv[]) free(xts); } - if (channel >= 0) { - if (ioctl(fd, PTP_MASK_CLEAR_ALL)) { - perror("PTP_MASK_CLEAR_ALL"); - } else if (ioctl(fd, PTP_MASK_EN_SINGLE, (unsigned int *)&channel)) { - perror("PTP_MASK_EN_SINGLE"); - } else { - printf("Channel %d exclusively enabled. Check on debugfs.\n", channel); - printf("Press any key to continue\n."); - getchar(); - } - } - close(fd); return 0; }