powerpc/xics/opal: Fix processor numbers in OPAL ICP

When using the OPAL ICP backend we incorrectly pass Linux CPU numbers
rather than HW CPU numbers to OPAL.

Fixes: d74361881f0d ("powerpc/xics: Add ICP OPAL backend")
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Benjamin Herrenschmidt and committed by
Michael Ellerman
f8e33475 d81d8258

+7 -5
+7 -5
arch/powerpc/sysdev/xics/icp-opal.c
··· 23 23 24 24 static void icp_opal_teardown_cpu(void) 25 25 { 26 - int cpu = smp_processor_id(); 26 + int hw_cpu = hard_smp_processor_id(); 27 27 28 28 /* Clear any pending IPI */ 29 - opal_int_set_mfrr(cpu, 0xff); 29 + opal_int_set_mfrr(hw_cpu, 0xff); 30 30 } 31 31 32 32 static void icp_opal_flush_ipi(void) ··· 101 101 102 102 static void icp_opal_cause_ipi(int cpu, unsigned long data) 103 103 { 104 - opal_int_set_mfrr(cpu, IPI_PRIORITY); 104 + int hw_cpu = get_hard_smp_processor_id(cpu); 105 + 106 + opal_int_set_mfrr(hw_cpu, IPI_PRIORITY); 105 107 } 106 108 107 109 static irqreturn_t icp_opal_ipi_action(int irq, void *dev_id) 108 110 { 109 - int cpu = smp_processor_id(); 111 + int hw_cpu = hard_smp_processor_id(); 110 112 111 - opal_int_set_mfrr(cpu, 0xff); 113 + opal_int_set_mfrr(hw_cpu, 0xff); 112 114 113 115 return smp_ipi_demux(); 114 116 }