Skip to content

Commit f8e3347

Browse files
ozbenhmpe
authored andcommitted
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: d743618 ("powerpc/xics: Add ICP OPAL backend") Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent d81d825 commit f8e3347

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎arch/powerpc/sysdev/xics/icp-opal.c‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323

2424
static void icp_opal_teardown_cpu(void)
2525
{
26-
int cpu = smp_processor_id();
26+
int hw_cpu = hard_smp_processor_id();
2727

2828
/* Clear any pending IPI */
29-
opal_int_set_mfrr(cpu, 0xff);
29+
opal_int_set_mfrr(hw_cpu, 0xff);
3030
}
3131

3232
static void icp_opal_flush_ipi(void)
@@ -101,14 +101,16 @@ static void icp_opal_eoi(struct irq_data *d)
101101

102102
static void icp_opal_cause_ipi(int cpu, unsigned long data)
103103
{
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);
105107
}
106108

107109
static irqreturn_t icp_opal_ipi_action(int irq, void *dev_id)
108110
{
109-
int cpu = smp_processor_id();
111+
int hw_cpu = hard_smp_processor_id();
110112

111-
opal_int_set_mfrr(cpu, 0xff);
113+
opal_int_set_mfrr(hw_cpu, 0xff);
112114

113115
return smp_ipi_demux();
114116
}

0 commit comments

Comments
 (0)