aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDezhu Zhang <dezhux.zhang@intel.com>2019-07-25 13:31:28 +0800
committerTony Luck <tony.luck@intel.com>2019-07-29 14:59:46 -0700
commit3760e34c5e68b5b42437b3adf444d595eb2feb1e (patch)
tree2f6405b21ceaef1aa12e9a46c57358530f37a6c6
parent708bfffaf2dc3c5c8203c756d1c52393b97bde4a (diff)
downloadmce-test-3760e34c5e68b5b42437b3adf444d595eb2feb1e.tar.gz
mce-test: Unload possible EDAC drivers to avoid interference.
EDAC drivers sometimes claim to handle memory errors. When this happens, those errors do not appear in mcelog. We already have tests to check for the sb_edac driver. Add a check for the Skylake driver (skx_edac). Signed-off-by: Dezhu Zhang <dezhux.zhang@intel.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
-rwxr-xr-xcases/function/core_recovery/srar_recovery.sh13
-rwxr-xr-xcases/function/kvm/host/host_run.sh13
-rwxr-xr-xcases/function/pfa/run_pfa.sh13
3 files changed, 15 insertions, 24 deletions
diff --git a/cases/function/core_recovery/srar_recovery.sh b/cases/function/core_recovery/srar_recovery.sh
index 7fbcecc..9a5bfd7 100755
--- a/cases/function/core_recovery/srar_recovery.sh
+++ b/cases/function/core_recovery/srar_recovery.sh
@@ -58,15 +58,12 @@ fi
# remove possible EDAC module, otherwise, the error information will be ate
# by EDAC module and mcelog will not get it.
# By now, only i7core_edac and sb_edac hook into the mcelog kernel buffer
-cat /proc/modules | grep -q i7core_edac
-if [ $? -eq 0 ]; then
+if cat /proc/modules | grep -q i7core_edac; then
EDAC_TYPE="i7core_edac"
-else
- cat /proc/modules | grep -q sb_edac
- [ $? -eq 0 ] && EDAC_TYPE="sb_edac"
-elif
- cat /proc/modules | grep -q skx_edac
- [ $? -eq 0 ] && EDAC_TYPE="skx_edac"
+elif cat /proc/modules | grep -q sb_edac; then
+ EDAC_TYPE="sb_edac"
+elif cat /proc/modules | grep -q skx_edac; then
+ EDAC_TYPE="skx_edac"
fi
rmmod $EDAC_TYPE >/dev/null 2>&1
diff --git a/cases/function/kvm/host/host_run.sh b/cases/function/kvm/host/host_run.sh
index d58ab68..42ed453 100755
--- a/cases/function/kvm/host/host_run.sh
+++ b/cases/function/kvm/host/host_run.sh
@@ -73,15 +73,12 @@ rm_edac()
# remove possible EDAC module, otherwise, the error information will be ate
# by EDAC module and mcelog will not get it.
# By now, only i7core_edac and sb_edac hook into the mcelog kernel buffer
- cat /proc/modules | grep -q i7core_edac
- if [ $? -eq 0 ]; then
+ if cat /proc/modules | grep -q i7core_edac; then
EDAC_TYPE="i7core_edac"
- else
- cat /proc/modules | grep -q sb_edac
- [ $? -eq 0 ] && EDAC_TYPE="sb_edac"
- elif
- cat /proc/modules | grep -q skx_edac
- [ $? -eq 0 ] && EDAC_TYPE="skx_edac"
+ elif cat /proc/modules | grep -q sb_edac; then
+ EDAC_TYPE="sb_edac"
+ elif cat /proc/modules | grep -q skx_edac; then
+ EDAC_TYPE="skx_edac"
fi
rmmod $EDAC_TYPE >/dev/null 2>&1
}
diff --git a/cases/function/pfa/run_pfa.sh b/cases/function/pfa/run_pfa.sh
index 2dcdc1f..fd025fe 100755
--- a/cases/function/pfa/run_pfa.sh
+++ b/cases/function/pfa/run_pfa.sh
@@ -58,15 +58,12 @@ main()
# remove possible EDAC module, otherwise, the error information will be ate
# by EDAC module and mcelog will not get it.
# By now, only i7core_edac and sb_edac hook into the mcelog kernel buffer
- cat /proc/modules | grep -q i7core_edac
- if [ $? -eq 0 ]; then
+ if cat /proc/modules | grep -q i7core_edac; then
EDAC_TYPE="i7core_edac"
- else
- cat /proc/modules | grep -q sb_edac
- [ $? -eq 0 ] && EDAC_TYPE="sb_edac"
- elif
- cat /proc/modules | grep -q skx_edac
- [ $? -eq 0 ] && EDAC_TYPE="skx_edac"
+ elif cat /proc/modules | grep -q sb_edac; then
+ EDAC_TYPE="sb_edac"
+ elif cat /proc/modules | grep -q skx_edac; then
+ EDAC_TYPE="skx_edac"
fi
rmmod $EDAC_TYPE >/dev/null 2>&1