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 8C916606A322 for ; Thu, 3 Dec 2026 11:03:45 +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=H2iN+B0f Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 52D9B1127E2; Thu, 3 Dec 2026 11:03:40 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id E1CFB10E5EB for ; Thu, 3 Dec 2026 11:03:33 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 9C88640513; Thu, 3 Dec 2026 11:03:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D0761F000C1; Thu, 3 Dec 2026 11:03:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796295813; bh=20kwzwjouNq2s+zy2pyQZUwai+KrEH63gqihfzQCc9A=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=H2iN+B0fR4Pe9eDTmht7EQ0dvDeFwliOTXXbCyYmq7u+6JXR584vJzNHeE10PATHZ DRhWFIo2Ysk7eBoJVYDP7wYEfEaT+Fl4nxic0gZVMS9Zl2POqWx+3y9sQ53FAVHzGb Y9IA7k8u80pZmiayQdMgEsNyYSyJdS4KyQ4KMgeUKdFLBy99uQm2xn6spTJ5EeeHl0 7FBKz1tFHZbPLupo+3p+QqXoDaPIcL7XSTqzXlzN0fD6nZwbfdVf43oNQwUGyTSwgl nWqtwHvrMn4Y9xqxSvjRW4F42SKezgStmE7VVfwXyhR1JZH1CbYKUKnC4P6BaYPdux SGYege17wSumQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 3/3] drm/xe/ras: Suppress reports for repeated DB-ECC errors To: "Mallesh Koujalagi" , intel-xe@lists.freedesktop.org In-Reply-To: <20261203103632.2379654-8-mallesh.koujalagi@intel.com> References: <20261203103632.2379654-5-mallesh.koujalagi@intel.com> <20261203103632.2379654-8-mallesh.koujalagi@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 11:03:33 +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 4 potential issues to consider: - [High] drm/xe/ras: ras_send_error_event() drops events after wedging errors - [Medium] drm/xe/ras: removing xe_info() leaves default RAS components unlogged - [Medium] drm/xe/ras: quiet suppression masks failed or first-time page offlines - [Low] drm/xe/ras: TOCTOU on offlined_pages in handle_device_memory_errors() -- commit df9f80dd3af4214c7ee1c52db5140c24a8bb1d09 Author: Mallesh Koujalagi drm/xe/ras: Suppress reports for repeated DB-ECC errors This commit suppresses dmesg logs, CPER records, and DRM-RAS error events when a repeated double-bit ECC error hits an already hard-offlined page and page offlining succeeds. It also removes the generic info log from xe_ras_process_errors() and moves ras_send_error_event() after the component error handlers. > diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c > index fa23325fb691c..d8042ef83dbc5 100644 > --- a/drivers/gpu/drm/xe/xe_ras.c > +++ b/drivers/gpu/drm/xe/xe_ras.c [ ... ] > @@ -675,11 +679,18 @@ static u8 handle_device_memory_errors(struct xe_dev= ice *xe, struct xe_ras_error_ > break; > } > =20 > + /* Check if the page was already hard-offlined */ > + recurrent =3D xe_ras_get_enable_vram_page_offline(xe) && > + page_is_hard_offlined(xe, info->sw_address); > 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); > + > + /* Suppress reporting for repeated errors on hard-offlined pages */ > + *quiet =3D recurrent && !ret; > + if (!*quiet) > + 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); [Severity: Medium] Can setting *quiet from recurrent && !ret suppress reporting when handle_page_offline() actually failed or soft-offlined a live page? In handle_page_offline(), errors from xe_ttm_vram_handle_addr_fault() other than -EIO, -EEXIST, or -ENOMEM (such as -EOPNOTSUPP or -ENXIO) skip send_page_offline_cmd() and return 0. If the page is in state->offlined_pages, *quiet becomes true and drops the CPER and event. Probe-time process_offline_pages() also inserts pages into state->offlined_pages even when handle_page_offline() fails with -ENOMEM, so a later DB-ECC error on a live BO at that address returns 0 and gets suppressed. Returning quiet directly from handle_page_offline() only on a successful -EEXIST hard-offlined path would avoid both cases and drop the duplicate checks. [Severity: Low] Can concurrent calls to xe_ras_process_errors() race on offlined_pages and miss suppressing a repeated DB-ECC error? For non-fatal PCIe AER errors where is_aer_internal_error() is false, xe_pci_error_detected() leaves hw_error_work enabled, and xe_ras_process_errors() has no lock serializing callers: CPU0 (hw_error_work) CPU1 (xe_pci_error_mmio_enabled) -------------------- -------------------------------- xe_ras_process_errors() xe_ras_process_errors() handle_device_memory_errors() handle_device_memory_errors() handle_page_offline() page_is_hard_offlined() -> false send_page_offline_cmd() xa_store(offlined_pages) handle_page_offline() page_is_hard_offlined() -> true send_page_offline_cmd(REMOVE) *quiet =3D false <-- not suppressed CPU1 handles the error as a hard-offlined repeat and removes it from firmware, but still emits a duplicate log, CPER record, and DRM-RAS event. [ ... ] > @@ -880,15 +892,6 @@ enum xe_ras_recovery_action xe_ras_process_errors(st= ruct 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)); > - > - /* Send event once per component */ > - if (!(sent & BIT(component))) { > - sent |=3D BIT(component); > - ras_send_error_event(xe, severity, component); > - } > - > switch (component) { > case XE_RAS_COMP_CORE_COMPUTE: > action =3D handle_core_compute_errors(xe, arr); [Severity: Medium] Does removing this xe_info() leave valid RAS components in the default switch branch completely unlogged? ras_counter_is_valid() accepts XE_RAS_COMP_PCIE and XE_RAS_COMP_RESERVED, which fall into the default case and request XE_RAS_RECOVERY_ACTION_RESET with no dmesg diagnostic (and XE_RAS_COMP_RESERVED emits no DRM-RAS event either). Logging in the default branch, with XE_RAS_COMP_FABRIC breaking before it, would preserve diagnostics for those resets. Also, the commit message does not mention removing this generic info log across all components. [ ... ] > @@ -910,6 +913,12 @@ enum xe_ras_recovery_action xe_ras_process_errors(st= ruct xe_device *xe) > break; > } > =20 > + /* Send event once per component, except for quiet repeats */ > + if (!quiet && !(sent & BIT(component))) { > + sent |=3D BIT(component); > + ras_send_error_event(xe, severity, component); > + } > + [Severity: High] As reported by Rodrigo Vivi on v1 [1], does moving ras_send_error_event() after switch (component) drop DRM-RAS events whenever a handler wedges the device? When handle_page_offline() fails in handle_device_memory_errors(), it calls xe_wedge_declare() before returning; handle_soc_internal_errors() does the same for CSC firmware and PUNIT errors. In the default wedge mode, xe_wedge_declare() synchronously increments xe->wedged.ref via xe_wedge_get(). When ras_send_error_event() then runs, it issues a sysctrl get_counter() mailbox round-trip and calls xe_drm_ras_event() -> drm_ras_counter_get(), which sees xe_wedged(xe) and returns -ECANCELED without emitting the netlink event. Userspace therefore misses the DRM-RAS event on failed DB-ECC handling and fatal SoC errors. [1] https://lore.kernel.org/r/axBhw3UHcIu4IdFb@intel.com --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203103632.2379= 654-5-mallesh.koujalagi@intel.com?part=3D3