Skip to content

Commit

Permalink
drivers/irqchip: xtensa: add warning to irq_retrigger
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Max Filippov committed Jan 26, 2019
1 parent 8b1c42c commit bb66523
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion drivers/irqchip/irq-xtensa-mx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
6 changes: 5 additions & 1 deletion drivers/irqchip/irq-xtensa-pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit bb66523

Please sign in to comment.