EDAC: Add scrub control feature
authorShiju Jose <shiju.jose@huawei.com>
Wed, 12 Feb 2025 14:36:40 +0000 (14:36 +0000)
committerBorislav Petkov (AMD) <bp@alien8.de>
Tue, 25 Feb 2025 14:39:09 +0000 (15:39 +0100)
commitf90b738166fe909df48de6a03744ddfbad5002f8
treec0886a9d910aef8ecae11aec5e90aa35af5e5e36
parentdb99ea5f2c0361c8fc2878792e97c7b67c811bd0
EDAC: Add scrub control feature

Add a scrub control to manage memory scrubbers in the system.

Devices with a scrub feature register with the EDAC device driver which
retrieves the scrub descriptor from the scrub driver and exposes the
control attributes for a instance to userspace at

  /sys/bus/edac/devices/<dev-name>/scrubX/.

The common sysfs scrub control interface abstracts the control of
arbitrary scrubbing functionality into a common set of functions. The
attribute nodes are only present if the client driver has implemented
the corresponding attribute callback function and passed the operations
to the device driver during registration.

  [ bp: Massage commit message, docs and code, simplify text a bit.
    Integrate fixup for: https://lore.kernel.org/r/202502251009.0sGkolEJ-lkp@intel.com
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org> ]
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>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Tested-by: Daniel Ferguson <danielf@os.amperecomputing.com>
Tested-by: Fan Ni <fan.ni@samsung.com>
Link: https://lore.kernel.org/r/20250212143654.1893-3-shiju.jose@huawei.com
Documentation/ABI/testing/sysfs-edac-scrub [new file with mode: 0644]
Documentation/edac/features.rst
Documentation/edac/index.rst
Documentation/edac/scrub.rst [new file with mode: 0644]
drivers/edac/Kconfig
drivers/edac/Makefile
drivers/edac/edac_device.c
drivers/edac/scrub.c [new file with mode: 0755]
include/linux/edac.h