linux-yocto/drivers/pps
Eliav Farber 54b7d6d358 pps: clients: gpio: fix interrupt handling order in remove path
[ Upstream commit 6bca1e9558 ]

The interrupt handler in pps_gpio_probe() is registered after calling
pps_register_source() using devm_request_irq(). However, in the
corresponding remove function, pps_unregister_source() is called before
the IRQ is freed, since devm-managed resources are released after the
remove function completes.

This creates a potential race condition where an interrupt may occur
after the PPS source is unregistered but before the handler is removed,
possibly leading to a kernel panic.

To prevent this, switch from devm-managed IRQ registration to manual
management by using request_irq() and calling free_irq() explicitly in
the remove path before unregistering the PPS source. This ensures the
interrupt handler is safely removed before deactivating the PPS source.

Signed-off-by: Eliav Farber <farbere@amazon.com>
Link: https://lore.kernel.org/r/20250527053355.37185-1-farbere@amazon.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-08-20 18:41:01 +02:00
..
clients pps: clients: gpio: fix interrupt handling order in remove path 2025-08-20 18:41:01 +02:00
generators pps: generators: tio: fix platform_set_drvdata() 2025-04-15 18:22:32 +02:00
kapi.c pps: Fix a use-after-free 2025-01-07 15:16:48 +01:00
kc.c pps: Fix a use-after-free 2025-01-07 15:16:48 +01: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: fix poll support 2025-08-15 16:38:30 +02:00
sysfs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00