diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-09 14:53:07 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-09 14:53:07 -0500 |
commit | 29a41e9e029d21c306e3ad6e723700348b04706a (patch) | |
tree | 3c7f807016a1e16c70992bbcba1269ac4cfe2fa5 /arch/parisc/kernel/smp.c | |
parent | d9e8a3a5b8298a3c814ed37ac5756e6f67b6be41 (diff) | |
parent | ae16489eb1175066c8f3008fc3c0396c525e1906 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6:
parisc: export length of os_hpmc vector
parisc: fix kernel crash (protection id trap) when compiling ruby1.9
parisc: Use DEFINE_SPINLOCK
parisc: add uevent helper for parisc bus
parisc: fix ipv6 checksum
parisc: quiet palo not-found message from "which"
parisc: Replace NR_CPUS in parisc code
parisc: trivial fixes
parisc: fix braino in commit adding __space_to_prot
parisc: factor out sid to protid conversion
parisc: use leX_to_cpu in place of __fswabX
parisc: fix GFP_KERNEL use while atomic in unwinder
parisc: remove dead BIO_VMERGE_BOUNDARY and BIO_VMERGE_MAX_SIZE definitions
parisc: set_time() catch errors
parisc: use the new byteorder headers
parisc: drivers/parisc/: make code static
parisc: lib/: make code static
Diffstat (limited to 'arch/parisc/kernel/smp.c')
-rw-r--r-- | arch/parisc/kernel/smp.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c index 80bc000523fa..9995d7ed5819 100644 --- a/arch/parisc/kernel/smp.c +++ b/arch/parisc/kernel/smp.c | |||
@@ -56,16 +56,17 @@ static int smp_debug_lvl = 0; | |||
56 | if (lvl >= smp_debug_lvl) \ | 56 | if (lvl >= smp_debug_lvl) \ |
57 | printk(printargs); | 57 | printk(printargs); |
58 | #else | 58 | #else |
59 | #define smp_debug(lvl, ...) | 59 | #define smp_debug(lvl, ...) do { } while(0) |
60 | #endif /* DEBUG_SMP */ | 60 | #endif /* DEBUG_SMP */ |
61 | 61 | ||
62 | DEFINE_SPINLOCK(smp_lock); | 62 | DEFINE_SPINLOCK(smp_lock); |
63 | 63 | ||
64 | volatile struct task_struct *smp_init_current_idle_task; | 64 | volatile struct task_struct *smp_init_current_idle_task; |
65 | 65 | ||
66 | static volatile int cpu_now_booting __read_mostly = 0; /* track which CPU is booting */ | 66 | /* track which CPU is booting */ |
67 | static volatile int cpu_now_booting __cpuinitdata; | ||
67 | 68 | ||
68 | static int parisc_max_cpus __read_mostly = 1; | 69 | static int parisc_max_cpus __cpuinitdata = 1; |
69 | 70 | ||
70 | DEFINE_PER_CPU(spinlock_t, ipi_lock) = SPIN_LOCK_UNLOCKED; | 71 | DEFINE_PER_CPU(spinlock_t, ipi_lock) = SPIN_LOCK_UNLOCKED; |
71 | 72 | ||
@@ -123,7 +124,7 @@ irqreturn_t | |||
123 | ipi_interrupt(int irq, void *dev_id) | 124 | ipi_interrupt(int irq, void *dev_id) |
124 | { | 125 | { |
125 | int this_cpu = smp_processor_id(); | 126 | int this_cpu = smp_processor_id(); |
126 | struct cpuinfo_parisc *p = &cpu_data[this_cpu]; | 127 | struct cpuinfo_parisc *p = &per_cpu(cpu_data, this_cpu); |
127 | unsigned long ops; | 128 | unsigned long ops; |
128 | unsigned long flags; | 129 | unsigned long flags; |
129 | 130 | ||
@@ -202,13 +203,13 @@ ipi_interrupt(int irq, void *dev_id) | |||
202 | static inline void | 203 | static inline void |
203 | ipi_send(int cpu, enum ipi_message_type op) | 204 | ipi_send(int cpu, enum ipi_message_type op) |
204 | { | 205 | { |
205 | struct cpuinfo_parisc *p = &cpu_data[cpu]; | 206 | struct cpuinfo_parisc *p = &per_cpu(cpu_data, cpu); |
206 | spinlock_t *lock = &per_cpu(ipi_lock, cpu); | 207 | spinlock_t *lock = &per_cpu(ipi_lock, cpu); |
207 | unsigned long flags; | 208 | unsigned long flags; |
208 | 209 | ||
209 | spin_lock_irqsave(lock, flags); | 210 | spin_lock_irqsave(lock, flags); |
210 | p->pending_ipi |= 1 << op; | 211 | p->pending_ipi |= 1 << op; |
211 | gsc_writel(IPI_IRQ - CPU_IRQ_BASE, cpu_data[cpu].hpa); | 212 | gsc_writel(IPI_IRQ - CPU_IRQ_BASE, p->hpa); |
212 | spin_unlock_irqrestore(lock, flags); | 213 | spin_unlock_irqrestore(lock, flags); |
213 | } | 214 | } |
214 | 215 | ||
@@ -224,10 +225,7 @@ send_IPI_mask(cpumask_t mask, enum ipi_message_type op) | |||
224 | static inline void | 225 | static inline void |
225 | send_IPI_single(int dest_cpu, enum ipi_message_type op) | 226 | send_IPI_single(int dest_cpu, enum ipi_message_type op) |
226 | { | 227 | { |
227 | if (dest_cpu == NO_PROC_ID) { | 228 | BUG_ON(dest_cpu == NO_PROC_ID); |
228 | BUG(); | ||
229 | return; | ||
230 | } | ||
231 | 229 | ||
232 | ipi_send(dest_cpu, op); | 230 | ipi_send(dest_cpu, op); |
233 | } | 231 | } |
@@ -309,8 +307,7 @@ smp_cpu_init(int cpunum) | |||
309 | /* Initialise the idle task for this CPU */ | 307 | /* Initialise the idle task for this CPU */ |
310 | atomic_inc(&init_mm.mm_count); | 308 | atomic_inc(&init_mm.mm_count); |
311 | current->active_mm = &init_mm; | 309 | current->active_mm = &init_mm; |
312 | if(current->mm) | 310 | BUG_ON(current->mm); |
313 | BUG(); | ||
314 | enter_lazy_tlb(&init_mm, current); | 311 | enter_lazy_tlb(&init_mm, current); |
315 | 312 | ||
316 | init_IRQ(); /* make sure no IRQs are enabled or pending */ | 313 | init_IRQ(); /* make sure no IRQs are enabled or pending */ |
@@ -345,6 +342,7 @@ void __init smp_callin(void) | |||
345 | */ | 342 | */ |
346 | int __cpuinit smp_boot_one_cpu(int cpuid) | 343 | int __cpuinit smp_boot_one_cpu(int cpuid) |
347 | { | 344 | { |
345 | const struct cpuinfo_parisc *p = &per_cpu(cpu_data, cpuid); | ||
348 | struct task_struct *idle; | 346 | struct task_struct *idle; |
349 | long timeout; | 347 | long timeout; |
350 | 348 | ||
@@ -376,7 +374,7 @@ int __cpuinit smp_boot_one_cpu(int cpuid) | |||
376 | smp_init_current_idle_task = idle ; | 374 | smp_init_current_idle_task = idle ; |
377 | mb(); | 375 | mb(); |
378 | 376 | ||
379 | printk("Releasing cpu %d now, hpa=%lx\n", cpuid, cpu_data[cpuid].hpa); | 377 | printk(KERN_INFO "Releasing cpu %d now, hpa=%lx\n", cpuid, p->hpa); |
380 | 378 | ||
381 | /* | 379 | /* |
382 | ** This gets PDC to release the CPU from a very tight loop. | 380 | ** This gets PDC to release the CPU from a very tight loop. |
@@ -387,7 +385,7 @@ int __cpuinit smp_boot_one_cpu(int cpuid) | |||
387 | ** EIR{0}). MEM_RENDEZ is valid only when it is nonzero and the | 385 | ** EIR{0}). MEM_RENDEZ is valid only when it is nonzero and the |
388 | ** contents of memory are valid." | 386 | ** contents of memory are valid." |
389 | */ | 387 | */ |
390 | gsc_writel(TIMER_IRQ - CPU_IRQ_BASE, cpu_data[cpuid].hpa); | 388 | gsc_writel(TIMER_IRQ - CPU_IRQ_BASE, p->hpa); |
391 | mb(); | 389 | mb(); |
392 | 390 | ||
393 | /* | 391 | /* |
@@ -419,12 +417,12 @@ alive: | |||
419 | return 0; | 417 | return 0; |
420 | } | 418 | } |
421 | 419 | ||
422 | void __devinit smp_prepare_boot_cpu(void) | 420 | void __init smp_prepare_boot_cpu(void) |
423 | { | 421 | { |
424 | int bootstrap_processor=cpu_data[0].cpuid; /* CPU ID of BSP */ | 422 | int bootstrap_processor = per_cpu(cpu_data, 0).cpuid; |
425 | 423 | ||
426 | /* Setup BSP mappings */ | 424 | /* Setup BSP mappings */ |
427 | printk("SMP: bootstrap CPU ID is %d\n",bootstrap_processor); | 425 | printk(KERN_INFO "SMP: bootstrap CPU ID is %d\n", bootstrap_processor); |
428 | 426 | ||
429 | cpu_set(bootstrap_processor, cpu_online_map); | 427 | cpu_set(bootstrap_processor, cpu_online_map); |
430 | cpu_set(bootstrap_processor, cpu_present_map); | 428 | cpu_set(bootstrap_processor, cpu_present_map); |