diff options
Diffstat (limited to 'arch/x86/kernel/cpu/mcheck/mce_amd.c')
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce_amd.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c index 83a3d1f4efca..39aaee5c1ab2 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/errno.h> | 21 | #include <linux/errno.h> |
22 | #include <linux/sched.h> | 22 | #include <linux/sched.h> |
23 | #include <linux/sysfs.h> | 23 | #include <linux/sysfs.h> |
24 | #include <linux/slab.h> | ||
24 | #include <linux/init.h> | 25 | #include <linux/init.h> |
25 | #include <linux/cpu.h> | 26 | #include <linux/cpu.h> |
26 | #include <linux/smp.h> | 27 | #include <linux/smp.h> |
@@ -140,6 +141,7 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c) | |||
140 | address = (low & MASK_BLKPTR_LO) >> 21; | 141 | address = (low & MASK_BLKPTR_LO) >> 21; |
141 | if (!address) | 142 | if (!address) |
142 | break; | 143 | break; |
144 | |||
143 | address += MCG_XBLK_ADDR; | 145 | address += MCG_XBLK_ADDR; |
144 | } else | 146 | } else |
145 | ++address; | 147 | ++address; |
@@ -147,12 +149,8 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c) | |||
147 | if (rdmsr_safe(address, &low, &high)) | 149 | if (rdmsr_safe(address, &low, &high)) |
148 | break; | 150 | break; |
149 | 151 | ||
150 | if (!(high & MASK_VALID_HI)) { | 152 | if (!(high & MASK_VALID_HI)) |
151 | if (block) | 153 | continue; |
152 | continue; | ||
153 | else | ||
154 | break; | ||
155 | } | ||
156 | 154 | ||
157 | if (!(high & MASK_CNTP_HI) || | 155 | if (!(high & MASK_CNTP_HI) || |
158 | (high & MASK_LOCKED_HI)) | 156 | (high & MASK_LOCKED_HI)) |
@@ -388,7 +386,7 @@ static ssize_t store(struct kobject *kobj, struct attribute *attr, | |||
388 | return ret; | 386 | return ret; |
389 | } | 387 | } |
390 | 388 | ||
391 | static struct sysfs_ops threshold_ops = { | 389 | static const struct sysfs_ops threshold_ops = { |
392 | .show = show, | 390 | .show = show, |
393 | .store = store, | 391 | .store = store, |
394 | }; | 392 | }; |
@@ -529,7 +527,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank) | |||
529 | err = -ENOMEM; | 527 | err = -ENOMEM; |
530 | goto out; | 528 | goto out; |
531 | } | 529 | } |
532 | if (!alloc_cpumask_var(&b->cpus, GFP_KERNEL)) { | 530 | if (!zalloc_cpumask_var(&b->cpus, GFP_KERNEL)) { |
533 | kfree(b); | 531 | kfree(b); |
534 | err = -ENOMEM; | 532 | err = -ENOMEM; |
535 | goto out; | 533 | goto out; |
@@ -542,7 +540,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank) | |||
542 | #ifndef CONFIG_SMP | 540 | #ifndef CONFIG_SMP |
543 | cpumask_setall(b->cpus); | 541 | cpumask_setall(b->cpus); |
544 | #else | 542 | #else |
545 | cpumask_copy(b->cpus, c->llc_shared_map); | 543 | cpumask_set_cpu(cpu, b->cpus); |
546 | #endif | 544 | #endif |
547 | 545 | ||
548 | per_cpu(threshold_banks, cpu)[bank] = b; | 546 | per_cpu(threshold_banks, cpu)[bank] = b; |