diff options
author | Li Ming <ming.li@zohomail.com> | 2025-02-27 13:18:48 +0300 |
---|---|---|
committer | Dave Jiang <dave.jiang@intel.com> | 2025-03-15 02:27:28 +0300 |
commit | 84f8b6e242deb997f2b32b4fc0895e8703704029 (patch) | |
tree | 7886a0a7033f507772dcc4f1fd53de4576d800f2 | |
parent | 763e15d04740ad2984bf009d9a5f70c099c8e6fd (diff) | |
download | linux-84f8b6e242deb997f2b32b4fc0895e8703704029.tar.xz |
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>
-rw-r--r-- | drivers/cxl/core/mbox.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c index e088c6ba1705..7450c4df522e 100644 --- a/drivers/cxl/core/mbox.c +++ b/drivers/cxl/core/mbox.c @@ -1473,7 +1473,9 @@ struct cxl_memdev_state *cxl_memdev_state_create(struct device *dev) mds->cxlds.type = CXL_DEVTYPE_CLASSMEM; rc = devm_cxl_register_mce_notifier(dev, &mds->mce_notifier); - if (rc) + if (rc == -EOPNOTSUPP) + dev_warn(dev, "CXL MCE unsupported\n"); + else if (rc) return ERR_PTR(rc); return mds; |