Skip to content

Commit fa84883

Browse files
Sebastian Andrzej SiewiorJassi Brar
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 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>
1 parent 60436eb commit fa84883

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
@@ -1172,14 +1172,6 @@ static int flexrm_debugfs_stats_show(struct seq_file *file, void *offset)
11721172

11731173
/* ====== FlexRM interrupt handler ===== */
11741174

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

0 commit comments

Comments
 (0)