]> git.ipfire.org Git - thirdparty/linux.git/commit
ptp: Enable auxiliary clocks for PTP_SYS_OFFSET_EXTENDED
authorThomas Gleixner <tglx@linutronix.de>
Tue, 1 Jul 2025 13:27:02 +0000 (15:27 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 3 Jul 2025 13:36:06 +0000 (15:36 +0200)
commit17c395bba1a3983b1b1918286979bae5f6851f33
treefe3e0b3d8d89a94c1063698c9a9b28999f11fc92
parent4c09a4cebd0320c5381afad3fb6f997f20082a3b
ptp: Enable auxiliary clocks for PTP_SYS_OFFSET_EXTENDED

Allow ioctl(PTP_SYS_OFFSET_EXTENDED*) to select CLOCK_AUX clock ids for
generating the pre and post hardware readout timestamps.

Aside of adding these clocks to the clock ID validation, this also requires
to check the timestamp to be valid, i.e. the seconds value being greater
than or equal zero. This is necessary because AUX clocks can be
asynchronously enabled or disabled, so there is no way to validate the
availability upfront.

The same could have been achieved by handing the return value of
ktime_get_aux_ts64() all the way down to the IOCTL call site, but that'd
require to modify all existing ptp::gettimex64() callbacks and their inner
call chains. The timestamp check achieves the same with less churn and less
complicated code all over the place.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Link: https://patch.msgid.link/20250701132628.491315452@linutronix.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/ptp/ptp_chardev.c