@@ -2164,7 +2164,7 @@ static ssize_t set_ignore_ce(struct device *s,
mce_timer_delete_all();
on_each_cpu(mce_disable_cmci, NULL, 1);
mca_cfg.ignore_ce = true;
- } else {
+ } else if (!mca_cfg.allbanks_is_mcbank) {
/* enable ce features */
mca_cfg.ignore_ce = false;
on_each_cpu(mce_enable_ce, (void *)1, 1);
@@ -2190,7 +2190,7 @@ static ssize_t set_cmci_disabled(struct device *s,
/* disable cmci */
on_each_cpu(mce_disable_cmci, NULL, 1);
mca_cfg.cmci_disabled = true;
- } else {
+ } else if (!mca_cfg.allbanks_is_mcbank) {
/* enable cmci */
mca_cfg.cmci_disabled = false;
on_each_cpu(mce_enable_ce, NULL, 1);
@@ -267,6 +267,7 @@ static void cmci_discover(int banks)
unsigned long flags;
int i;
int bios_wrong_thresh = 0;
+ unsigned int mce_bank_count = 0;
raw_spin_lock_irqsave(&cmci_discover_lock, flags);
for (i = 0; i < banks; i++) {
@@ -277,8 +278,10 @@ static void cmci_discover(int banks)
continue;
/* Skip banks in firmware first mode */
- if (test_bit(i, mce_banks_ce_disabled))
+ if (test_bit(i, mce_banks_ce_disabled)) {
+ mce_bank_count++;
continue;
+ }
rdmsrl(MSR_IA32_MCx_CTL2(i), val);
@@ -330,6 +333,16 @@ static void cmci_discover(int banks)
pr_info_once(
"bios_cmci_threshold: Make sure your BIOS supports this boot option\n");
}
+ /*
+ * After the loop exit, if the mce_bank_count
+ * equal to the banks, it illustrate all the
+ * banks are belong to the list of Machine
+ * Check Bank, so here set sysfs interface
+ * no-modifiable in FF mode.
+ */
+ if (banks == mce_bank_count)
+ mca_cfg.allbanks_is_mcbank = true;
+
}
/*
@@ -110,6 +110,7 @@ struct mca_config {
bool dont_log_ce;
bool cmci_disabled;
bool ignore_ce;
+ bool allbanks_is_mcbank;
__u64 lmce_disabled : 1,
disabled : 1,