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

ARM: GIC: interface to send a SGI directly

The regular gic_raise_softirq() takes as input a CPU mask which is not
adequate when we need to send an IPI to a CPU which is not represented
in the kernel to GIC mapping. That is the case with the b.L switcher
when GIC migration to the inbound CPU has not yet occurred.

Signed-off-by: Nicolas Pitre <nico@linaro.org>

+15
+14
drivers/irqchip/irq-gic.c
··· 674 674 675 675 #ifdef CONFIG_BL_SWITCHER 676 676 /* 677 + * gic_send_sgi - send a SGI directly to given CPU interface number 678 + * 679 + * cpu_id: the ID for the destination CPU interface 680 + * irq: the IPI number to send a SGI for 681 + */ 682 + void gic_send_sgi(unsigned int cpu_id, unsigned int irq) 683 + { 684 + BUG_ON(cpu_id >= NR_GIC_CPU_IF); 685 + cpu_id = 1 << cpu_id; 686 + /* this always happens on GIC0 */ 687 + writel_relaxed((cpu_id << 16) | irq, gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT); 688 + } 689 + 690 + /* 677 691 * gic_get_cpu_id - get the CPU interface ID for the specified CPU 678 692 * 679 693 * @cpu: the logical CPU number to get the GIC ID for.
+1
include/linux/irqchip/arm-gic.h
··· 76 76 gic_init_bases(nr, start, dist, cpu, 0, NULL); 77 77 } 78 78 79 + void gic_send_sgi(unsigned int cpu_id, unsigned int irq); 79 80 int gic_get_cpu_id(unsigned int cpu); 80 81 void gic_migrate_target(unsigned int new_cpu_id); 81 82 unsigned long gic_get_sgir_physaddr(void);