diff options
author | Jack Steiner <steiner@sgi.com> | 2007-03-12 09:07:49 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2007-03-20 16:42:23 -0400 |
commit | c5e83e3f42938c0a84047e125edb98d6513f985b (patch) | |
tree | befe636ac169b82fe4ba8d3353de6e11a19de82f /arch/ia64/kernel | |
parent | a3f5c338b9f30f328276739d9589beae19254936 (diff) |
[IA64] Fix get_model_name() for mixed cpu type systems
If a system consists of mixed processor types, kmalloc()
can be called before the per-cpu data page is initialized.
If the slab contains sufficient memory, then kmalloc() works
ok. However, if the slabs are empty, slab calls the memory
allocator. This requires per-cpu data (NODE_DATA()) & the
cpu dies.
Also noted by Russ Anderson who had a very similar patch.
Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/kernel')
-rw-r--r-- | arch/ia64/kernel/setup.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 339e8a54c2f1..69b9bb3fd7c5 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c | |||
@@ -692,12 +692,15 @@ struct seq_operations cpuinfo_op = { | |||
692 | .show = show_cpuinfo | 692 | .show = show_cpuinfo |
693 | }; | 693 | }; |
694 | 694 | ||
695 | static char brandname[128]; | 695 | #define MAX_BRANDS 8 |
696 | static char brandname[MAX_BRANDS][128]; | ||
696 | 697 | ||
697 | static char * __cpuinit | 698 | static char * __cpuinit |
698 | get_model_name(__u8 family, __u8 model) | 699 | get_model_name(__u8 family, __u8 model) |
699 | { | 700 | { |
701 | static int overflow; | ||
700 | char brand[128]; | 702 | char brand[128]; |
703 | int i; | ||
701 | 704 | ||
702 | memcpy(brand, "Unknown", 8); | 705 | memcpy(brand, "Unknown", 8); |
703 | if (ia64_pal_get_brand_info(brand)) { | 706 | if (ia64_pal_get_brand_info(brand)) { |
@@ -709,12 +712,17 @@ get_model_name(__u8 family, __u8 model) | |||
709 | case 2: memcpy(brand, "Madison up to 9M cache", 23); break; | 712 | case 2: memcpy(brand, "Madison up to 9M cache", 23); break; |
710 | } | 713 | } |
711 | } | 714 | } |
712 | if (brandname[0] == '\0') | 715 | for (i = 0; i < MAX_BRANDS; i++) |
713 | return strcpy(brandname, brand); | 716 | if (strcmp(brandname[i], brand) == 0) |
714 | else if (strcmp(brandname, brand) == 0) | 717 | return brandname[i]; |
715 | return brandname; | 718 | for (i = 0; i < MAX_BRANDS; i++) |
716 | else | 719 | if (brandname[i][0] == '\0') |
717 | return kstrdup(brand, GFP_KERNEL); | 720 | return strcpy(brandname[i], brand); |
721 | if (overflow++ == 0) | ||
722 | printk(KERN_ERR | ||
723 | "%s: Table overflow. Some processor model information will be missing\n", | ||
724 | __FUNCTION__); | ||
725 | return "Unknown"; | ||
718 | } | 726 | } |
719 | 727 | ||
720 | static void __cpuinit | 728 | static void __cpuinit |