diff options
author | Borislav Petkov <borislav.petkov@amd.com> | 2012-04-16 12:20:36 -0400 |
---|---|---|
committer | Borislav Petkov <borislav.petkov@amd.com> | 2012-04-30 07:22:44 -0400 |
commit | d26ecc4894464318dce51d709e19dd9d88916bee (patch) | |
tree | 5ab481b2e9af1eb50be90d39003ad3f5af905b90 | |
parent | f227d4306cf30e1d5b6f231e8ef9006c34f3d186 (diff) |
x86, MCE, AMD: Hide interrupt_enable sysfs node
Depending on whether the box supports the APIC LVT interrupt for
thresholding, we want to show the 'interrupt_enable' sysfs node or not.
Make that the case by adding it to the default sysfs attributes only if
it is supported.
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce_amd.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c index 2c1d178be46e..f4873a64f46d 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c | |||
@@ -421,10 +421,10 @@ RW_ATTR(threshold_limit); | |||
421 | RW_ATTR(error_count); | 421 | RW_ATTR(error_count); |
422 | 422 | ||
423 | static struct attribute *default_attrs[] = { | 423 | static struct attribute *default_attrs[] = { |
424 | &interrupt_enable.attr, | ||
425 | &threshold_limit.attr, | 424 | &threshold_limit.attr, |
426 | &error_count.attr, | 425 | &error_count.attr, |
427 | NULL | 426 | NULL, /* possibly interrupt_enable if supported, see below */ |
427 | NULL, | ||
428 | }; | 428 | }; |
429 | 429 | ||
430 | #define to_block(k) container_of(k, struct threshold_block, kobj) | 430 | #define to_block(k) container_of(k, struct threshold_block, kobj) |
@@ -501,6 +501,11 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu, | |||
501 | b->interrupt_capable = lvt_interrupt_supported(bank, high); | 501 | b->interrupt_capable = lvt_interrupt_supported(bank, high); |
502 | b->threshold_limit = THRESHOLD_MAX; | 502 | b->threshold_limit = THRESHOLD_MAX; |
503 | 503 | ||
504 | if (b->interrupt_capable) | ||
505 | threshold_ktype.default_attrs[2] = &interrupt_enable.attr; | ||
506 | else | ||
507 | threshold_ktype.default_attrs[2] = NULL; | ||
508 | |||
504 | INIT_LIST_HEAD(&b->miscj); | 509 | INIT_LIST_HEAD(&b->miscj); |
505 | 510 | ||
506 | if (per_cpu(threshold_banks, cpu)[bank]->blocks) { | 511 | if (per_cpu(threshold_banks, cpu)[bank]->blocks) { |