diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2019-01-25 03:51:28 +0300 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2019-01-26 13:02:14 +0300 |
commit | bb6652363be0415578ec4a8794cbe9403db9c336 (patch) | |
tree | c316a722fccfb6a738ca4f5b72f9138f2ea06101 /drivers/irqchip | |
parent | 8b1c42cdd7181200dc1fff39dcb6ac1a3fac2c25 (diff) | |
download | linux-bb6652363be0415578ec4a8794cbe9403db9c336.tar.xz |
drivers/irqchip: xtensa: add warning to irq_retrigger
XEA2 and MX PIC can only retrigger software interrupts. Issue a warning
if an interrupt of any other type is retriggered.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'drivers/irqchip')
-rw-r--r-- | drivers/irqchip/irq-xtensa-mx.c | 6 | ||||
-rw-r--r-- | drivers/irqchip/irq-xtensa-pic.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/drivers/irqchip/irq-xtensa-mx.c b/drivers/irqchip/irq-xtensa-mx.c index 5385f5768345..0bd3fe3b969e 100644 --- a/drivers/irqchip/irq-xtensa-mx.c +++ b/drivers/irqchip/irq-xtensa-mx.c @@ -113,7 +113,11 @@ static void xtensa_mx_irq_ack(struct irq_data *d) static int xtensa_mx_irq_retrigger(struct irq_data *d) { - xtensa_set_sr(1 << d->hwirq, intset); + unsigned int mask = 1u << d->hwirq; + + if (WARN_ON(mask & ~XCHAL_INTTYPE_MASK_SOFTWARE)) + return 0; + xtensa_set_sr(mask, intset); return 1; } diff --git a/drivers/irqchip/irq-xtensa-pic.c b/drivers/irqchip/irq-xtensa-pic.c index c200234dd2c9..ab12328be5ee 100644 --- a/drivers/irqchip/irq-xtensa-pic.c +++ b/drivers/irqchip/irq-xtensa-pic.c @@ -70,7 +70,11 @@ static void xtensa_irq_ack(struct irq_data *d) static int xtensa_irq_retrigger(struct irq_data *d) { - xtensa_set_sr(1 << d->hwirq, intset); + unsigned int mask = 1u << d->hwirq; + + if (WARN_ON(mask & ~XCHAL_INTTYPE_MASK_SOFTWARE)) + return 0; + xtensa_set_sr(mask, intset); return 1; } |