Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] drm/xe/ras: Suppress recurrent DB-ECC reports for hard-offlined pages
@ 2026-12-01 10:36 Mallesh Koujalagi
  2026-12-01 10:47 ` sashiko-bot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mallesh Koujalagi @ 2026-12-01 10:36 UTC (permalink / raw)
  To: intel-xe
  Cc: rodrigo.vivi, anshuman.gupta, badal.nilawar, riana.tauro,
	karthik.poosa, sk.anirban, raag.jadav, himal.prasad.ghimiray,
	tejas.upadhyay, aravind.iddamsetty, Mallesh Koujalagi

From: Aravind Iddamsetty <aravind.iddamsetty@linux.intel.com>

Repeated DB-ECC errors can be reported again for addresses that were
already hard-offlined by firmware. These recurrent reports are not
actionable and cause duplicate dmesg noise and extra reporting/CPER
traffic.

Keep the firmware queue flow intact, but suppress recurrent reporting:
- continue handling repeated page faults and notify firmware so entries are
  removed from the offline queue
- suppress per-page action logs for recurrent hard-offlined pages
- suppress component-level "detected" logging/event signaling for recurrent
  hard-offlined DB-ECC records
- suppress DB-ECC xe_log_comp emission for those recurrent records

This preserves first/second occurrence behavior while avoiding repeated
logging and CPER emission for the same already hard-offlined page.

Cc: Raag Jadav <raag.jadav@intel.com>
Cc: Riana Tauro <riana.tauro@intel.com>
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: Tejas Upadhyay <tejas.upadhyay@intel.com>
Signed-off-by: Aravind Iddamsetty <aravind.iddamsetty@linux.intel.com>
Signed-off-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com>
---
 drivers/gpu/drm/xe/xe_ras.c | 76 ++++++++++++++++++++++++++++---------
 1 file changed, 58 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
index f8113530068d..e25b4cdb8d9a 100644
--- a/drivers/gpu/drm/xe/xe_ras.c
+++ b/drivers/gpu/drm/xe/xe_ras.c
@@ -255,7 +255,8 @@ static inline const char *comp_to_str(u8 component)
 }
 
 static int send_page_offline_cmd(struct xe_device *xe, u64 page_address,
-				 enum xe_ras_page_action action)
+				 enum xe_ras_page_action action,
+				 bool log_action)
 {
 	struct xe_sysctrl_mailbox_command command = {0};
 	struct xe_ras_page_offline_request request = {0};
@@ -295,7 +296,8 @@ static int send_page_offline_cmd(struct xe_device *xe, u64 page_address,
 	}
 
 	if (action == XE_RAS_PAGE_ACTION_OFFLINE) {
-		xe_info(xe, "[RAS]: Page address 0x%llx offlined\n", page_address);
+		if (log_action)
+			xe_info(xe, "[RAS]: Page address 0x%llx offlined\n", page_address);
 		ret = xa_err(xa_store(&state->offlined_pages,
 				      page_address >> XE_PTE_SHIFT,
 				      XE_RAS_PAGE_OFFLINED, GFP_KERNEL));
@@ -303,16 +305,28 @@ static int send_page_offline_cmd(struct xe_device *xe, u64 page_address,
 			xe_err(xe, "[RAS]: Failed to store offlined page 0x%llx: %d\n",
 			       page_address, ret);
 	} else {
-		xe_info(xe, "[RAS]: Page address 0x%llx removed from queue\n", page_address);
+		if (log_action)
+			xe_info(xe, "[RAS]: Page address 0x%llx removed from queue\n",
+				page_address);
 	}
 
 	return 0;
 }
 
-static int handle_page_offline(struct xe_device *xe, u64 page_address, bool notify_fw)
+static bool page_is_hard_offlined(struct xe_device *xe, u64 page_address)
+{
+	if (!IS_ALIGNED(page_address, XE_PAGE_SIZE))
+		return false;
+
+	return !!xa_load(&xe->ras.state.offlined_pages, page_address >> XE_PTE_SHIFT);
+}
+
+static int handle_page_offline(struct xe_device *xe, u64 page_address, bool notify_fw,
+			       bool suppress_recurrent_report)
 {
 	struct xe_ras_state *state = &xe->ras.state;
 	enum xe_ras_page_action action;
+	bool recurrent_hard_offlined = false;
 	u64 addr;
 	int ret;
 
@@ -349,12 +363,14 @@ static int handle_page_offline(struct xe_device *xe, u64 page_address, bool noti
 		xe_err(xe, "[RAS]: Page address 0x%llx belongs to critical BO\n", page_address);
 		return ret;
 	case -EEXIST:
-		xe_dbg(xe, "[RAS]: Repeated error on already soft-offlined page address 0x%llx\n",
-		       page_address);
-		if (xa_load(&state->offlined_pages, page_address >> XE_PTE_SHIFT))
+		if (xa_load(&state->offlined_pages, page_address >> XE_PTE_SHIFT)) {
+			recurrent_hard_offlined = true;
 			action = XE_RAS_PAGE_ACTION_REMOVE;
-		else
+		} else {
+			xe_dbg(xe, "[RAS]: Repeated error on already soft-offlined page address 0x%llx\n",
+			       page_address);
 			action = XE_RAS_PAGE_ACTION_OFFLINE;
+		}
 		break;
 	case -ENOMEM:
 	default:
@@ -365,7 +381,10 @@ static int handle_page_offline(struct xe_device *xe, u64 page_address, bool noti
 
  notify:
 	if (notify_fw) {
-		ret = send_page_offline_cmd(xe, page_address, action);
+		bool log_action;
+
+		log_action = !(suppress_recurrent_report && recurrent_hard_offlined);
+		ret = send_page_offline_cmd(xe, page_address, action, log_action);
 		if (ret)
 			return ret;
 	}
@@ -438,7 +457,7 @@ static void process_offline_pages(struct xe_device *xe, u32 cmd, void *req, size
 				((struct xe_ras_offline_list_response *)resp)->max_entries;
 
 		for (i = 0; i < common->pages_returned && i < XE_RAS_NUM_PAGES; i++) {
-			handle_page_offline(xe, common->page_addresses[i], notify_fw);
+			handle_page_offline(xe, common->page_addresses[i], notify_fw, false);
 			/* The pages are already offlined by firmware */
 			if (!notify_fw) {
 				index = common->page_addresses[i] >> XE_PTE_SHIFT;
@@ -632,6 +651,7 @@ static u8 handle_device_memory_errors(struct xe_device *xe, struct xe_ras_error_
 {
 	struct xe_ras_memory_error *info = (void *)arr->details;
 	u8 cper_sev = ras_sev_to_cper_sev(arr->counter.common.severity);
+	bool recurrent_hard_offlined;
 	int ret;
 
 	/*
@@ -668,11 +688,13 @@ static u8 handle_device_memory_errors(struct xe_device *xe, struct xe_ras_error_
 			break;
 		}
 
-		ret = handle_page_offline(xe, info->sw_address, true);
-		xe_log_comp(xe, ret ? cper_sev : CPER_SEV_INFORMATIONAL,
-			    DEVICE_MEMORY, &arr->counter, sizeof(arr->counter),
-			    "Double-bit ECC error detected at sw address 0x%llx\n",
-			    info->sw_address);
+		recurrent_hard_offlined = page_is_hard_offlined(xe, info->sw_address);
+		ret = handle_page_offline(xe, info->sw_address, true, true);
+		if (ret || !recurrent_hard_offlined)
+			xe_log_comp(xe, ret ? cper_sev : CPER_SEV_INFORMATIONAL,
+				    DEVICE_MEMORY, &arr->counter, sizeof(arr->counter),
+				    "Double-bit ECC error detected at sw address 0x%llx\n",
+				    info->sw_address);
 		/*
 		 * Wedge the device with a bus reset for errors that require SBR to recover.
 		 * TODO: Trigger SBR using pci_reset_bus
@@ -691,6 +713,20 @@ static u8 handle_device_memory_errors(struct xe_device *xe, struct xe_ras_error_
 	return XE_RAS_RECOVERY_ACTION_RECOVERED;
 }
 
+static bool suppress_recurrent_db_ecc_report(struct xe_device *xe,
+					     struct xe_ras_error_array *arr)
+{
+	struct xe_ras_memory_error *info = (void *)arr->details;
+
+	if (arr->counter.common.component != XE_RAS_COMP_DEVICE_MEMORY)
+		return false;
+
+	if (info->category != XE_RAS_MEMORY_DB_ECC)
+		return false;
+
+	return page_is_hard_offlined(xe, info->sw_address);
+}
+
 void xe_ras_counter_threshold_crossed(struct xe_device *xe,
 				      struct xe_sysctrl_event_response *response)
 {
@@ -865,6 +901,7 @@ enum xe_ras_recovery_action xe_ras_process_errors(struct xe_device *xe)
 		for (int i = 0; i < response.num_errors && i < XE_RAS_NUM_ERROR_ARR; i++) {
 			struct xe_ras_error_array *arr = &response.arr[i];
 			enum xe_ras_recovery_action action;
+			bool suppress_report;
 			u8 component, severity;
 
 			component = arr->counter.common.component;
@@ -873,11 +910,14 @@ enum xe_ras_recovery_action xe_ras_process_errors(struct xe_device *xe)
 			if (!ras_counter_is_valid(xe, &arr->counter))
 				continue;
 
-			xe_info(xe, "[RAS]: %s %s detected\n", comp_to_str(component),
-				sev_to_str(severity));
+			suppress_report = suppress_recurrent_db_ecc_report(xe, arr);
+
+			if (!suppress_report)
+				xe_info(xe, "[RAS]: %s %s detected\n", comp_to_str(component),
+					sev_to_str(severity));
 
 			/* Send event once per component */
-			if (!(sent & BIT(component))) {
+			if (!suppress_report && !(sent & BIT(component))) {
 				sent |= BIT(component);
 				ras_send_error_event(xe, severity, component);
 			}
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-12-01 11:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 10:36 [PATCH v1] drm/xe/ras: Suppress recurrent DB-ECC reports for hard-offlined pages Mallesh Koujalagi
2026-12-01 10:47 ` sashiko-bot
2026-12-01 10:52 ` ✓ CI.KUnit: success for " Patchwork
2026-12-01 11:53 ` ✓ Xe.CI.BAT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox