From: Vineet Gupta Date: Wed, 14 Oct 2015 09:08:02 +0000 (+0530) Subject: ARC: smp: Introduce smp hook @init_irq_cpu called for all cores X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=286130ebf196d9643800977d57bdb7cda266b49e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ARC: smp: Introduce smp hook @init_irq_cpu called for all cores Note this is not part of platform owned static machine_desc, but more of device owned plat_smp_ops (rather misnamed) which a IPI provider or some such typically defines. This will help us seperate out the IPI registration from platform specific init_cpu_smp() into device specific init_irq_cpu() Signed-off-by: Vineet Gupta --- diff --git a/arch/arc/include/asm/smp.h b/arch/arc/include/asm/smp.h index 5ea4cf8cd1a8..133c867d15af 100644 --- a/arch/arc/include/asm/smp.h +++ b/arch/arc/include/asm/smp.h @@ -48,6 +48,8 @@ extern int smp_ipi_irq_setup(int cpu, int irq); * @init_early_smp: A SMP specific h/w block can init itself * Could be common across platforms so not covered by * mach_desc->init_early() + * @init_irq_cpu: Called for each core so SMP h/w block driver can do + * any needed setup per cpu (e.g. IPI request) * @cpu_kick: For Master to kickstart a cpu (optionally at a PC) * @ipi_send: To send IPI to a @cpu * @ips_clear: To clear IPI received at @irq @@ -55,6 +57,7 @@ extern int smp_ipi_irq_setup(int cpu, int irq); struct plat_smp_ops { const char *info; void (*init_early_smp)(void); + void (*init_irq_cpu)(int cpu); void (*cpu_kick)(int cpu, unsigned long pc); void (*ipi_send)(int cpu); void (*ipi_clear)(int irq); diff --git a/arch/arc/kernel/irq.c b/arch/arc/kernel/irq.c index 1dd8f2685afc..2ee226546c6a 100644 --- a/arch/arc/kernel/irq.c +++ b/arch/arc/kernel/irq.c @@ -10,6 +10,7 @@ #include #include #include +#include /* * Late Interrupt system init called from start_kernel for Boot CPU only @@ -27,7 +28,10 @@ void __init init_IRQ(void) irqchip_init(); #ifdef CONFIG_SMP - /* Master CPU can initialize it's side of IPI */ + /* a SMP H/w block could do IPI IRQ request here */ + if (plat_smp_ops.init_irq_cpu) + plat_smp_ops.init_irq_cpu(smp_processor_id()); + if (machine_desc->init_cpu_smp) machine_desc->init_cpu_smp(smp_processor_id()); #endif diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c index 35ee18f1de58..580587805fa3 100644 --- a/arch/arc/kernel/smp.c +++ b/arch/arc/kernel/smp.c @@ -131,6 +131,10 @@ void start_kernel_secondary(void) pr_info("## CPU%u LIVE ##: Executing Code...\n", cpu); + /* Some SMP H/w setup - for each cpu */ + if (plat_smp_ops.init_irq_cpu) + plat_smp_ops.init_irq_cpu(cpu); + if (machine_desc->init_cpu_smp) machine_desc->init_cpu_smp(cpu);