linux/drivers/pps
Danish Khateeb 5b864f8db0 pps: generators: wake up PPS_GEN_FETCHEVENT readers on unregister
A reader sleeping in PPS_GEN_FETCHEVENT waits for the next event, but
no event comes after pps_gen_unregister_source(), so the reader sleeps
until it gets a signal. A PPS_GEN_FETCHEVENT issued after the
unregister sleeps the same way.

Wake up the readers on unregister, and make PPS_GEN_FETCHEVENT fail
with -ENODEV once the generator is gone, like the other ioctls. The
wait checks info without info_lock, so clear it with WRITE_ONCE().

Fixes: 86b525bed2 ("drivers pps: add PPS generators support")
Suggested-by: Rodolfo Giometti <giometti@enneenne.com>
Assisted-by: LLM
Signed-off-by: Danish Khateeb <danishkhateeb03@gmail.com>
Acked-by: Rodolfo Giometti <giometti@enneenne.com>
Link: https://patch.msgid.link/20260929124937.51114-5-danishkhateeb03@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01 15:45:00 +02:00
..
clients pps-gpio: remove dead capture_clear code 2026-08-03 21:10:10 -07:00
generators pps: generators: wake up PPS_GEN_FETCHEVENT readers on unregister 2026-10-01 15:45:00 +02:00
kapi.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
kc.c pps: don't allow PPS_KC_BIND on removed devices 2026-08-03 21:10:10 -07:00
kc.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile drivers pps: add PPS generators support 2025-01-08 13:18:09 +01:00
pps.c pps: don't try to wait for negative timeouts in PPS_FETCH 2026-08-03 21:10:10 -07:00
sysfs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00