aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_amd.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
index 1ac581f38dfa..e3d81a8d646b 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -58,11 +58,6 @@ static const char * const th_names[] = {
58}; 58};
59 59
60static DEFINE_PER_CPU(struct threshold_bank * [NR_BANKS], threshold_banks); 60static DEFINE_PER_CPU(struct threshold_bank * [NR_BANKS], threshold_banks);
61
62static unsigned char shared_bank[NR_BANKS] = {
63 0, 0, 0, 0, 1
64};
65
66static DEFINE_PER_CPU(unsigned char, bank_map); /* see which banks are on */ 61static DEFINE_PER_CPU(unsigned char, bank_map); /* see which banks are on */
67 62
68static void amd_threshold_interrupt(void); 63static void amd_threshold_interrupt(void);
@@ -79,6 +74,12 @@ struct thresh_restart {
79 u16 old_limit; 74 u16 old_limit;
80}; 75};
81 76
77static inline bool is_shared_bank(int bank)
78{
79 /* Bank 4 is for northbridge reporting and is thus shared */
80 return (bank == 4);
81}
82
82static const char * const bank4_names(struct threshold_block *b) 83static const char * const bank4_names(struct threshold_block *b)
83{ 84{
84 switch (b->address) { 85 switch (b->address) {
@@ -575,7 +576,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
575 const char *name = th_names[bank]; 576 const char *name = th_names[bank];
576 int err = 0; 577 int err = 0;
577 578
578 if (shared_bank[bank]) { 579 if (is_shared_bank(bank)) {
579 nb = node_to_amd_nb(amd_get_nb_id(cpu)); 580 nb = node_to_amd_nb(amd_get_nb_id(cpu));
580 581
581 /* threshold descriptor already initialized on this node? */ 582 /* threshold descriptor already initialized on this node? */
@@ -609,7 +610,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
609 610
610 per_cpu(threshold_banks, cpu)[bank] = b; 611 per_cpu(threshold_banks, cpu)[bank] = b;
611 612
612 if (shared_bank[bank]) { 613 if (is_shared_bank(bank)) {
613 atomic_set(&b->cpus, 1); 614 atomic_set(&b->cpus, 1);
614 615
615 /* nb is already initialized, see above */ 616 /* nb is already initialized, see above */
@@ -691,7 +692,7 @@ static void threshold_remove_bank(unsigned int cpu, int bank)
691 if (!b->blocks) 692 if (!b->blocks)
692 goto free_out; 693 goto free_out;
693 694
694 if (shared_bank[bank]) { 695 if (is_shared_bank(bank)) {
695 if (!atomic_dec_and_test(&b->cpus)) { 696 if (!atomic_dec_and_test(&b->cpus)) {
696 __threshold_remove_blocks(b); 697 __threshold_remove_blocks(b);
697 per_cpu(threshold_banks, cpu)[bank] = NULL; 698 per_cpu(threshold_banks, cpu)[bank] = NULL;