The kernel commit torvalds/linux@cb9cfff removed bind attributes for cxl_pmem_region and cxl_nvdimm* objects.
Current libcxl logic attempts to find a bind attribute for every entry in /sys/bus/cxl/drivers/. Since some cxl objects do not have a bind attribute anymore, libcxl fails probing with ENOENT (No such file or directory). This masks actual device errors and prevents proper enumeration on kernels v6.2 and newer.
A simple check for bind shall be able to fix and pass the right errno from other cxl modules.
diff --git a/util/sysfs.c b/util/sysfs.c
index e027e38..41ee4d6 100644
--- a/util/sysfs.c
+++ b/util/sysfs.c
@@ -216,6 +216,11 @@ int __util_bind(const char *devname, struct kmod_module *module,
continue;
}
+ if (access(drv_path, F_OK) != 0) {
+ free(drv_path);
+ continue;
+ }
+
rc = __sysfs_write_attr_quiet(ctx, drv_path, devname);
free(drv_path);
if (rc == 0)
The kernel commit torvalds/linux@cb9cfff removed bind attributes for
cxl_pmem_regionandcxl_nvdimm*objects.Current libcxl logic attempts to find a bind attribute for every entry in
/sys/bus/cxl/drivers/. Since some cxl objects do not have a bind attribute anymore, libcxl fails probing withENOENT(No such file or directory). This masks actual device errors and prevents proper enumeration on kernels v6.2 and newer.A simple check for bind shall be able to fix and pass the right errno from other cxl modules.