diff --git a/drivers/pps/clients/pps-gpio.c b/drivers/pps/clients/pps-gpio.c index 65d17781d..5ba2aaebe 100644 --- a/drivers/pps/clients/pps-gpio.c +++ b/drivers/pps/clients/pps-gpio.c @@ -156,6 +156,13 @@ get_irqf_trigger_flags(const struct pps_gpio_device_data *data) IRQF_TRIGGER_FALLING : IRQF_TRIGGER_RISING); } + /* The handler timestamps the pulse, so it has to run in hard-irq + * context. Under PREEMPT_RT it would otherwise be force-threaded and + * the timestamp taken after thread wakeup latency, adding microseconds + * of jitter to an edge that should be good to nanoseconds. + */ + flags |= IRQF_NO_THREAD; + return flags; }