]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cxl/edac: Fix using wrong repair type to check dram event record
authorLi Ming <ming.li@zohomail.com>
Fri, 20 Jun 2025 05:29:24 +0000 (13:29 +0800)
committerDave Jiang <dave.jiang@intel.com>
Wed, 25 Jun 2025 19:05:45 +0000 (12:05 -0700)
cxl_find_rec_dram() is used to find a DRAM event record based on the
inputted attributes. Different repair_type of the inputted attributes
will check the DRAM event record in different ways.
When EDAC driver is performing a memory rank sparing, it should use
CXL_RANK_SPARING rather than CXL_BANK_SPARING as repair_type for DRAM
event record checking.

Fixes: 588ca944c277 ("cxl/edac: Add CXL memory device memory sparing control feature")
Signed-off-by: Li Ming <ming.li@zohomail.com>
Reviewed-by: Shiju Jose <shiju.jose@huawei.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fan Ni <fan.ni@samsung.com>
Link: https://patch.msgid.link/20250620052924.138892-1-ming.li@zohomail.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/cxl/core/edac.c

index d725ee95419994498ea4751063ac4db7651f6854..623aaa4439c4b53a684117f538422a251584937a 100644 (file)
@@ -1323,7 +1323,7 @@ cxl_mem_get_rec_dram(struct cxl_memdev *cxlmd,
                attrbs.bank = ctx->bank;
        break;
        case EDAC_REPAIR_RANK_SPARING:
-               attrbs.repair_type = CXL_BANK_SPARING;
+               attrbs.repair_type = CXL_RANK_SPARING;
                break;
        default:
                return NULL;