]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mailbox: bcm-ferxrm-mailbox: Use default primary handler
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Wed, 28 Jan 2026 09:55:24 +0000 (10:55 +0100)
committerJassi Brar <jassisinghbrar@gmail.com>
Mon, 2 Feb 2026 00:48:20 +0000 (18:48 -0600)
request_threaded_irq() is invoked with a primary and a secondary handler
and no flags are passed. The primary handler is the same as
irq_default_primary_handler() so there is no need to have an identical
copy.
The lack of the IRQF_ONESHOT can be dangerous because the interrupt
source is not masked while the threaded handler is active. This means,
especially on LEVEL typed interrupt lines, the interrupt can fire again
before the threaded handler had a chance to run.

Use the default primary interrupt handler by specifying NULL and set
IRQF_ONESHOT so the interrupt source is masked until the secondary
handler is done.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
drivers/mailbox/bcm-flexrm-mailbox.c

index 5d278bb5a4c0635dfc46b4a6dc3addf0b3b5d1be..04c47eadf950b383669681a87cbd10f0ce1f0e63 100644 (file)
@@ -1172,14 +1172,6 @@ static int flexrm_debugfs_stats_show(struct seq_file *file, void *offset)
 
 /* ====== FlexRM interrupt handler ===== */
 
-static irqreturn_t flexrm_irq_event(int irq, void *dev_id)
-{
-       /* We only have MSI for completions so just wakeup IRQ thread */
-       /* Ring related errors will be informed via completion descriptors */
-
-       return IRQ_WAKE_THREAD;
-}
-
 static irqreturn_t flexrm_irq_thread(int irq, void *dev_id)
 {
        flexrm_process_completions(dev_id);
@@ -1270,10 +1262,8 @@ static int flexrm_startup(struct mbox_chan *chan)
                ret = -ENODEV;
                goto fail_free_cmpl_memory;
        }
-       ret = request_threaded_irq(ring->irq,
-                                  flexrm_irq_event,
-                                  flexrm_irq_thread,
-                                  0, dev_name(ring->mbox->dev), ring);
+       ret = request_threaded_irq(ring->irq, NULL, flexrm_irq_thread,
+                                  IRQF_ONESHOT, dev_name(ring->mbox->dev), ring);
        if (ret) {
                dev_err(ring->mbox->dev,
                        "failed to request ring%d IRQ\n", ring->num);