nuttx/drivers
dongjiuzhu1 3c486b98dd fs/timerfd: implement TFD_TIMER_CANCEL_ON_SET to detect clock changes
Implement Linux-compatible TFD_TIMER_CANCEL_ON_SET flag for timerfd to
allow applications to detect discontinuous changes to CLOCK_REALTIME.

Background:
According to Linux timerfd_create(2) man page, when a timerfd is created
with CLOCK_REALTIME and TFD_TIMER_CANCEL_ON_SET flag is specified, the
read() operation should fail with ECANCELED if the real-time clock
undergoes a discontinuous change. This allows applications to detect
and respond to system time changes.

Implementation:
1. Add clock notifier infrastructure (clock_notifier.h/c) to notify
   interested parties when system time changes
2. Implement TFD_TIMER_CANCEL_ON_SET flag support in timerfd
3. Register timerfd with clock notifier when flag is set
4. Cancel timer and return ECANCELED when clock change is detected
5. Notify clock changes in:
   - clock_settime()
   - clock_initialize()
   - clock_timekeeping_set_wall_time()
   - rpmsg_rtc time synchronization

Changes include:
- New files: include/nuttx/clock_notifier.h, sched/clock/clock_notifier.c
- Modified: fs/vfs/fs_timerfd.c to handle TFD_TIMER_CANCEL_ON_SET
- Modified: clock subsystem to call notifier chain on time changes
- Modified: rpmsg_rtc to notify time changes during sync

Use case example:
Applications using timerfd with absolute time can now detect when
system time is adjusted (e.g., NTP sync, manual time change) and
take appropriate action such as recalculating timeouts or updating
scheduled events.

Reference: https://man7.org/linux/man-pages/man2/timerfd_create.2.html

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-01-30 17:20:24 +08:00
..
1wire drivers/1wire/1wire_ds2xxx.h: add the driver for DS2XXX eeproms. 2025-10-10 08:55:45 +02:00
aie drivers: unify Private Types banners 2025-05-28 10:17:15 +08:00
analog drivers/analog/mcp47x6: fix configuration command 2026-01-22 00:12:37 +08:00
audio timers/oneshot: Remove all callback and args. 2025-11-18 13:02:29 +01:00
bch drivers/fs: Control the behavior of FTL by passing oflags during the open process. 2025-07-16 14:11:41 +08:00
can ctucanfd: increase rwcnt bitfield width and fix structure alignment 2026-01-17 12:43:48 +01:00
clk style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
contactless sched/sleep: replace all Signal-based sleep implement to Scheduled sleep 2025-10-17 14:05:02 +08:00
coresight arch | boards | drivers: fix whitespace issues for switch case statements 2025-05-23 10:48:41 +08:00
crypto sched/sleep: replace all Signal-based sleep implement to Scheduled sleep 2025-10-17 14:05:02 +08:00
devicetree style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
dma drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
dummy drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
eeprom mtd/at25ee: Use eeprom/spi_xx25xx internally 2025-12-17 19:03:54 +01:00
efuse drivers: unify Private Types banners 2025-05-28 10:17:15 +08:00
i2c drivers/i2c: add ioexpander-based lower-half implementation for I2C bit-bang 2026-01-01 17:08:47 +08:00
i2s drivers/i2s/i2schar: Implement blocking read/write operations 2025-08-27 11:07:05 +08:00
i3c Revert: "drivers/i3c: remove extra i3c_dev_register, do_daa has created them" 2025-12-09 08:23:46 -03:00
input drivers/input/ff: use small lock to replace enter_critical_section 2026-01-08 11:17:17 +08:00
ioexpander ioe_dummy: fix pinval always zero issue 2026-01-05 15:10:41 -03:00
ipcc style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
lcd lcd/ili9341: Improve initialization 2025-12-10 23:54:44 +08:00
leds drivers/leds: remove bo_closing as lu_lock can prevent race condition occurs 2026-01-08 11:17:17 +08:00
loop drivers/iovec: revert vector io implement from loop/null/zero driver 2025-01-22 11:29:39 +08:00
math drivers/math: use small lock to replace enter_critical_section 2026-01-08 11:17:17 +08:00
misc drivers/misc/optee: add missing addrenv header include 2026-01-16 09:04:12 -03:00
mmcsd drivers/mmcsd: fix typo, it should be "Byte" by spec 2026-01-16 01:38:29 +08:00
modem sched/sleep: replace all Signal-based sleep implement to Scheduled sleep 2025-10-17 14:05:02 +08:00
motor drivers/motor: use small lock to replace enter_critical_section 2026-01-08 11:17:17 +08:00
mtd mtdconfig/nvs: clean up block without valid data during GC 2026-01-29 14:56:19 +08:00
net net: access the serial port in raw format to avoid character escaping 2026-01-22 23:17:08 +08:00
note note: add NOTE_DUMP_BINARY support for binary log dumping 2026-01-27 21:56:03 +08:00
pci drivers/pci:fix pci_disable_irq/pci_enable_irq parameter 2026-01-30 12:50:42 +08:00
pinctrl drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
pipes drivers/pipe: fix POLLHUP handling in poll() 2026-01-22 22:09:01 +08:00
power power/battery: set interval to reduce report via ioctl 2025-12-22 09:15:56 -03:00
rc style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
regmap style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
reset style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
rf drivers/rf: migrate license to ASF 2024-11-06 19:46:13 +08:00
rmt drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
rpmsg drivers/rpmsg_port: support release the rx buffer in ept->cb 2026-01-29 09:26:50 -03:00
rptun drivers/rptun: it's not error when no carveout for virtio device 2026-01-19 14:18:27 +08:00
segger drivers/segger: Add a kconfig to override Segger SystemView target sources version 2025-07-22 23:21:31 +08:00
sensors drivers/sensors/gnss: Add monitor logs for activation 2026-01-29 21:20:03 +08:00
serial drivers/serial: fix crash when buffer is full and only recvbuf is implemented 2026-01-28 22:19:21 +08:00
spi sched/sleep: replace all Signal-based sleep implement to Scheduled sleep 2025-10-17 14:05:02 +08:00
syslog driver/ramlog: Implement the rate limiting function for ramlog driver. 2026-01-27 03:17:05 +08:00
thermal style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
timers fs/timerfd: implement TFD_TIMER_CANCEL_ON_SET to detect clock changes 2026-01-30 17:20:24 +08:00
usbdev Author: shichunma <masc2008@gmail.com> Date: Thu Jan 15 07:24:08 2026 +0800 2026-01-25 23:59:49 +08:00
usbhost drivers/usbhost_hidkbd: Fix small typo in usbhost_hidkbd.c 2026-01-18 11:57:58 -05:00
usbmisc sched/sleep: replace all Signal-based sleep implement to Scheduled sleep 2025-10-17 14:05:02 +08:00
usbmonitor sched/sleep: replace all Signal-based sleep implement to Scheduled sleep 2025-10-17 14:05:02 +08:00
usrsock usrsock_rpmsg_server.c: replace net_lock with conn_lock 2026-01-07 09:17:49 -03:00
vhost drivers/vhost-rng: fix the vhost-rng compile error 2026-01-19 14:18:27 +08:00
video boards/sim: Fix watchdog callback 2026-01-23 09:46:02 +08:00
virtio virtio/virtio-pci-modern: support PCI_RESOURCE_MEM_64 capability 2026-01-28 13:09:19 -03:00
wireless boards/sim: Fix watchdog callback 2026-01-23 09:46:02 +08:00
.gitignore
CMakeLists.txt drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
drivers_initialize.c drivers/net/rpmsgdrv.c: add bidirectional data netdev support, server side 2026-01-16 09:42:01 +08:00
Kconfig AI engine driver 2024-10-16 13:57:23 +08:00
Makefile drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00