From 3cb3a2c6ca1b9988780839da79a33a19acea27c1 Mon Sep 17 00:00:00 2001 From: "Lai, Yi1" Date: Mon, 27 May 2024 10:59:05 +0800 Subject: [PATCH] edac: introduce edac feature into lkvs Intel i10nm EDAC driver supports the Intel 10nm series server integrated memory controller. Introduce this feature into lkvs test suite and add 2 test cases. Signed-off-by: Lai, Yi1 --- BM/edac/README.md | 19 +++++++++++++ BM/edac/intel_edac.sh | 66 +++++++++++++++++++++++++++++++++++++++++++ BM/edac/tests | 5 ++++ 3 files changed, 90 insertions(+) create mode 100644 BM/edac/README.md create mode 100755 BM/edac/intel_edac.sh create mode 100644 BM/edac/tests diff --git a/BM/edac/README.md b/BM/edac/README.md new file mode 100644 index 00000000..2ba710a2 --- /dev/null +++ b/BM/edac/README.md @@ -0,0 +1,19 @@ +# EDAC + +EDAC (Error Detection and Correction) framework provides support for detecting and correcting memory errors on systems with ECC (Error-Correcting Code) memory or other error detection mechanism. + +Intel i10nm EDAC driver supports the Intel 10nm series server integrated memory controller. + +## Usage + +You can run the cases one by one, e.g. command + +``` +./intel_edac.sh -t check_edac_bus +``` +You also can run the cases together with runtests command, e.g. + +``` +cd .. +./runtests -f edac/tests -o logfile +``` diff --git a/BM/edac/intel_edac.sh b/BM/edac/intel_edac.sh new file mode 100755 index 00000000..f6cefac6 --- /dev/null +++ b/BM/edac/intel_edac.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0-only +# Copyright (c) 2022 Intel Corporation +# Description: Test script for Intel i10nm EDAC driver, which supports 10nm series server +# EDAC: Error Detection and Correction +# @Author Yi Lai yi1.lai@intel.com + + +cd "$(dirname "$0")" 2>/dev/null || exit 1 +source ../.env + +EDAC_BUS="/sys/bus/edac" +EDAC_DRIVER=i10nm_edac + +: "${CASE_NAME:=""}" + +usage() { + cat <<__EOF + usage: ./${0##*/} [-t TESTCASE_ID] [-H] + -t TEST CASE ID + -H show this +__EOF +} + +edac_test() { + case $TEST_SCENARIO in + check_edac_bus) + edac_bus=$(ls $EDAC_BUS) + if [ -n "$edac_bus" ]; then + test_print_trc "EDAC bus is found" + else + die "EDAC bus is not found" + fi + ;; + check_edac_driver) + test_print_trc "Check Intel i10nm edac driver" + lsmod | grep -q $EDAC_DRIVER + if ! lsmod | grep -q $EDAC_DRIVER; then + die "Intel i10nm edac driver is not loaded" + else + test_print_trc "Intel i10nm edac driver is loaded" + fi + ;; + esac +} + +while getopts :t:H arg; do + case $arg in + t) + TEST_SCENARIO=$OPTARG + ;; + H) + usage && exit 0 + ;; + \?) + usage + die "Invalid Option -$OPTARG" + ;; + :) + usage + die "Option -$OPTARG requires an argument." + ;; + esac +done + +edac_test diff --git a/BM/edac/tests b/BM/edac/tests new file mode 100644 index 00000000..84f3bfc6 --- /dev/null +++ b/BM/edac/tests @@ -0,0 +1,5 @@ +# This file collects Intel EDAC driver testcases which can run against +# on Intel 10nm series server + +intel_edac.sh -t check_edac_bus +intel_edac.sh -t check_edac_driver