Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <maz@kernel.org>

+23 -2
+1 -1
drivers/irqchip/irq-apple-aic.c
··· 226 226 * Reading the interrupt reason automatically acknowledges and masks 227 227 * the IRQ, so we just unmask it here if needed. 228 228 */ 229 - if (!irqd_irq_disabled(d) && !irqd_irq_masked(d)) 229 + if (!irqd_irq_masked(d)) 230 230 aic_irq_unmask(d); 231 231 } 232 232
+22 -1
drivers/irqchip/irq-gic-v3.c
··· 100 100 DEFINE_STATIC_KEY_FALSE(gic_nonsecure_priorities); 101 101 EXPORT_SYMBOL(gic_nonsecure_priorities); 102 102 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 + 103 124 /* ppi_nmi_refs[n] == number of cpus having ppi[n + 16] set as NMI */ 104 125 static refcount_t *ppi_nmi_refs; 105 126 ··· 713 692 return; 714 693 715 694 if (gic_supports_nmi() && 716 - unlikely(gic_read_rpr() == GICD_INT_NMI_PRI)) { 695 + unlikely(gic_read_rpr() == GICD_INT_RPR_PRI(GICD_INT_NMI_PRI))) { 717 696 gic_handle_nmi(irqnr, regs); 718 697 return; 719 698 }