Re: [PATCH v13 2/2] ras: mem: Add ACPI RAS2 memory driver

Randy Dunlap
2025-11-22T05:22:58Z

On 11/21/25 10:28 AM, shiju.jose@huawei.com wrote:
> diff --git a/Documentation/edac/scrub.rst b/Documentation/edac/scrub.rst
> index 2cfa74fa1ffd..737a10da224f 100644
> --- a/Documentation/edac/scrub.rst
> +++ b/Documentation/edac/scrub.rst
> @@ -340,3 +340,61 @@ controller or platform when unexpectedly high error rates are detected.
>
> Sysfs files for scrubbing are documented in
> `Documentation/ABI/testing/sysfs-edac-ecs`
> +
> +3. ACPI RAS2 Hardware-based Memory Scrubbing
> +
> +3.1. On demand scrubbing for a specific memory region.
> +
> +3.1.1. Query the status of demand scrubbing
> +
> +# cat /sys/bus/edac/devices/acpi_ras_mem0/scrub0/enable_demand
> +
> +0
> +
> +3.1.2. Query what is device default/current scrub cycle setting.
> +
> +Applicable to both demand and background scrubbing.
> +
> +# cat /sys/bus/edac/devices/acpi_ras_mem0/scrub0/current_cycle_duration
> +
> +36000
> +

What units (above)?

> +3.1.3. Query the range of device supported scrub cycle for a memory region.
> +
> +# cat /sys/bus/edac/devices/acpi_ras_mem0/scrub0/min_cycle_duration
> +
> +3600
> +
> +# cat /sys/bus/edac/devices/acpi_ras_mem0/scrub0/max_cycle_duration
> +
> +86400
> +

ditto.

> +3.1.4. Program scrubbing for the memory region in RAS2 device to repeat every
> +43200 seconds (half a day).
> +
> +# echo 43200 > /sys/bus/edac/devices/acpi_ras_mem0/scrub0/current_cycle_duration
> +
> +3.1.5. Start 'demand scrubbing'.
> +
> +When a demand scrub is started, any background scrub currently in progress
> +will be stopped and then automatically restarted once the demand scrub has
> +completed.

Will it restart where it left off or at the beginning?

> +
> +# echo 1 > /sys/bus/edac/devices/acpi_ras_mem0/scrub0/enable_demand
> +
> +3.2. Background scrubbing the entire memory
> +
> +3.2.1. Query the status of background scrubbing.
> +
> +# cat /sys/bus/edac/devices/acpi_ras_mem0/scrub0/enable_background
> +
> +0
> +
> +3.2.2. Program background scrubbing for RAS2 device to repeat in every 21600
> +seconds (quarter of a day).
> +
> +# echo 21600 > /sys/bus/edac/devices/acpi_ras_mem0/scrub0/current_cycle_duration
> +
> +3.2.3. Start 'background scrubbing'.
> +
> +# echo 1 > /sys/bus/edac/devices/acpi_ras_mem0/scrub0/enable_background

--
~Randy