]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
powerpc/85xx: Setup secondary cores PIR with hard SMP id
authorKumar Gala <galak@kernel.crashing.org>
Thu, 13 Oct 2011 15:13:09 +0000 (10:13 -0500)
committerKumar Gala <galak@kernel.crashing.org>
Thu, 13 Oct 2011 15:19:22 +0000 (10:19 -0500)
Normally logical and hard cpu ID are the same, however in same cases like
on the P3060 they may differ.  Where the logical is 0..5, the hard id
goes 0,1,4..7.  This can causes issues for places we utilize PIR to index
into array like in debug exception handlers for finding the exception
stack.

Move to setting up PIR with hard_smp_processor_id fixes the issue.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/platforms/85xx/smp.c

index d6e47464a0d47099306028b0cad58886eb5ffa53..190d111fc117db57dea48271e591c9fa687fe427 100644 (file)
@@ -48,10 +48,11 @@ smp_85xx_kick_cpu(int nr)
        const u64 *cpu_rel_addr;
        __iomem u32 *bptr_vaddr;
        struct device_node *np;
-       int n = 0;
+       int n = 0, hw_cpu = get_hard_smp_processor_id(nr);
        int ioremappable;
 
-       WARN_ON (nr < 0 || nr >= NR_CPUS);
+       WARN_ON(nr < 0 || nr >= NR_CPUS);
+       WARN_ON(hw_cpu < 0 || hw_cpu >= NR_CPUS);
 
        pr_debug("smp_85xx_kick_cpu: kick CPU #%d\n", nr);
 
@@ -79,7 +80,7 @@ smp_85xx_kick_cpu(int nr)
 
        local_irq_save(flags);
 
-       out_be32(bptr_vaddr + BOOT_ENTRY_PIR, nr);
+       out_be32(bptr_vaddr + BOOT_ENTRY_PIR, hw_cpu);
 #ifdef CONFIG_PPC32
        out_be32(bptr_vaddr + BOOT_ENTRY_ADDR_LOWER, __pa(__early_start));
 
@@ -88,7 +89,7 @@ smp_85xx_kick_cpu(int nr)
                                (ulong)(bptr_vaddr + SIZE_BOOT_ENTRY));
 
        /* Wait a bit for the CPU to ack. */
-       while ((__secondary_hold_acknowledge != nr) && (++n < 1000))
+       while ((__secondary_hold_acknowledge != hw_cpu) && (++n < 1000))
                mdelay(1);
 #else
        smp_generic_kick_cpu(nr);