diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index bc2d36b6b13b..dde1aa62ffe8 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -1473,6 +1473,13 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) if (!(new->flags & IRQF_TRIGGER_MASK)) new->flags |= irqd_get_trigger_type(&desc->irq_data); + /* + * IRQF_ONESHOT means the interrupt source in the IRQ chip will be + * masked until the threaded handled is done. If there is no thread + * handler then it makes no sense to have IRQF_ONESHOT. + */ + WARN_ON_ONCE(new->flags & IRQF_ONESHOT && !new->thread_fn); + /* * Check whether the interrupt nests into another interrupt * thread.