From: Marc Zyngier Date: Thu, 17 Sep 2020 15:50:02 +0000 (+0100) Subject: Merge remote-tracking branch 'origin/irq/gic-retrigger' into irq/irqchip-next X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=eff65bd43958fbb9a2912a1e2069e32057d2accc;p=linux.git Merge remote-tracking branch 'origin/irq/gic-retrigger' into irq/irqchip-next Signed-off-by: Marc Zyngier --- eff65bd43958fbb9a2912a1e2069e32057d2accc diff --cc drivers/irqchip/irq-gic.c index 30edcca627d60,b59bcef69bf31..6053245a4754c --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@@ -326,6 -325,33 +326,11 @@@ static int gic_irq_set_vcpu_affinity(st return 0; } -#ifdef CONFIG_SMP -static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, - bool force) -{ - void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + gic_irq(d); - unsigned int cpu; - - if (!force) - cpu = cpumask_any_and(mask_val, cpu_online_mask); - else - cpu = cpumask_first(mask_val); - - if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids) - return -EINVAL; - - writeb_relaxed(gic_cpu_map[cpu], reg); - irq_data_update_effective_affinity(d, cpumask_of(cpu)); - - return IRQ_SET_MASK_OK_DONE; -} -#endif - + static int gic_retrigger(struct irq_data *data) + { + return !gic_irq_set_irqchip_state(data, IRQCHIP_STATE_PENDING, true); + } + static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs) { u32 irqstat, irqnr; @@@ -996,15 -975,9 +1002,16 @@@ static int gic_irq_domain_map(struct ir irq_hw_number_t hw) { struct gic_chip_data *gic = d->host_data; + struct irq_data *irqd = irq_desc_get_irq_data(irq_to_desc(irq)); - if (hw < 32) { + switch (hw) { + case 0 ... 15: + irq_set_percpu_devid(irq); + irq_domain_set_info(d, irq, hw, &gic->chip, d->host_data, + handle_percpu_devid_fasteoi_ipi, + NULL, NULL); + break; + case 16 ... 31: irq_set_percpu_devid(irq); irq_domain_set_info(d, irq, hw, &gic->chip, d->host_data, handle_percpu_devid_irq, NULL, NULL); @@@ -1013,9 -985,11 +1020,12 @@@ irq_domain_set_info(d, irq, hw, &gic->chip, d->host_data, handle_fasteoi_irq, NULL, NULL); irq_set_probe(irq); - irqd_set_single_target(irq_desc_get_irq_data(irq_to_desc(irq))); + irqd_set_single_target(irqd); + break; } + + /* Prevents SW retriggers which mess up the ACK/EOI ordering */ + irqd_set_handle_enforce_irqctx(irqd); return 0; }