soc: ti: knav_qmss_queue: Use IRQF_NO_AUTOEN flag in request_irq()
authorJinjie Ruan <ruanjinjie@huawei.com>
Sat, 14 Sep 2024 08:25:32 +0000 (16:25 +0800)
committerNishanth Menon <nm@ti.com>
Fri, 25 Oct 2024 13:58:18 +0000 (08:58 -0500)
As commit cbe16f35bee6 ("genirq: Add IRQF_NO_AUTOEN for request_irq/nmi()")
said, reqeust_irq() and then disable_irq() is unsafe. In the small time gap
between request_irq() and disable_irq(), interrupts can still come.

IRQF_NO_AUTOEN flag can be used by drivers to request_irq(). It prevents
the automatic enabling of the requested interrupt in the same
safe way. With that the usage can be simplified and corrected.

Compile-tested only.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20240914082532.344456-1-ruanjinjie@huawei.com
Signed-off-by: Nishanth Menon <nm@ti.com>
drivers/soc/ti/knav_qmss_queue.c

index 6c98738..c099f9e 100644 (file)
@@ -119,11 +119,10 @@ static int knav_queue_setup_irq(struct knav_range_info *range,
 
        if (range->flags & RANGE_HAS_IRQ) {
                irq = range->irqs[queue].irq;
-               ret = request_irq(irq, knav_queue_int_handler, 0,
-                                       inst->irq_name, inst);
+               ret = request_irq(irq, knav_queue_int_handler, IRQF_NO_AUTOEN,
+                                 inst->irq_name, inst);
                if (ret)
                        return ret;
-               disable_irq(irq);
                if (range->irqs[queue].cpu_mask) {
                        ret = irq_set_affinity_hint(irq, range->irqs[queue].cpu_mask);
                        if (ret) {