Pull percpu-dtc into release branch
[sfrench/cifs-2.6.git] / arch / ia64 / kernel / setup.c
index 339e8a54c2f1dc860eb8e0279b6a5ca88eb77cf9..6e19da122ae3a75952513aaa49166f511440c2ac 100644 (file)
@@ -75,7 +75,6 @@ extern void ia64_setup_printk_clock(void);
 
 DEFINE_PER_CPU(struct cpuinfo_ia64, cpu_info);
 DEFINE_PER_CPU(unsigned long, local_per_cpu_offset);
-DEFINE_PER_CPU(unsigned long, ia64_phys_stacked_size_p8);
 unsigned long ia64_cycles_per_usec;
 struct ia64_boot_param *ia64_boot_param;
 struct screen_info screen_info;
@@ -640,7 +639,7 @@ show_cpuinfo (struct seq_file *m, void *v)
                   "features   : %s\n"
                   "cpu number : %lu\n"
                   "cpu regs   : %u\n"
-                  "cpu MHz    : %lu.%06lu\n"
+                  "cpu MHz    : %lu.%03lu\n"
                   "itc MHz    : %lu.%06lu\n"
                   "BogoMIPS   : %lu.%02lu\n",
                   cpunum, c->vendor, c->family, c->model,
@@ -692,12 +691,15 @@ struct seq_operations cpuinfo_op = {
        .show =         show_cpuinfo
 };
 
-static char brandname[128];
+#define MAX_BRANDS     8
+static char brandname[MAX_BRANDS][128];
 
 static char * __cpuinit
 get_model_name(__u8 family, __u8 model)
 {
+       static int overflow;
        char brand[128];
+       int i;
 
        memcpy(brand, "Unknown", 8);
        if (ia64_pal_get_brand_info(brand)) {
@@ -709,12 +711,17 @@ get_model_name(__u8 family, __u8 model)
                        case 2: memcpy(brand, "Madison up to 9M cache", 23); break;
                }
        }
-       if (brandname[0] == '\0')
-               return strcpy(brandname, brand);
-       else if (strcmp(brandname, brand) == 0)
-               return brandname;
-       else
-               return kstrdup(brand, GFP_KERNEL);
+       for (i = 0; i < MAX_BRANDS; i++)
+               if (strcmp(brandname[i], brand) == 0)
+                       return brandname[i];
+       for (i = 0; i < MAX_BRANDS; i++)
+               if (brandname[i][0] == '\0')
+                       return strcpy(brandname[i], brand);
+       if (overflow++ == 0)
+               printk(KERN_ERR
+                      "%s: Table overflow. Some processor model information will be missing\n",
+                      __FUNCTION__);
+       return "Unknown";
 }
 
 static void __cpuinit
@@ -861,6 +868,7 @@ void __cpuinit
 cpu_init (void)
 {
        extern void __cpuinit ia64_mmu_init (void *);
+       static unsigned long max_num_phys_stacked = IA64_NUM_PHYS_STACK_REG;
        unsigned long num_phys_stacked;
        pal_vm_info_2_u_t vmi;
        unsigned int max_ctx;
@@ -974,7 +982,10 @@ cpu_init (void)
                num_phys_stacked = 96;
        }
        /* size of physical stacked register partition plus 8 bytes: */
-       __get_cpu_var(ia64_phys_stacked_size_p8) = num_phys_stacked*8 + 8;
+       if (num_phys_stacked > max_num_phys_stacked) {
+               ia64_patch_phys_stack_reg(num_phys_stacked*8 + 8);
+               max_num_phys_stacked = num_phys_stacked;
+       }
        platform_cpu_init();
        pm_idle = default_idle;
 }