powerpc: Add struct smp_ops_t.cause_nmi_ipi operation
authorNicholas Piggin <npiggin@gmail.com>
Mon, 19 Dec 2016 18:30:09 +0000 (04:30 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 28 Apr 2017 11:02:25 +0000 (21:02 +1000)
Have the NMI IPI code use this op when the platform defines it.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/smp.h
arch/powerpc/kernel/smp.c
arch/powerpc/platforms/85xx/smp.c
arch/powerpc/platforms/86xx/mpc86xx_smp.c
arch/powerpc/platforms/chrp/smp.c
arch/powerpc/platforms/powermac/smp.c
arch/powerpc/platforms/powernv/smp.c
arch/powerpc/platforms/pseries/smp.c

index 78c311ee0049908f124b1fb4d318f5721bab6053..ebddb2111d870cebec83b578c1e627c5300701a8 100644 (file)
@@ -42,6 +42,7 @@ struct smp_ops_t {
 #ifdef CONFIG_PPC_SMP_MUXED_IPI
        void  (*cause_ipi)(int cpu);
 #endif
+       int   (*cause_nmi_ipi)(int cpu);
        void  (*probe)(void);
        int   (*kick_cpu)(int nr);
        int   (*prepare_cpu)(int nr);
index 7461b195b29e21b012776ec3dbcd05ed7bffc9c1..b37973f11ce08cc8cfc9906a046fe09055977e5b 100644 (file)
@@ -417,6 +417,9 @@ out:
 
 static void do_smp_send_nmi_ipi(int cpu)
 {
+       if (smp_ops->cause_nmi_ipi && smp_ops->cause_nmi_ipi(cpu))
+               return;
+
        if (cpu >= 0) {
                do_message_pass(cpu, PPC_MSG_NMI_IPI);
        } else {
index 0975066f76e863d022abac12c25889571a819373..f51fd35f4618a777fd003fcfa991c03fa4f0e30d 100644 (file)
@@ -344,6 +344,7 @@ done:
 }
 
 struct smp_ops_t smp_85xx_ops = {
+       .cause_nmi_ipi = NULL,
        .kick_cpu = smp_85xx_kick_cpu,
        .cpu_bootable = smp_generic_cpu_bootable,
 #ifdef CONFIG_HOTPLUG_CPU
index af09baee22cbeceff92348b60111a154d978a246..020e84a47a32f925bf9fefda4a4e9db353cab628 100644 (file)
@@ -105,6 +105,7 @@ smp_86xx_setup_cpu(int cpu_nr)
 
 
 struct smp_ops_t smp_86xx_ops = {
+       .cause_nmi_ipi = NULL,
        .message_pass = smp_mpic_message_pass,
        .probe = smp_mpic_probe,
        .kick_cpu = smp_86xx_kick_cpu,
index b6c9a0dcc92485b6dbf07e1934d80a6a16d7264c..14515040f7cda00fa072a8203a0eefd0770806d6 100644 (file)
@@ -44,6 +44,7 @@ static void smp_chrp_setup_cpu(int cpu_nr)
 
 /* CHRP with openpic */
 struct smp_ops_t chrp_smp_ops = {
+       .cause_nmi_ipi = NULL,
        .message_pass = smp_mpic_message_pass,
        .probe = smp_mpic_probe,
        .kick_cpu = smp_chrp_kick_cpu,
index a3207cea360e5f04cb176fcb46faa2d7af1371d3..2cd99eb307621fffa044adddc66361b86f84ec89 100644 (file)
@@ -447,6 +447,7 @@ void __init smp_psurge_give_timebase(void)
 struct smp_ops_t psurge_smp_ops = {
        .message_pass   = NULL, /* Use smp_muxed_ipi_message_pass */
        .cause_ipi      = smp_psurge_cause_ipi,
+       .cause_nmi_ipi  = NULL,
        .probe          = smp_psurge_probe,
        .kick_cpu       = smp_psurge_kick_cpu,
        .setup_cpu      = smp_psurge_setup_cpu,
index 5189445db164295efd76ea4290aac91103353ce2..4aff754b6f2c8da6e94ae7dd5eedced19f95245e 100644 (file)
@@ -302,6 +302,7 @@ static void __init pnv_smp_probe(void)
 static struct smp_ops_t pnv_smp_ops = {
        .message_pass   = NULL, /* Use smp_muxed_ipi_message_pass */
        .cause_ipi      = NULL, /* Filled at runtime by pnv_smp_probe() */
+       .cause_nmi_ipi  = NULL,
        .probe          = pnv_smp_probe,
        .prepare_cpu    = pnv_smp_prepare_cpu,
        .kick_cpu       = pnv_smp_kick_cpu,
index 12ff5bef67fd80b0113062bd7f37b86ea7b9efe2..0925ac396b107ba11d692dd08ac1bd732a9fd7f7 100644 (file)
@@ -202,6 +202,7 @@ static __init void pSeries_smp_probe(void)
 static struct smp_ops_t pseries_smp_ops = {
        .message_pass   = NULL, /* Use smp_muxed_ipi_message_pass */
        .cause_ipi      = NULL, /* Filled at runtime by pSeries_smp_probe() */
+       .cause_nmi_ipi  = NULL,
        .probe          = pSeries_smp_probe,
        .kick_cpu       = smp_pSeries_kick_cpu,
        .setup_cpu      = smp_setup_cpu,