aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorShaohua Li <shaohua.li@intel.com>2006-01-11 16:43:06 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-11 22:01:57 -0500
commit73ca5358aab55e2e29993a31f3776c54c05ae729 (patch)
tree8c9c177c9f5a0e1f16e3f01f9aa668f353cfc95e /arch
parentf2ecfab91c6f248cf71dff66c2111d31c8cc1747 (diff)
[PATCH] x86_64: increase MCE bank counts
There is one CPU here whose MCE bank count is 6. This patch increases x86_64's MCE bank count. Signed-off-by: Shaohua Li <shaohua.li@intel.com> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86_64/kernel/mce.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c
index 63777b8cb8c1..281ad5f1f86a 100644
--- a/arch/x86_64/kernel/mce.c
+++ b/arch/x86_64/kernel/mce.c
@@ -26,7 +26,7 @@
26#include <asm/uaccess.h> 26#include <asm/uaccess.h>
27 27
28#define MISC_MCELOG_MINOR 227 28#define MISC_MCELOG_MINOR 227
29#define NR_BANKS 5 29#define NR_BANKS 6
30 30
31static int mce_dont_init; 31static int mce_dont_init;
32 32
@@ -574,6 +574,10 @@ ACCESSOR(bank1ctl,bank[1],mce_restart())
574ACCESSOR(bank2ctl,bank[2],mce_restart()) 574ACCESSOR(bank2ctl,bank[2],mce_restart())
575ACCESSOR(bank3ctl,bank[3],mce_restart()) 575ACCESSOR(bank3ctl,bank[3],mce_restart())
576ACCESSOR(bank4ctl,bank[4],mce_restart()) 576ACCESSOR(bank4ctl,bank[4],mce_restart())
577ACCESSOR(bank5ctl,bank[5],mce_restart())
578static struct sysdev_attribute * bank_attributes[NR_BANKS] = {
579 &attr_bank0ctl, &attr_bank1ctl, &attr_bank2ctl,
580 &attr_bank3ctl, &attr_bank4ctl, &attr_bank5ctl};
577ACCESSOR(tolerant,tolerant,) 581ACCESSOR(tolerant,tolerant,)
578ACCESSOR(check_interval,check_interval,mce_restart()) 582ACCESSOR(check_interval,check_interval,mce_restart())
579 583
@@ -581,6 +585,7 @@ ACCESSOR(check_interval,check_interval,mce_restart())
581static __cpuinit int mce_create_device(unsigned int cpu) 585static __cpuinit int mce_create_device(unsigned int cpu)
582{ 586{
583 int err; 587 int err;
588 int i;
584 if (!mce_available(&cpu_data[cpu])) 589 if (!mce_available(&cpu_data[cpu]))
585 return -EIO; 590 return -EIO;
586 591
@@ -590,11 +595,9 @@ static __cpuinit int mce_create_device(unsigned int cpu)
590 err = sysdev_register(&per_cpu(device_mce,cpu)); 595 err = sysdev_register(&per_cpu(device_mce,cpu));
591 596
592 if (!err) { 597 if (!err) {
593 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_bank0ctl); 598 for (i = 0; i < banks; i++)
594 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_bank1ctl); 599 sysdev_create_file(&per_cpu(device_mce,cpu),
595 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_bank2ctl); 600 bank_attributes[i]);
596 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_bank3ctl);
597 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_bank4ctl);
598 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_tolerant); 601 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_tolerant);
599 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_check_interval); 602 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_check_interval);
600 } 603 }
@@ -604,11 +607,11 @@ static __cpuinit int mce_create_device(unsigned int cpu)
604#ifdef CONFIG_HOTPLUG_CPU 607#ifdef CONFIG_HOTPLUG_CPU
605static __cpuinit void mce_remove_device(unsigned int cpu) 608static __cpuinit void mce_remove_device(unsigned int cpu)
606{ 609{
607 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_bank0ctl); 610 int i;
608 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_bank1ctl); 611
609 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_bank2ctl); 612 for (i = 0; i < banks; i++)
610 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_bank3ctl); 613 sysdev_remove_file(&per_cpu(device_mce,cpu),
611 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_bank4ctl); 614 bank_attributes[i]);
612 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_tolerant); 615 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_tolerant);
613 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_check_interval); 616 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_check_interval);
614 sysdev_unregister(&per_cpu(device_mce,cpu)); 617 sysdev_unregister(&per_cpu(device_mce,cpu));