Skip to content

Commit

Permalink
regmap-irq: set IRQF_ONESHOT flag to ensure IRQ request
Browse files Browse the repository at this point in the history
Since commit 1c6c695 ("genirq: Reject
bogus threaded irq requests") threaded IRQs without a primary handler
need to be requested with IRQF_ONESHOT, otherwise the request will fail.

The %irq_flags flag is used to request the threaded IRQ and is also a
parameter of the caller.  Hence, we cannot be sure that IRQF_ONESHOT is
set.  This change avoids the potentially missing flag by setting
IRQF_ONESHOT when requesting the threaded IRQ.

Generated by: scripts/coccinelle/misc/irqf_oneshot.cocci

Signed-off-by: Valentin Rothberg <Valentin.Rothberg@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Valentin Rothberg authored and Mark Brown committed Feb 14, 2015
1 parent bfa76d4 commit 09cadf6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/base/regmap/regmap-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,8 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
goto err_alloc;
}

ret = request_threaded_irq(irq, NULL, regmap_irq_thread, irq_flags,
ret = request_threaded_irq(irq, NULL, regmap_irq_thread,
irq_flags | IRQF_ONESHOT,
chip->name, d);
if (ret != 0) {
dev_err(map->dev, "Failed to request IRQ %d for %s: %d\n",
Expand Down

0 comments on commit 09cadf6

Please sign in to comment.