Skip to contentSkip to conversation

ACPI: Add support for ACPI RAS2 feature table

PATCH Superseded [email protected] 2 participants 4 messages Jul 4 – Jul 5

Subsystems (6)

v20 of 23 Superseded Latest is v23 →

lore
Share & tools
lore
#0 lore raw

v20 cover ACPI: Add support for ACPI RAS2 feature table

From: Shiju Jose <[email protected]>

Add support for ACPI RAS2 feature table (RAS2) defined in the ACPI 6.5 specification, section 5.2.21 and RAS2 HW based memory scrubbing feature.

ACPI RAS2 patches were part of the EDAC series [1].

The code is based on linux.git v7.2-rc1 [2].

1. https://lore.kernel.org/linux-cxl/[email protected]/
2. https://github.com/torvalds/linux.git

Changes
=======
v19 -> v20:
1. Added possible fixes for gemini AI reported issues shared by Borislav. Thanks.
https://sashiko.dev/#/patchset/20260408172850.183-1-shiju.jose%40huawei.com
Unfortunately could not get a local sashiko review setup to verify the fixes before posting patches.

v18 -> v19:
1. Fixed gemini tool reported issues sent by Borislav. Thanks.
https://sashiko.dev/#/patchset/20260325165714.294-1-shiju.jose%40huawei.com
- Replace with iowriteX() and ioreadX() for reading fields in RAS2 shared memory tables throughout patches considering big-endian architectures.
- In ras2_send_pcc_cmd(), add extra check for non-zero last_mpar_reset,
changed time_delta to s64, add lockdep_assert_held().
- In register_pcc_channel(), handled case of pcc_chan->latency is 0
and fixed timeout of 0 to readw_relaxed_poll_timeout().
- Fixed double free case When auxiliary_device_add() fails, the driver calls auxiliary_device_uninit(&ras2_ctx->adev).
- In parse_ras2_table(), add check to verify table length is large enough to contain the num_pcc_descs elements it iterates over.
- Add some missing cases to acquire pcc_lock, such as ras2_hw_scrub_read_addr() and ras2_hw_scrub_read_size().
- Removed clearing base and size in ras2_scrub_monitor_thread() when demand scrubbing has finished, to avoid clearing the user set values, though chances are very little.
- Add new field set_scrub_cycle to ras2_ctx to avoid user set value is being cleared when ras2_update_patrol_scrub_params_cache() is being called.
- In ras2_hw_scrub_set_enabled_od(), redesigned to avoid prematurely restart the background scrub due to race condition in ras2_scrub_monitor_thread().
- rename ras2_probe() to ras2_mem_drv_probe()
- add ras2_mem_drv_remove() and call kthread_stop() to stop the ras2_scrub_monitor_thread(). However unregistering the EDAC device which registered in the ras2_mem_drv_probe() will automatically happen in the EDAC via the devm_add_action_or_reset() in edac_dev_register(), edac_dev_unreg() and edac_dev_release().

v17 -> v18:
1. Fixed few AI tool reported issues shared by Borislav. Thanks.
https://lore.kernel.org/all/20260312165247.GSabLvX5DjzhDtmyuh@fat_crate.local/
2. Re-add support for user setting scrub address range for Daniel's reply in v16, which was removed in v13 because of request to simplify the code and with the expectation that the firmware will do the full node demand scrubbing and may enable these attributes later in the follow-up patches.
https://lore.kernel.org/all/[email protected]/

v16 -> v17:
1. Merged all changes suggested by Borislav.
https://lore.kernel.org/all/20260126171552.GJaXehSJp33nFnpvVd@fat_crate.local/
2. Changes for Borislav's feedback "Add remove_aux_device() which unwinds everything add_aux_device() does for all those devices".

v15 -> v16:
Attempt to modify throughout the code and logs for the below comments from Borislav. Thanks for the comments.
https://lore.kernel.org/all/20251125073627.GLaSVce7hBqGH1a3ni@fat_crate.local/
https://lore.kernel.org/all/20251231131512.GBaVUh4NSWqvr2xhbM@fat_crate.local/
https://lore.kernel.org/all/20260119111701.GBaW4Sres045xnfkpz@fat_crate.local/

v14 -> v15:
1. Incorporated new changes suggested by Borislav on v13.
https://lore.kernel.org/all/20251231131512.GBaVUh4NSWqvr2xhbM@fat_crate.local/

2. Rebase to v6.19-rc5.

v13 -> v14:
1. Modifications for changes wanted by Borislav.
https://lore.kernel.org/all/20251125073627.GLaSVce7hBqGH1a3ni@fat_crate.local/

2. Changes for the comments from Randy Dunlap
https://lore.kernel.org/all/[email protected]/
https://lore.kernel.org/all/[email protected]/
https://lore.kernel.org/all/[email protected]/

v12 -> v13:
1. Fixed some bugs reported and changes wanted by Borislav.
https://lore.kernel.org/all/20250910192707.GAaMHRCxWx37XitN3t@fat_crate.local/

2. Tried modifying the patch header as commented by Borislav.

3. Fixed a bug reported by Yazen.
https://lore.kernel.org/all/[email protected]/

4. Changed setting 'Requested Address Range' for GET_PATROL_PARAMETERS command to meet the requirements from Daniel for Ampere Computing platform.
https://lore.kernel.org/all/[email protected]/

5. In RAS2 driver, removed support for scrub control attributes 'addr' and 'size' for the time being with the expectation that a firmware will do the full node demand scrubbing and may enable these attributes in the future.

6. Add 'enable_demand' attribute to the EDAC scrub interface to start/stop the demand scrub, which is used for the RAS2 demand scrub control.

v11 -> v12:
1. Modified logic for finding the lowest contiguous phy memory addr range for NUMA domain using node_start_pfn() and node_spanned_pages() according to the feedback from Mike Rapoport in v11.
https://lore.kernel.org/all/[email protected]/

2. Rebase to 6.17-rc4.

v10 -> v11:
1. Simplified code by removing workarounds previously added to support non-compliant case of single PCC channel shared across all proximity domains (which is no longer required).
https://lore.kernel.org/all/[email protected]/

2. Fix for the comments from Borislav (Thanks).
https://lore.kernel.org/all/20250811152805.GQaJoMBecC4DSDtTAu@fat_crate.local/

3. Rebase to 6.17-rc1.

v9 -> v10:
1. Use pcc_chan->shmem instead of acpi_os_ioremap(pcc_chan->shmem_base_addr,...) as it was acpi_os_ioremap internally by the PCC driver to pcc_chan->shmem.

2. Changes required for the Ampere Computing system where uses a single
PCC channel for RAS2 memory features across all NUMA domains. Based on the requirements from by Daniel on V9
https://lore.kernel.org/all/[email protected]/
and discussion with Jonathan.
2.1 Add node_to_range lookup facility to numa_memblks. This is to retrieve the lowest
physical continuous memory range of the memory associated with a NUMA domain.
2.2. Set requested addr range to the memory region's base addr and size
while send RAS2 cmd GET_PATROL_PARAMETER
in functions ras2_update_patrol_scrub_params_cache() & ras2_get_patrol_scrub_running().
2.3. Split struct ras2_mem_ctx into struct ras2_mem_ctx_hdr and struct ras2_pxm_domain
to support cases, uses a single PCC channel for RAS2 scrubbers across all NUMA domains and PCC channel per RAS2 scrub instance. Provided ACPI spec define single memory scrub per NUMA domain.
2.4. EDAC feature sysfs folder for RAS2 changed from "acpi_ras_memX" to "acpi_ras_mem_idX"
because memory scrub instances across all NUMA domains would present under "acpi_ras_mem_id0" when a system uses a single PCC channel for RAS2 scrubbers across all NUMA domains etc.
2.5. Removed Acked-by: Rafael from patch [2], because of the several above changes from v9.

v8 -> v9:
1. Added following changes for feedback from Yazen.
1.1 In ras2_check_pcc_chan(..) function
- u32 variables moved to the same line.
- Updated error log for readw_relaxed_poll_timeout()
- Added error log for if (status & PCC_STATUS_ERROR), error condition.
- Removed an impossible condition check.
1.2. Added guard for ras2_pc_list_lock in ras2_get_pcc_subspace().

2. Rebased to linux.git v6.16-rc2 [2].

v7 -> v8:
1. Rebased to linux.git v6.16-rc1 [2].

v6 -> v7:
1. Fix for the issue reported by Daniel,
In ras2_check_pcc_chan(), add read, clear and check RAS2 set_cap_status outside if (status & PCC_STATUS_ERROR) check.
https://lore.kernel.org/all/[email protected]/

v5 -> v6:
1. Fix for the issue reported by Daniel, in start scrubbing with correct addr and size after firmware return INVALID DATA error for scrub request with invalid addr or size.
https://lore.kernel.org/all/[email protected]/

v4 -> v5:
1. Fix for the build warnings reported by kernel test robot.
https://patchwork.kernel.org/project/linux-edac/patch/[email protected]/
2. Removed patch "ACPI: ACPI 6.5: RAS2: Rename RAS2 table structure and field names" from the series as the patch was merged to linux-pm.git : branch linux-next
3. Rebased to ras.git: edac-for-next branch merged with linux-pm.git : linux-next branch.

v3 -> v4:
1. Changes for feedbacks from Yazen on v3.

    https://lore.kernel.org/all/[email protected]/

v2 -> v3:
1. Rename RAS2 table structure and field names in include/acpi/actbl2.h limited to only necessary
for RAS2 scrub feature.
2. Changes for feedbacks from Jonathan on v2.
3. Daniel reported a known behaviour: when readback 'size' attribute after setting in, returns 0 before starting scrubbing via 'addr' attribute. Changes added to fix this.
4. Daniel reported that firmware cannot update status of demand scrubbing via the 'Actual Address Range (OUTPUT)', thus add workaround in the kernel to update sysfs 'addr' attribute with the status of demand scrubbing.
5. Optimized logic in ras2_check_pcc_chan() function
(patch - ACPI:RAS2: Add ACPI RAS2 driver).
6. Add PCC channel lock to struct ras2_pcc_subspace and change lock in ras2_mem_ctx as a pointer to pcc channel lock to make sure writing to PCC subspace shared memory is protected from race conditions.

v1 -> v2:
1. Changes for feedbacks from Borislav.
- Shorten ACPI RAS2 structures and variables names.
- Shorten some of the other variables in the RAS2 drivers.
- Fixed few CamelCases.

2. Changes for feedbacks from Yazen.
- Added newline after number of '}' and return statements.
- Changed return type for "ras2_add_aux_device() to 'int'.
- Deleted a duplication of acpi_get_table("RAS2",...) in the ras2_acpi_parse_table().
- Add "FW_WARN" to few error logs in the ras2_acpi_parse_table().
- Rename ras2_acpi_init() to acpi_ras2_init() and modified to call acpi_ras2_init() function from the acpi_init().
- Moved scrub related variables from the struct ras2_mem_ctx from patch "ACPI:RAS2: Add ACPI RAS2 driver" to "ras: mem: Add memory ACPI RAS2 driver".

Shiju Jose (2):
ACPI:RAS2: Add driver for the ACPI RAS2 feature table
ras: mem: Add ACPI RAS2 memory driver

 Documentation/ABI/testing/sysfs-edac-scrub |  14 +-
 Documentation/edac/scrub.rst               |  70 +++
 drivers/acpi/Kconfig                       |  11 +
 drivers/acpi/Makefile                      |   1 +
 drivers/acpi/bus.c                         |   3 +
 drivers/acpi/ras2.c                        | 509 +++++++++++++++++++
 drivers/edac/scrub.c                       |  12 +
 drivers/ras/Kconfig                        |  13 +
 drivers/ras/Makefile                       |   1 +
 drivers/ras/acpi_ras2.c                    | 562 +++++++++++++++++++++
 include/acpi/ras2.h                        |  86 ++++
 include/linux/edac.h                       |   4 +
 12 files changed, 1281 insertions(+), 5 deletions(-)
 create mode 100644 drivers/acpi/ras2.c
 create mode 100644 drivers/ras/acpi_ras2.c
 create mode 100644 include/acpi/ras2.h
Signature · 1 line
2.25.1
#1 lore raw

PATCH v20 1/2 ACPI:RAS2: Add driver for the ACPI RAS2 feature table

From: Shiju Jose <[email protected]>

ACPI 6.5 Specification, section 5.2.21, defined RAS2 feature table (RAS2). Driver adds support for RAS2 feature table, which provides interfaces for platform RAS features, e.g., for HW-based memory scrubbing, and logical to PA translation service. RAS2 uses PCC channel subspace for communicating with the ACPI compliant HW platform.

---
 drivers/acpi/Kconfig  |  11 +
 drivers/acpi/Makefile |   1 +
 drivers/acpi/bus.c    |   3 +
 drivers/acpi/ras2.c   | 509 ++++++++++++++++++++++++++++++++++++++++++
 include/acpi/ras2.h   |  57 +++++
 5 files changed, 581 insertions(+)
 create mode 100644 drivers/acpi/ras2.c
 create mode 100644 include/acpi/ras2.h
drivers/acpi/Kconfig +11 -0
index f165d14cf61a..539ff143ccc5 100644
@@ -294,6 +294,17 @@ config ACPI_CPPC_LIB
 	  If your platform does not support CPPC in firmware,
 	  leave this option disabled.
 
+config ACPI_RAS2
+	bool "ACPI RAS2 driver"
+	select AUXILIARY_BUS
+	depends on MAILBOX
+	depends on PCC
+	help
+	  Add support for the RAS2 feature table and provide interfaces for
+	  platform RAS features, such as hardware-based memory scrubbing.
+
+	  If unsure, select N.
+
 config ACPI_PROCESSOR
 	tristate "Processor"
 	depends on X86 || ARM64 || LOONGARCH || RISCV
drivers/acpi/Makefile +1 -0
index d1b0affb844f..abfec6745724 100644
@@ -105,6 +105,7 @@ obj-$(CONFIG_ACPI_EC_DEBUGFS)	+= ec_sys.o
 obj-$(CONFIG_ACPI_BGRT)		+= bgrt.o
 obj-$(CONFIG_ACPI_CPPC_LIB)	+= cppc_acpi.o
 obj-$(CONFIG_ACPI_SPCR_TABLE)	+= spcr.o
+obj-$(CONFIG_ACPI_RAS2)		+= ras2.o
 obj-$(CONFIG_ACPI_DEBUGGER_USER) += acpi_dbg.o
 obj-$(CONFIG_ACPI_PPTT) 	+= pptt.o
 obj-$(CONFIG_ACPI_PFRUT)	+= pfr_update.o pfr_telemetry.o
drivers/acpi/bus.c +3 -0
index a30a904f6535..8d6a0b773bc5 100644
@@ -31,6 +31,7 @@
 #include <acpi/apei.h>
 #include <linux/suspend.h>
 #include <linux/prmt.h>
+#include <acpi/ras2.h>
 
 #include "internal.h"
 
@@ -1610,6 +1611,8 @@ static int __init acpi_init(void)
 	acpi_debugger_init();
 	acpi_setup_sb_notify_handler();
 	acpi_viot_init();
+	acpi_ras2_init();
+
 	return 0;
 }
 
drivers/acpi/ras2.c new file +509 -0

509 lines not on this page · raw message

include/acpi/ras2.h new file +57 -0

57 lines not on this page · raw message

Signature · 1 line
2.25.1
#2 lore raw

PATCH v20 2/2 ras: mem: Add ACPI RAS2 memory driver

In reply to [email protected]

From: Shiju Jose <[email protected]>

ACPI 6.5 Specification, section 5.2.21, defined RAS2 feature table (RAS2). Driver adds support for RAS2 feature table, which provides interfaces for platform RAS features, e.g., for HW-based memory scrubbing, and logical to PA translation service. RAS2 uses PCC channel subspace for communicating with the ACPI compliant HW platform.

ACPI RAS2 auxiliary driver for the memory features binds to the auxiliary device, which is added by the RAS2 table parser in the ACPI RAS2 driver.

Given the address range provided to the userspace may be the lowest scrub address range in the presence of disjoint address ranges, skipping address ranges that are from other NUMA nodes but happen to lie within this range.

Driver retrieves the PA range of the NUMA domain and use it as the 'Requested Address Range', when send RAS2 command GET_PATROL_PARAMETERS to get parameters that apply to all addresses in the NUMA domain.

Device with ACPI RAS2 scrub feature registers with EDAC device driver, which retrieves the scrub descriptor from EDAC scrub and exposes the scrub control attributes for RAS2 scrub instance to userspace in /sys/bus/edac/devices/acpi_ras_memX/scrub0/.

Add 'enable_demand' attribute to the EDAC scrub interface to start/stop the demand scrub, which is used in the RAS2 demand scrub control. When a demand scrub is started, any background scrub currently in progress will be stopped and then automatically restarted at the beginning when the demand scrub has completed.

---
 Documentation/ABI/testing/sysfs-edac-scrub |  14 +-
 Documentation/edac/scrub.rst               |  70 +++
 drivers/edac/scrub.c                       |  12 +
 drivers/ras/Kconfig                        |  13 +
 drivers/ras/Makefile                       |   1 +
 drivers/ras/acpi_ras2.c                    | 562 +++++++++++++++++++++
 include/acpi/ras2.h                        |  29 ++
 include/linux/edac.h                       |   4 +
 8 files changed, 700 insertions(+), 5 deletions(-)
 create mode 100644 drivers/ras/acpi_ras2.c
Documentation/ABI/testing/sysfs-edac-scrub +9 -5
index ab6014743da5..2b874e033623 100644
@@ -20,11 +20,7 @@ KernelVersion:	6.15
 Contact:	[email protected]
 Description:
 		(RW) The base address of the memory region to be scrubbed
-		for on-demand scrubbing. Setting address starts scrubbing.
-		The size must be set before that.
-
-		The readback addr value is non-zero if the requested
-		on-demand scrubbing is in progress, zero otherwise.
+		for demand scrubbing.
 
 What:		/sys/bus/edac/devices/<dev-name>/scrubX/size
 Date:		March 2025
@@ -34,6 +30,14 @@ Description:
 		(RW) The size of the memory region to be scrubbed
 		(on-demand scrubbing).
 
+What:		/sys/bus/edac/devices/<dev-name>/scrubX/enable_demand
+Date:		Jan 2026
+KernelVersion:	6.19
+Contact:	[email protected]
+Description:
+		(RW) Start/Stop demand scrubbing. The stop operation is
+		supported only if the driver and hardware support it.
+
 What:		/sys/bus/edac/devices/<dev-name>/scrubX/enable_background
 Date:		March 2025
 KernelVersion:	6.15
Documentation/edac/scrub.rst +70 -0

73 lines not on this page · raw message

drivers/edac/scrub.c +12 -0
index f9d02af2fc3a..f3b9a2f04950 100644
@@ -14,6 +14,7 @@ enum edac_scrub_attributes {
 	SCRUB_ADDRESS,
 	SCRUB_SIZE,
 	SCRUB_ENABLE_BACKGROUND,
+	SCRUB_ENABLE_DEMAND,
 	SCRUB_MIN_CYCLE_DURATION,
 	SCRUB_MAX_CYCLE_DURATION,
 	SCRUB_CUR_CYCLE_DURATION,
@@ -55,6 +56,7 @@ static ssize_t attrib##_show(struct device *ras_feat_dev,			\
 EDAC_SCRUB_ATTR_SHOW(addr, read_addr, u64, "0x%llx\n")
 EDAC_SCRUB_ATTR_SHOW(size, read_size, u64, "0x%llx\n")
 EDAC_SCRUB_ATTR_SHOW(enable_background, get_enabled_bg, bool, "%u\n")
+EDAC_SCRUB_ATTR_SHOW(enable_demand, get_enabled_od, bool, "%u\n")
 EDAC_SCRUB_ATTR_SHOW(min_cycle_duration, get_min_cycle, u32, "%u\n")
 EDAC_SCRUB_ATTR_SHOW(max_cycle_duration, get_max_cycle, u32, "%u\n")
 EDAC_SCRUB_ATTR_SHOW(current_cycle_duration, get_cycle_duration, u32, "%u\n")
@@ -84,6 +86,7 @@ static ssize_t attrib##_store(struct device *ras_feat_dev,			\
 EDAC_SCRUB_ATTR_STORE(addr, write_addr, u64, kstrtou64)
 EDAC_SCRUB_ATTR_STORE(size, write_size, u64, kstrtou64)
 EDAC_SCRUB_ATTR_STORE(enable_background, set_enabled_bg, unsigned long, kstrtoul)
+EDAC_SCRUB_ATTR_STORE(enable_demand, set_enabled_od, unsigned long, kstrtoul)
 EDAC_SCRUB_ATTR_STORE(current_cycle_duration, set_cycle_duration, unsigned long, kstrtoul)
 
 static umode_t scrub_attr_visible(struct kobject *kobj, struct attribute *a, int attr_id)
@@ -119,6 +122,14 @@ static umode_t scrub_attr_visible(struct kobject *kobj, struct attribute *a, int
 				return 0444;
 		}
 		break;
+	case SCRUB_ENABLE_DEMAND:
+		if (ops->get_enabled_od) {
+			if (ops->set_enabled_od)
+				return a->mode;
+			else
+				return 0444;
+		}
+		break;
 	case SCRUB_MIN_CYCLE_DURATION:
 		if (ops->get_min_cycle)
 			return a->mode;
@@ -164,6 +175,7 @@ static int scrub_create_desc(struct device *scrub_dev,
 		[SCRUB_ADDRESS] = EDAC_SCRUB_ATTR_RW(addr, instance),
 		[SCRUB_SIZE] = EDAC_SCRUB_ATTR_RW(size, instance),
 		[SCRUB_ENABLE_BACKGROUND] = EDAC_SCRUB_ATTR_RW(enable_background, instance),
+		[SCRUB_ENABLE_DEMAND] = EDAC_SCRUB_ATTR_RW(enable_demand, instance),
 		[SCRUB_MIN_CYCLE_DURATION] = EDAC_SCRUB_ATTR_RO(min_cycle_duration, instance),
 		[SCRUB_MAX_CYCLE_DURATION] = EDAC_SCRUB_ATTR_RO(max_cycle_duration, instance),
 		[SCRUB_CUR_CYCLE_DURATION] = EDAC_SCRUB_ATTR_RW(current_cycle_duration, instance)
drivers/ras/Kconfig +13 -0
index fc4f4bb94a4c..a1e6aed8bcc8 100644
@@ -46,4 +46,17 @@ config RAS_FMPM
 	  Memory will be retired during boot time and run time depending on
 	  platform-specific policies.
 
+config MEM_ACPI_RAS2
+	tristate "Memory ACPI RAS2 driver"
+	depends on ACPI_RAS2
+	depends on EDAC
+	depends on EDAC_SCRUB
+	select NUMA_KEEP_MEMINFO
+	help
+	  The driver binds to the auxiliary device added by the ACPI RAS2
+	  feature table parser. The driver uses a PCC channel subspace to
+	  communicate with the ACPI-compliant platform and provides
+	  control of the HW-based memory scrubber parameters to the user
+	  through the EDAC scrub interface.
+
 endif
drivers/ras/Makefile +1 -0
index 11f95d59d397..a0e6e903d6b0 100644
@@ -2,6 +2,7 @@
 obj-$(CONFIG_RAS)	+= ras.o
 obj-$(CONFIG_DEBUG_FS)	+= debugfs.o
 obj-$(CONFIG_RAS_CEC)	+= cec.o
+obj-$(CONFIG_MEM_ACPI_RAS2)	+= acpi_ras2.o
 
 obj-$(CONFIG_RAS_FMPM)	+= amd/fmpm.o
 obj-y			+= amd/atl/
drivers/ras/acpi_ras2.c new file +562 -0

562 lines not on this page · raw message

include/acpi/ras2.h +29 -0
index f4574e8e0a12..3efb580b5e36 100644
@@ -37,6 +37,22 @@ struct device;
  *			is associated with. See ACPI spec 6.5 Table 5.80: RAS2
  *			Platform Communication Channel Descriptor format,
  *			Field: Instance
+ * @mem_base:		Base of the lowest physical continuous memory range
+ *			of the memory associated with the NUMA domain
+ * @mem_size		Size of the lowest physical continuous memory range
+ *			of the memory associated with the NUMA domain
+ * @base:		Base address of the memory region to scrub
+ * @size:		Size of the memory region to scrub
+ * @scrub_cycle_hrs:	Current scrub rate in hours
+ * @set_scrub_cycle:	Scrub rate to set in hours
+ * @min_scrub_cycle:	Minimum scrub rate supported
+ * @max_scrub_cycle:	Maximum scrub rate supported
+ * @od_scrub:		Status of demand scrubbing (memory region)
+ * @bg_scrub:		Status of background patrol scrubbing
+ * @reenable_bg_scrub:	Flag indicates restart background scrubbing after demand
+ *			scrubbing is finished
+ * @thread:		Demand scrub monitor kthread
+ * @drv_active:		Flag indicates RAS2 memory driver is active/removed
  */
 struct ras2_mem_ctx {
 	struct auxiliary_device		adev;
@@ -45,6 +61,19 @@ struct ras2_mem_ctx {
 	void				*sspcc;
 	struct mutex			*pcc_lock;
 	u32				sys_comp_nid;
+	u64				mem_base;
+	u64				mem_size;
+	u64				base;
+	u64				size;
+	u8				scrub_cycle_hrs;
+	u8				set_scrub_cycle;
+	u8				min_scrub_cycle;
+	u8				max_scrub_cycle;
+	bool				od_scrub;
+	bool				bg_scrub;
+	bool				reenable_bg_scrub;
+	struct task_struct		*thread;
+	bool				drv_active;
 };
 
 #ifdef CONFIG_ACPI_RAS2
include/linux/edac.h +4 -0
index e6b4e51130e5..be4f6e52ea38 100644
@@ -684,6 +684,8 @@ enum edac_dev_feat {
  * @write_size: set offset of the scrubbing range.
  * @get_enabled_bg: check if currently performing background scrub.
  * @set_enabled_bg: start or stop a bg-scrub.
+ * @get_enabled_od: check if currently performing demand scrub.
+ * @set_enabled_od: start or stop a demand-scrub.
  * @get_min_cycle: get minimum supported scrub cycle duration in seconds.
  * @get_max_cycle: get maximum supported scrub cycle duration in seconds.
  * @get_cycle_duration: get current scrub cycle duration in seconds.
@@ -696,6 +698,8 @@ struct edac_scrub_ops {
 	int (*write_size)(struct device *dev, void *drv_data, u64 size);
 	int (*get_enabled_bg)(struct device *dev, void *drv_data, bool *enable);
 	int (*set_enabled_bg)(struct device *dev, void *drv_data, bool enable);
+	int (*get_enabled_od)(struct device *dev, void *drv_data, bool *enable);
+	int (*set_enabled_od)(struct device *dev, void *drv_data, bool enable);
 	int (*get_min_cycle)(struct device *dev, void *drv_data,  u32 *min);
 	int (*get_max_cycle)(struct device *dev, void *drv_data,  u32 *max);
 	int (*get_cycle_duration)(struct device *dev, void *drv_data, u32 *cycle);
Signature · 1 line
2.25.1
maintainer
#3 lore raw
In reply to [email protected]
Quoted 7 lines · On Sat, Jul 04, 2026 at 11:07:43PM +0100, [email protected] wrote:

Changes
=======
v19 -> v20:
1. Added possible fixes for gemini AI reported issues shared by Borislav. Thanks.
https://sashiko.dev/#/patchset/20260408172850.183-1-shiju.jose%40huawei.com
Unfortunately could not get a local sashiko review setup to verify the fixes before posting patches.

Yeah, there are new issues now against this set:

https://sashiko.dev/#/patchset/20260704220745.110773-1-shijujose2008%40gmail.com

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette