Skip to content

Commit

Permalink
powerpc/cell: Fix crash in iic_setup_cpu() after per_cpu changes
Browse files Browse the repository at this point in the history
The conversion from __get_cpu_var() to this_cpu_ptr() in iic_setup_cpu()
is wrong. It causes an oops at boot.

We need the per-cpu address of struct cpu_iic, not cpu_iic.regs->prio.

Sparse noticed this, because we pass a non-iomem pointer to out_be64(),
but we obviously don't check the sparse results often enough.

Fixes: 69111ba ("powerpc: Replace __get_cpu_var uses")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Michael Ellerman committed Apr 10, 2015
1 parent 7e862d7 commit b0dd00a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/cell/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static unsigned int iic_get_irq(void)

void iic_setup_cpu(void)
{
out_be64(this_cpu_ptr(&cpu_iic.regs->prio), 0xff);
out_be64(&this_cpu_ptr(&cpu_iic)->regs->prio, 0xff);
}

u8 iic_get_target_id(int cpu)
Expand Down

0 comments on commit b0dd00a

Please sign in to comment.