Skip to content

Commit

Permalink
powerpc/xics/opal: Fix processor numbers in OPAL ICP
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benjamin Herrenschmidt authored and Michael Ellerman committed Sep 6, 2016
1 parent d81d825 commit f8e3347
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions arch/powerpc/sysdev/xics/icp-opal.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@

static void icp_opal_teardown_cpu(void)
{
int cpu = smp_processor_id();
int hw_cpu = hard_smp_processor_id();

/* Clear any pending IPI */
opal_int_set_mfrr(cpu, 0xff);
opal_int_set_mfrr(hw_cpu, 0xff);
}

static void icp_opal_flush_ipi(void)
Expand Down Expand Up @@ -101,14 +101,16 @@ static void icp_opal_eoi(struct irq_data *d)

static void icp_opal_cause_ipi(int cpu, unsigned long data)
{
opal_int_set_mfrr(cpu, IPI_PRIORITY);
int hw_cpu = get_hard_smp_processor_id(cpu);

opal_int_set_mfrr(hw_cpu, IPI_PRIORITY);
}

static irqreturn_t icp_opal_ipi_action(int irq, void *dev_id)
{
int cpu = smp_processor_id();
int hw_cpu = hard_smp_processor_id();

opal_int_set_mfrr(cpu, 0xff);
opal_int_set_mfrr(hw_cpu, 0xff);

return smp_ipi_demux();
}
Expand Down

0 comments on commit f8e3347

Please sign in to comment.