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

Shiju Jose
2025-11-24T10:00:15Z

>-----Original Message-----
>From: Randy Dunlap <rdunlap@infradead.org>
>Sent: 22 November 2025 05:23
>To: Shiju Jose <shiju.jose@huawei.com>; rafael@kernel.org; bp@alien8.de;
>akpm@linux-foundation.org; rppt@kernel.org;
>dferguson@amperecomputing.com; linux-edac@vger.kernel.org; linux-
>acpi@vger.kernel.org; linux-mm@kvack.org; linux-doc@vger.kernel.org;
>tony.luck@intel.com; lenb@kernel.org; leo.duran@amd.com;
>Yazen.Ghannam@amd.com; mchehab@kernel.org
>Cc: Jonathan Cameron <jonathan.cameron@huawei.com>; Linuxarm
><linuxarm@huawei.com>; rientjes@google.com; jiaqiyan@google.com;
>Jon.Grimm@amd.com; dave.hansen@linux.intel.com;
>naoya.horiguchi@nec.com; james.morse@arm.com; jthoughton@google.com;
>somasundaram.a@hpe.com; erdemaktas@google.com; pgonda@google.com;
>duenwen@google.com; gthelen@google.com;
>wschwartz@amperecomputing.com; wbs@os.amperecomputing.com;
>nifan.cxl@gmail.com; tanxiaofei <tanxiaofei@huawei.com>; Zengtao (B)
><prime.zeng@hisilicon.com>; Roberto Sassu <roberto.sassu@huawei.com>;
>kangkang.shen@futurewei.com; wanghuiqiang <wanghuiqiang@huawei.com>
>Subject: Re: [PATCH v13 2/2] ras: mem: Add ACPI RAS2 memory driver
>
>
>
>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)?
In seconds.

>
>> +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.
Unit - Seconds.
>
>> +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?
In this case, presently kernel send 'START_PATROL_SCRUBBER ' command to restart
the background scrubbing and thus restarts at the beginning unless I think firmware
has some implementation to detect this case and 'resume' background scrubbing
where it has stopped. Otherwise I think RAS2 may define some new commands to
'pause' and 'resume' scrubbing if that make sense so that kernel could send those
commands to the firmware for this case.
>
>> +
>> +# 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

Thanks,
Shiju