From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4ADE606A320 for ; Tue, 1 Dec 2026 10:47:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ahB52rD1 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7FBC610F159; Tue, 1 Dec 2026 10:47:12 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id C25CD10F159 for ; Tue, 1 Dec 2026 10:47:05 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 6904C44897; Tue, 1 Dec 2026 10:47:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 349DF1F0089A; Tue, 1 Dec 2026 10:47:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796122025; bh=7T+bITesXwE4cq2yEYlsKgKsHZ/fcPABtmheHf5DwCk=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=ahB52rD1zu7qy6+V3TmnOPRKe/1Eot2LU2cy1H6ttegF+ZQLRiQx1ZQYK8RUP+EsG Db05Av1FFd/VwWg8yC3nzfBLe/PuRBnJ9fXVzKWAAB6eAYj1+BOb3i5lU8u24qlYoK sUnKLWowomPuI0EIBfNI3IGJne0AYRVi+aVX4SawO8frpSuix9VpGQkZjvuKIQ/pv9 46WRglwNeMFx1v6KyO0otvqUrBl4uElN1ADX2OxP0OtrP+/OWH6ATZv1kXqBgznvD5 +Qy+zdavve/Xc73FWDtMczk6l8hsedP0UICaB+gBOj4OYs2dANuJan9AOKejXOAGQ2 v9lqsYsaWhzAA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v1] drm/xe/ras: Suppress recurrent DB-ECC reports for hard-offlined pages To: "Mallesh Koujalagi" , intel-xe@lists.freedesktop.org In-Reply-To: <20261201103604.2253707-2-mallesh.koujalagi@intel.com> References: <20261201103604.2253707-2-mallesh.koujalagi@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 10:47:04 +0000 X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "Intel-xe" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] drm/xe/ras: xe_ras_process_errors() suppresses reports before handler fails - [Medium] drm/xe/ras: inconsistent hard-offline checks in handle_page_offline() -- commit e4e6d95f2074dc3797cbc88978fa20a3d512eb13 Author: Aravind Iddamsetty drm/xe/ras: Suppress recurrent DB-ECC reports for hard-offlined pages This commit suppresses per-page action logs, component detection logs, DRM RAS events, and CPER emission for recurrent DB-ECC errors on pages that have already been hard-offlined by firmware. > diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c > index 9b04be3405ca7..1c6b78860af54 100644 > --- a/drivers/gpu/drm/xe/xe_ras.c > +++ b/drivers/gpu/drm/xe/xe_ras.c [ ... ] > @@ -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_ad= dress); > + if (log_action) > + xe_info(xe, "[RAS]: Page address 0x%llx removed from queue\n", > + page_address); > } > =20 > return 0; > } > =20 > -static int handle_page_offline(struct xe_device *xe, u64 page_address, b= ool 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, b= ool notify_fw, > + bool suppress_recurrent_report) > { > struct xe_ras_state *state =3D &xe->ras.state; > enum xe_ras_page_action action; > + bool recurrent_hard_offlined =3D false; > u64 addr; > int ret; > =20 > @@ -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 addres= s 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 =3D true; > action =3D XE_RAS_PAGE_ACTION_REMOVE; > - else > + } else { > + xe_dbg(xe, "[RAS]: Repeated error on already soft-offlined page addre= ss 0x%llx\n", > + page_address); > action =3D 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 > =20 > notify: > if (notify_fw) { > - ret =3D send_page_offline_cmd(xe, page_address, action); > + bool log_action; > + > + log_action =3D !(suppress_recurrent_report && recurrent_hard_offlined); > + ret =3D send_page_offline_cmd(xe, page_address, action, log_action); > if (ret) > return ret; > } [Severity: Medium] Can page_is_hard_offlined() and handle_page_offline() disagree on whether a page is a recurrent hard-offlined page? At probe, get_offline_list() -> process_offline_pages() stores every page returned by firmware in state->offlined_pages regardless of whether handle_page_offline() actually soft-offlined it in TTM. When disable_vram_page_offline (logging-only mode) is enabled, handle_page_offline() jumps to notify before calling xe_ttm_vram_handle_addr_fault(), so those pages remain allocatable and recurrent_hard_offlined stays false: drivers/gpu/drm/xe/xe_ras.c:handle_page_offline() { ... if (xe_ras_get_disable_vram_page_offline(xe)) { action =3D XE_RAS_PAGE_ACTION_REMOVE; xe_dbg(xe, "[RAS]: User policy set to disable page offlining\n"); goto notify; } ... } When a DB-ECC error later hits one of those pages (or a page whose TTM soft-offlining failed at probe and now succeeds with ret =3D=3D 0 instead of -EEXIST), page_is_hard_offlined() sees the entry in state->offlined_pages and suppresses the component log, DRM RAS event, and CPER record, while handle_page_offline() leaves recurrent_hard_offlined as false and still logs the queue removal. [ ... ] > @@ -668,11 +688,13 @@ static u8 handle_device_memory_errors(struct xe_dev= ice *xe, struct xe_ras_error_ > break; > } > =20 > - ret =3D 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 =3D page_is_hard_offlined(xe, info->sw_address= ); > + ret =3D 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 re= cover. > * TODO: Trigger SBR using pci_reset_bus > @@ -691,6 +713,20 @@ static u8 handle_device_memory_errors(struct xe_devi= ce *xe, struct xe_ras_error_ > return XE_RAS_RECOVERY_ACTION_RECOVERED; > } > =20 > +static bool suppress_recurrent_db_ecc_report(struct xe_device *xe, > + struct xe_ras_error_array *arr) > +{ > + struct xe_ras_memory_error *info =3D (void *)arr->details; > + > + if (arr->counter.common.component !=3D XE_RAS_COMP_DEVICE_MEMORY) > + return false; > + > + if (info->category !=3D 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) > { > @@ -861,6 +897,7 @@ enum xe_ras_recovery_action xe_ras_process_errors(str= uct xe_device *xe) > for (int i =3D 0; i < response.num_errors && i < XE_RAS_NUM_ERROR_ARR;= i++) { > struct xe_ras_error_array *arr =3D &response.arr[i]; > enum xe_ras_recovery_action action; > + bool suppress_report; > u8 component, severity; > =20 > component =3D arr->counter.common.component; > @@ -869,11 +906,14 @@ enum xe_ras_recovery_action xe_ras_process_errors(s= truct xe_device *xe) > if (!ras_counter_is_valid(xe, &arr->counter)) > continue; > =20 > - xe_info(xe, "[RAS]: %s %s detected\n", comp_to_str(component), > - sev_to_str(severity)); > + suppress_report =3D 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)); > =20 > /* Send event once per component */ > - if (!(sent & BIT(component))) { > + if (!suppress_report && !(sent & BIT(component))) { > sent |=3D BIT(component); > ras_send_error_event(xe, severity, component); > } [Severity: Medium] Does xe_ras_process_errors() suppress the component detection log and ras_send_error_event() even when handle_page_offline() subsequently fails? suppress_recurrent_db_ecc_report() only checks page_is_hard_offlined() before calling handle_device_memory_errors(). If handle_page_offline() then returns an error (for example, if send_page_offline_cmd() fails or the address in state->offlined_pages from get_offline_list() belongs to a critical BO and returns -EIO), handle_device_memory_errors() emits the CPER record and wedges the device for a bus reset, but the component detection log and the userspace DRM RAS event notification have already been skipped. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201103604.2253= 707-2-mallesh.koujalagi@intel.com?part=3D1