]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ptp: vmclock: support device notifications
authorBabis Chalios <bchalios@amazon.es>
Fri, 30 Jan 2026 17:36:01 +0000 (17:36 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 3 Feb 2026 02:06:00 +0000 (18:06 -0800)
commit3b1526ddb25452385b52f2588b655f524a57070b
tree7fb5eac20cb7b2b5041a724d7802ac339fb71338
parent3495064b6d65a669b409cfe1241db4f3c540251a
ptp: vmclock: support device notifications

Add optional support for device notifications in VMClock. When
supported, the hypervisor will send a device notification every time it
updates the seq_count to a new even value.

Moreover, add support for poll() in VMClock as a means to propagate this
notification to user space. poll() will return a POLLIN event to
listeners every time seq_count changes to a value different than the one
last seen (since open() or last read()/pread()). This means that when
poll() returns a POLLIN event, listeners need to use read() to observe
what has changed and update the reader's view of seq_count. In other
words, after a poll() returned, all subsequent calls to poll() will
immediately return with a POLLIN event until the listener calls read().

The device advertises support for the notification mechanism by setting
flag VMCLOCK_FLAG_NOTIFICATION_PRESENT in vmclock_abi flags field. If
the flag is not present the driver won't setup the ACPI notification
handler and poll() will always immediately return POLLHUP.

Signed-off-by: Babis Chalios <bchalios@amazon.es>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: Takahiro Itazuri <itazur@amazon.com>
Link: https://patch.msgid.link/20260130173704.12575-3-itazur@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/ptp/ptp_vmclock.c
include/uapi/linux/vmclock-abi.h