Skip to content

Commit bb66523

Browse files
committed
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>
1 parent 8b1c42c commit bb66523

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

drivers/irqchip/irq-xtensa-mx.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ static void xtensa_mx_irq_ack(struct irq_data *d)
113113

114114
static int xtensa_mx_irq_retrigger(struct irq_data *d)
115115
{
116-
xtensa_set_sr(1 << d->hwirq, intset);
116+
unsigned int mask = 1u << d->hwirq;
117+
118+
if (WARN_ON(mask & ~XCHAL_INTTYPE_MASK_SOFTWARE))
119+
return 0;
120+
xtensa_set_sr(mask, intset);
117121
return 1;
118122
}
119123

drivers/irqchip/irq-xtensa-pic.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ static void xtensa_irq_ack(struct irq_data *d)
7070

7171
static int xtensa_irq_retrigger(struct irq_data *d)
7272
{
73-
xtensa_set_sr(1 << d->hwirq, intset);
73+
unsigned int mask = 1u << d->hwirq;
74+
75+
if (WARN_ON(mask & ~XCHAL_INTTYPE_MASK_SOFTWARE))
76+
return 0;
77+
xtensa_set_sr(mask, intset);
7478
return 1;
7579
}
7680

0 commit comments

Comments
 (0)