Skip to content

Commit acdcfd9

Browse files
author
Marc Zyngier
committed
Merge branch irq/misc-5.15 into irq/irqchip-next
* irq/misc-5.15: : . : Various irqchip fixes: : : - Fix edge interrupt support on loongson systems : - Advertise lack of wake-up logic on mtk-sysirq : - Fix mask tracking on the Apple AIC : - Correct priority reading of arm64 pseudo-NMI when SCR_EL3.FIQ==0 : . irqchip/gic-v3: Fix priority comparison when non-secure priorities are used irqchip/apple-aic: Fix irq_disable from within irq handlers Signed-off-by: Marc Zyngier <[email protected]>
2 parents cf39e60 + 8d474de commit acdcfd9

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

drivers/irqchip/irq-apple-aic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static void aic_irq_eoi(struct irq_data *d)
226226
* Reading the interrupt reason automatically acknowledges and masks
227227
* the IRQ, so we just unmask it here if needed.
228228
*/
229-
if (!irqd_irq_disabled(d) && !irqd_irq_masked(d))
229+
if (!irqd_irq_masked(d))
230230
aic_irq_unmask(d);
231231
}
232232

drivers/irqchip/irq-gic-v3.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,27 @@ EXPORT_SYMBOL(gic_pmr_sync);
100100
DEFINE_STATIC_KEY_FALSE(gic_nonsecure_priorities);
101101
EXPORT_SYMBOL(gic_nonsecure_priorities);
102102

103+
/*
104+
* When the Non-secure world has access to group 0 interrupts (as a
105+
* consequence of SCR_EL3.FIQ == 0), reading the ICC_RPR_EL1 register will
106+
* return the Distributor's view of the interrupt priority.
107+
*
108+
* When GIC security is enabled (GICD_CTLR.DS == 0), the interrupt priority
109+
* written by software is moved to the Non-secure range by the Distributor.
110+
*
111+
* If both are true (which is when gic_nonsecure_priorities gets enabled),
112+
* we need to shift down the priority programmed by software to match it
113+
* against the value returned by ICC_RPR_EL1.
114+
*/
115+
#define GICD_INT_RPR_PRI(priority) \
116+
({ \
117+
u32 __priority = (priority); \
118+
if (static_branch_unlikely(&gic_nonsecure_priorities)) \
119+
__priority = 0x80 | (__priority >> 1); \
120+
\
121+
__priority; \
122+
})
123+
103124
/* ppi_nmi_refs[n] == number of cpus having ppi[n + 16] set as NMI */
104125
static refcount_t *ppi_nmi_refs;
105126

@@ -692,7 +713,7 @@ static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs
692713
return;
693714

694715
if (gic_supports_nmi() &&
695-
unlikely(gic_read_rpr() == GICD_INT_NMI_PRI)) {
716+
unlikely(gic_read_rpr() == GICD_INT_RPR_PRI(GICD_INT_NMI_PRI))) {
696717
gic_handle_nmi(irqnr, regs);
697718
return;
698719
}

0 commit comments

Comments
 (0)