Skip to content

Commit 979292a

Browse files
committed
Merge tag 'irqchip-fixes-5.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/urgent
Pull irqchip fixes from Marc Zyngier: - Address an issue with the SiFive PLIC being unable to EOI a masked interrupt - Move the disable/enable methods in the CSky mpintc to mask/unmask - Fix a regression in the OF irq code where an interrupt-controller property in the same node as an interrupt-map property would get ignored Link: https://lore.kernel.org/all/[email protected]
2 parents 3735459 + 10a20b3 commit 979292a

File tree

3 files changed

+27
-8
lines changed

3 files changed

+27
-8
lines changed

drivers/irqchip/irq-csky-mpintc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static void csky_mpintc_handler(struct pt_regs *regs)
7878
readl_relaxed(reg_base + INTCL_RDYIR));
7979
}
8080

81-
static void csky_mpintc_enable(struct irq_data *d)
81+
static void csky_mpintc_unmask(struct irq_data *d)
8282
{
8383
void __iomem *reg_base = this_cpu_read(intcl_reg);
8484

@@ -87,7 +87,7 @@ static void csky_mpintc_enable(struct irq_data *d)
8787
writel_relaxed(d->hwirq, reg_base + INTCL_SENR);
8888
}
8989

90-
static void csky_mpintc_disable(struct irq_data *d)
90+
static void csky_mpintc_mask(struct irq_data *d)
9191
{
9292
void __iomem *reg_base = this_cpu_read(intcl_reg);
9393

@@ -164,8 +164,8 @@ static int csky_irq_set_affinity(struct irq_data *d,
164164
static struct irq_chip csky_irq_chip = {
165165
.name = "C-SKY SMP Intc",
166166
.irq_eoi = csky_mpintc_eoi,
167-
.irq_enable = csky_mpintc_enable,
168-
.irq_disable = csky_mpintc_disable,
167+
.irq_unmask = csky_mpintc_unmask,
168+
.irq_mask = csky_mpintc_mask,
169169
.irq_set_type = csky_mpintc_set_type,
170170
#ifdef CONFIG_SMP
171171
.irq_set_affinity = csky_irq_set_affinity,

drivers/irqchip/irq-sifive-plic.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,13 @@ static void plic_irq_eoi(struct irq_data *d)
163163
{
164164
struct plic_handler *handler = this_cpu_ptr(&plic_handlers);
165165

166-
writel(d->hwirq, handler->hart_base + CONTEXT_CLAIM);
166+
if (irqd_irq_masked(d)) {
167+
plic_irq_unmask(d);
168+
writel(d->hwirq, handler->hart_base + CONTEXT_CLAIM);
169+
plic_irq_mask(d);
170+
} else {
171+
writel(d->hwirq, handler->hart_base + CONTEXT_CLAIM);
172+
}
167173
}
168174

169175
static struct irq_chip plic_chip = {

drivers/of/irq.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,10 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq)
161161
* if it is then we are done, unless there is an
162162
* interrupt-map which takes precedence.
163163
*/
164+
bool intc = of_property_read_bool(ipar, "interrupt-controller");
165+
164166
imap = of_get_property(ipar, "interrupt-map", &imaplen);
165-
if (imap == NULL &&
166-
of_property_read_bool(ipar, "interrupt-controller")) {
167+
if (imap == NULL && intc) {
167168
pr_debug(" -> got it !\n");
168169
return 0;
169170
}
@@ -244,8 +245,20 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq)
244245

245246
pr_debug(" -> imaplen=%d\n", imaplen);
246247
}
247-
if (!match)
248+
if (!match) {
249+
if (intc) {
250+
/*
251+
* The PASEMI Nemo is a known offender, so
252+
* let's only warn for anyone else.
253+
*/
254+
WARN(!IS_ENABLED(CONFIG_PPC_PASEMI),
255+
"%pOF interrupt-map failed, using interrupt-controller\n",
256+
ipar);
257+
return 0;
258+
}
259+
248260
goto fail;
261+
}
249262

250263
/*
251264
* Successfully parsed an interrrupt-map translation; copy new

0 commit comments

Comments
 (0)