Skip to content

Commit 84f8b6e

Browse files
MingLi-4davejiang
authored andcommitted
cxl/mem: Do not return error if CONFIG_CXL_MCE unset
CONFIG_CXL_MCE depends on CONFIG_MEMORY_FAILURE, if CONFIG_CXL_MCE is not set, devm_cxl_register_mce_notifier() will return an -EOPNOTSUPP, it will cause cxl_mem_state_create() failure , and then cxl pci device probing failed. In this case, it should not break cxl pci device probing. Add a checking in cxl_mem_state_create() to check if the returned value of devm_cxl_register_mce_notifier() is -EOPNOTSUPP, if yes, just output a warning log, do not let cxl_mem_state_create() return an error. Signed-off-by: Li Ming <ming.li@zohomail.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Link: https://patch.msgid.link/20250227101848.388595-1-ming.li@zohomail.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
1 parent 763e15d commit 84f8b6e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/cxl/core/mbox.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,9 @@ struct cxl_memdev_state *cxl_memdev_state_create(struct device *dev)
14731473
mds->cxlds.type = CXL_DEVTYPE_CLASSMEM;
14741474

14751475
rc = devm_cxl_register_mce_notifier(dev, &mds->mce_notifier);
1476-
if (rc)
1476+
if (rc == -EOPNOTSUPP)
1477+
dev_warn(dev, "CXL MCE unsupported\n");
1478+
else if (rc)
14771479
return ERR_PTR(rc);
14781480

14791481
return mds;

0 commit comments

Comments
 (0)