]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: imu: bmi160: add IRQF_NO_THREAD to data-ready trigger IRQ
authorRunyu Xiao <runyu.xiao@seu.edu.cn>
Thu, 4 Jun 2026 01:42:47 +0000 (09:42 +0800)
committerJonathan Cameron <jic23@kernel.org>
Mon, 29 Jun 2026 22:24:47 +0000 (23:24 +0100)
bmi160_probe_trigger() registers iio_trigger_generic_data_rdy_poll()
through devm_request_irq(), but it passes only irq_type and does not add
IRQF_NO_THREAD.

When the kernel is booted with forced IRQ threading, the parent IRQ can
otherwise be threaded by the IRQ core and the subsequent IIO trigger
child IRQ is dispatched from irq/... thread context instead of hardirq
context. Because the handler immediately pushes the event into
iio_trigger_poll(), this violates the hardirq-only IIO trigger helper
contract and can drive downstream trigger consumers through the wrong
execution context.

Add IRQF_NO_THREAD on top of irq_type when registering the BMI160 data-
ready trigger handler.

Fixes: 895bf81e6bbf ("iio:bmi160: add drdy interrupt support")
Cc: stable@vger.kernel.org
Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/imu/bmi160/bmi160_core.c

index 4abb83b75e2e87a7d83b2505d164cbd96ddad30b..86f6ecfd64aa2fbd6403705249a5111c82d7531a 100644 (file)
@@ -788,7 +788,8 @@ int bmi160_probe_trigger(struct iio_dev *indio_dev, int irq, u32 irq_type)
 
        ret = devm_request_irq(&indio_dev->dev, irq,
                               &iio_trigger_generic_data_rdy_poll,
-                              irq_type, "bmi160", data->trig);
+                              irq_type | IRQF_NO_THREAD,
+                              "bmi160", data->trig);
        if (ret)
                return ret;