]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cxl/edac: Add CXL memory device patrol scrub control feature
authorShiju Jose <shiju.jose@huawei.com>
Wed, 21 May 2025 12:47:41 +0000 (13:47 +0100)
committerDave Jiang <dave.jiang@intel.com>
Fri, 23 May 2025 20:24:09 +0000 (13:24 -0700)
commit0c6e6f1357cbdc158d555346a728aa4aeb0d7011
tree481f78e8e2456a124ac5fb94e0859f44fe4070ea
parentf76e0bbc8bc34c55fd5da569b9e1126cf42b09ec
cxl/edac: Add CXL memory device patrol scrub control feature

CXL spec 3.2 section 8.2.10.9.11.1 describes the device patrol scrub
control feature. The device patrol scrub proactively locates and makes
corrections to errors in regular cycle.

Allow specifying the number of hours within which the patrol scrub must be
completed, subject to minimum and maximum limits reported by the device.
Also allow disabling scrub allowing trade-off error rates against
performance.

Add support for patrol scrub control on CXL memory devices.
Register with the EDAC device driver, which retrieves the scrub attribute
descriptors from EDAC scrub and exposes the sysfs scrub control attributes
to userspace. For example, scrub control for the CXL memory device
"cxl_mem0" is exposed in /sys/bus/edac/devices/cxl_mem0/scrubX/.

Additionally, add support for region-based CXL memory patrol scrub control.
CXL memory regions may be interleaved across one or more CXL memory
devices. For example, region-based scrub control for "cxl_region1" is
exposed in /sys/bus/edac/devices/cxl_region1/scrubX/.

[dj: A few formatting fixes from Jonathan]

Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Co-developed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Link: https://patch.msgid.link/20250521124749.817-4-shiju.jose@huawei.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/cxl/Kconfig
drivers/cxl/core/Makefile
drivers/cxl/core/edac.c [new file with mode: 0644]
drivers/cxl/core/region.c
drivers/cxl/cxl.h
drivers/cxl/cxlmem.h
drivers/cxl/mem.c
tools/testing/cxl/Kbuild