Skip to content

Commit 03843d9

Browse files
Sebastian Andrzej SiewiorThomas Gleixner
authored andcommitted
mailbox: bcm-ferxrm-mailbox: Use default primary handler
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 flag 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: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20260128095540.863589-5-bigeasy@linutronix.de
1 parent 5bfcdcc commit 03843d9

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

drivers/mailbox/bcm-flexrm-mailbox.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,14 +1173,6 @@ static int flexrm_debugfs_stats_show(struct seq_file *file, void *offset)
11731173

11741174
/* ====== FlexRM interrupt handler ===== */
11751175

1176-
static irqreturn_t flexrm_irq_event(int irq, void *dev_id)
1177-
{
1178-
/* We only have MSI for completions so just wakeup IRQ thread */
1179-
/* Ring related errors will be informed via completion descriptors */
1180-
1181-
return IRQ_WAKE_THREAD;
1182-
}
1183-
11841176
static irqreturn_t flexrm_irq_thread(int irq, void *dev_id)
11851177
{
11861178
flexrm_process_completions(dev_id);
@@ -1271,10 +1263,8 @@ static int flexrm_startup(struct mbox_chan *chan)
12711263
ret = -ENODEV;
12721264
goto fail_free_cmpl_memory;
12731265
}
1274-
ret = request_threaded_irq(ring->irq,
1275-
flexrm_irq_event,
1276-
flexrm_irq_thread,
1277-
0, dev_name(ring->mbox->dev), ring);
1266+
ret = request_threaded_irq(ring->irq, NULL, flexrm_irq_thread,
1267+
IRQF_ONESHOT, dev_name(ring->mbox->dev), ring);
12781268
if (ret) {
12791269
dev_err(ring->mbox->dev,
12801270
"failed to request ring%d IRQ\n", ring->num);

0 commit comments

Comments
 (0)