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

irqchip/gic, gic-v3: Make SGIs use handle_percpu_devid_irq()

handle_percpu_devid_fasteoi_ipi() states:

* The biggest difference with the IRQ version is that the interrupt is
* EOIed early, as the IPI could result in a context switch, and we need to
* make sure the IPI can fire again

All that can actually happen scheduler-wise within the handling of an IPI
is the raising of TIF_NEED_RESCHED (and / or folding thereof into
preempt_count); see scheduler_ipi() or sched_ttwu_pending() for instance.

Said flag / preempt_count is evaluated some time later before returning to
whatever context was interrupted, and this gates a call to
preempt_schedule_irq() (arm64_preempt_schedule_irq() in arm64).

Per the above, SGI's do not need a different handler than PPI's, so make
them use the same (handle_percpu_devid_irq).

Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20201109094121.29975-2-valentin.schneider@arm.com

authored by

Valentin Schneider and committed by
Marc Zyngier
6abbd698 550c1424

+1 -13
-6
drivers/irqchip/irq-gic-v3.c
··· 1302 1302 1303 1303 switch (__get_intid_range(hw)) { 1304 1304 case SGI_RANGE: 1305 - irq_set_percpu_devid(irq); 1306 - irq_domain_set_info(d, irq, hw, chip, d->host_data, 1307 - handle_percpu_devid_fasteoi_ipi, 1308 - NULL, NULL); 1309 - break; 1310 - 1311 1305 case PPI_RANGE: 1312 1306 case EPPI_RANGE: 1313 1307 irq_set_percpu_devid(irq);
+1 -7
drivers/irqchip/irq-gic.c
··· 1005 1005 struct irq_data *irqd = irq_desc_get_irq_data(irq_to_desc(irq)); 1006 1006 1007 1007 switch (hw) { 1008 - case 0 ... 15: 1009 - irq_set_percpu_devid(irq); 1010 - irq_domain_set_info(d, irq, hw, &gic->chip, d->host_data, 1011 - handle_percpu_devid_fasteoi_ipi, 1012 - NULL, NULL); 1013 - break; 1014 - case 16 ... 31: 1008 + case 0 ... 31: 1015 1009 irq_set_percpu_devid(irq); 1016 1010 irq_domain_set_info(d, irq, hw, &gic->chip, d->host_data, 1017 1011 handle_percpu_devid_irq, NULL, NULL);