Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
authorDavid S. Miller <davem@davemloft.net>
Fri, 20 May 2011 19:59:54 +0000 (12:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 May 2011 19:59:54 +0000 (12:59 -0700)
1  2 
arch/sparc/kernel/smp_32.c
arch/sparc/kernel/time_32.c

index 139c312a41f73c04edc06e58c7e6510f3304fa5f,850a1360c0d6f1128d21b6225a55b9f2740fa45c..41102c5a6702ddf0d181f5d325efef4d3044ee05
@@@ -37,6 -37,8 +37,6 @@@
  #include "irq.h"
  
  volatile unsigned long cpu_callin_map[NR_CPUS] __cpuinitdata = {0,};
 -unsigned char boot_cpu_id = 0;
 -unsigned char boot_cpu_id4 = 0; /* boot_cpu_id << 2 */
  
  cpumask_t smp_commenced_mask = CPU_MASK_NONE;
  
@@@ -51,6 -53,7 +51,7 @@@
  void __cpuinit smp_store_cpu_info(int id)
  {
        int cpu_node;
+       int mid;
  
        cpu_data(id).udelay_val = loops_per_jiffy;
  
        cpu_data(id).clock_tick = prom_getintdefault(cpu_node,
                                                     "clock-frequency", 0);
        cpu_data(id).prom_node = cpu_node;
-       cpu_data(id).mid = cpu_get_hwmid(cpu_node);
+       mid = cpu_get_hwmid(cpu_node);
  
-       if (cpu_data(id).mid < 0)
-               panic("No MID found for CPU%d at node 0x%08d", id, cpu_node);
+       if (mid < 0) {
+               printk(KERN_NOTICE "No MID found for CPU%d at node 0x%08d", id, cpu_node);
+               mid = 0;
+       }
+       cpu_data(id).mid = mid;
  }
  
  void __init smp_cpus_done(unsigned int max_cpus)
@@@ -123,58 -129,13 +127,58 @@@ struct linux_prom_registers smp_penguin
  
  void smp_send_reschedule(int cpu)
  {
 -      /* See sparc64 */
 +      /*
 +       * CPU model dependent way of implementing IPI generation targeting
 +       * a single CPU. The trap handler needs only to do trap entry/return
 +       * to call schedule.
 +       */
 +      BTFIXUP_CALL(smp_ipi_resched)(cpu);
  }
  
  void smp_send_stop(void)
  {
  }
  
 +void arch_send_call_function_single_ipi(int cpu)
 +{
 +      /* trigger one IPI single call on one CPU */
 +      BTFIXUP_CALL(smp_ipi_single)(cpu);
 +}
 +
 +void arch_send_call_function_ipi_mask(const struct cpumask *mask)
 +{
 +      int cpu;
 +
 +      /* trigger IPI mask call on each CPU */
 +      for_each_cpu(cpu, mask)
 +              BTFIXUP_CALL(smp_ipi_mask_one)(cpu);
 +}
 +
 +void smp_resched_interrupt(void)
 +{
 +      local_cpu_data().irq_resched_count++;
 +      /*
 +       * do nothing, since it all was about calling re-schedule
 +       * routine called by interrupt return code.
 +       */
 +}
 +
 +void smp_call_function_single_interrupt(void)
 +{
 +      irq_enter();
 +      generic_smp_call_function_single_interrupt();
 +      local_cpu_data().irq_call_count++;
 +      irq_exit();
 +}
 +
 +void smp_call_function_interrupt(void)
 +{
 +      irq_enter();
 +      generic_smp_call_function_interrupt();
 +      local_cpu_data().irq_call_count++;
 +      irq_exit();
 +}
 +
  void smp_flush_cache_all(void)
  {
        xc0((smpfunc_t) BTFIXUP_CALL(local_flush_cache_all));
@@@ -190,10 -151,9 +194,10 @@@ void smp_flush_tlb_all(void
  void smp_flush_cache_mm(struct mm_struct *mm)
  {
        if(mm->context != NO_CONTEXT) {
 -              cpumask_t cpu_mask = *mm_cpumask(mm);
 -              cpu_clear(smp_processor_id(), cpu_mask);
 -              if (!cpus_empty(cpu_mask))
 +              cpumask_t cpu_mask;
 +              cpumask_copy(&cpu_mask, mm_cpumask(mm));
 +              cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
 +              if (!cpumask_empty(&cpu_mask))
                        xc1((smpfunc_t) BTFIXUP_CALL(local_flush_cache_mm), (unsigned long) mm);
                local_flush_cache_mm(mm);
        }
  void smp_flush_tlb_mm(struct mm_struct *mm)
  {
        if(mm->context != NO_CONTEXT) {
 -              cpumask_t cpu_mask = *mm_cpumask(mm);
 -              cpu_clear(smp_processor_id(), cpu_mask);
 -              if (!cpus_empty(cpu_mask)) {
 +              cpumask_t cpu_mask;
 +              cpumask_copy(&cpu_mask, mm_cpumask(mm));
 +              cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
 +              if (!cpumask_empty(&cpu_mask)) {
                        xc1((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_mm), (unsigned long) mm);
                        if(atomic_read(&mm->mm_users) == 1 && current->active_mm == mm)
                                cpumask_copy(mm_cpumask(mm),
@@@ -221,10 -180,9 +225,10 @@@ void smp_flush_cache_range(struct vm_ar
        struct mm_struct *mm = vma->vm_mm;
  
        if (mm->context != NO_CONTEXT) {
 -              cpumask_t cpu_mask = *mm_cpumask(mm);
 -              cpu_clear(smp_processor_id(), cpu_mask);
 -              if (!cpus_empty(cpu_mask))
 +              cpumask_t cpu_mask;
 +              cpumask_copy(&cpu_mask, mm_cpumask(mm));
 +              cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
 +              if (!cpumask_empty(&cpu_mask))
                        xc3((smpfunc_t) BTFIXUP_CALL(local_flush_cache_range), (unsigned long) vma, start, end);
                local_flush_cache_range(vma, start, end);
        }
@@@ -236,10 -194,9 +240,10 @@@ void smp_flush_tlb_range(struct vm_area
        struct mm_struct *mm = vma->vm_mm;
  
        if (mm->context != NO_CONTEXT) {
 -              cpumask_t cpu_mask = *mm_cpumask(mm);
 -              cpu_clear(smp_processor_id(), cpu_mask);
 -              if (!cpus_empty(cpu_mask))
 +              cpumask_t cpu_mask;
 +              cpumask_copy(&cpu_mask, mm_cpumask(mm));
 +              cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
 +              if (!cpumask_empty(&cpu_mask))
                        xc3((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_range), (unsigned long) vma, start, end);
                local_flush_tlb_range(vma, start, end);
        }
@@@ -250,10 -207,9 +254,10 @@@ void smp_flush_cache_page(struct vm_are
        struct mm_struct *mm = vma->vm_mm;
  
        if(mm->context != NO_CONTEXT) {
 -              cpumask_t cpu_mask = *mm_cpumask(mm);
 -              cpu_clear(smp_processor_id(), cpu_mask);
 -              if (!cpus_empty(cpu_mask))
 +              cpumask_t cpu_mask;
 +              cpumask_copy(&cpu_mask, mm_cpumask(mm));
 +              cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
 +              if (!cpumask_empty(&cpu_mask))
                        xc2((smpfunc_t) BTFIXUP_CALL(local_flush_cache_page), (unsigned long) vma, page);
                local_flush_cache_page(vma, page);
        }
@@@ -264,15 -220,19 +268,15 @@@ void smp_flush_tlb_page(struct vm_area_
        struct mm_struct *mm = vma->vm_mm;
  
        if(mm->context != NO_CONTEXT) {
 -              cpumask_t cpu_mask = *mm_cpumask(mm);
 -              cpu_clear(smp_processor_id(), cpu_mask);
 -              if (!cpus_empty(cpu_mask))
 +              cpumask_t cpu_mask;
 +              cpumask_copy(&cpu_mask, mm_cpumask(mm));
 +              cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
 +              if (!cpumask_empty(&cpu_mask))
                        xc2((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_page), (unsigned long) vma, page);
                local_flush_tlb_page(vma, page);
        }
  }
  
 -void smp_reschedule_irq(void)
 -{
 -      set_need_resched();
 -}
 -
  void smp_flush_page_to_ram(unsigned long page)
  {
        /* Current theory is that those who call this are the one's
  
  void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr)
  {
 -      cpumask_t cpu_mask = *mm_cpumask(mm);
 -      cpu_clear(smp_processor_id(), cpu_mask);
 -      if (!cpus_empty(cpu_mask))
 +      cpumask_t cpu_mask;
 +      cpumask_copy(&cpu_mask, mm_cpumask(mm));
 +      cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
 +      if (!cpumask_empty(&cpu_mask))
                xc2((smpfunc_t) BTFIXUP_CALL(local_flush_sig_insns), (unsigned long) mm, insn_addr);
        local_flush_sig_insns(mm, insn_addr);
  }
@@@ -446,7 -405,7 +450,7 @@@ int __cpuinit __cpu_up(unsigned int cpu
        };
  
        if (!ret) {
 -              cpu_set(cpu, smp_commenced_mask);
 +              cpumask_set_cpu(cpu, &smp_commenced_mask);
                while (!cpu_online(cpu))
                        mb();
        }
index b6184030010146e04cc9f5ecb86c305662377be3,96046a4024c23276e41769403a5155ec62ea2cd3..1060e0672a4b439972fbfa0c728b6ba6403a777d
@@@ -168,7 -168,7 +168,7 @@@ static int __devinit clock_probe(struc
        return 0;
  }
  
- static struct of_device_id __initdata clock_match[] = {
+ static struct of_device_id clock_match[] = {
        {
                .name = "eeprom",
        },
@@@ -228,10 -228,14 +228,10 @@@ static void __init sbus_time_init(void
  
  void __init time_init(void)
  {
 -#ifdef CONFIG_PCI
 -      extern void pci_time_init(void);
 -      if (pcic_present()) {
 +      if (pcic_present())
                pci_time_init();
 -              return;
 -      }
 -#endif
 -      sbus_time_init();
 +      else
 +              sbus_time_init();
  }