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 176C3606A6A5 for ; Thu, 3 Dec 2026 13:42:52 +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=EYe6OzzQ Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CC63610E4C9; Thu, 3 Dec 2026 13:42:46 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 39ED110E4C9 for ; Thu, 3 Dec 2026 13:42:41 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 2050545354; Thu, 3 Dec 2026 13:42:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E81AC1F008A0; Thu, 3 Dec 2026 13:42:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796305361; bh=YQl4SS0R42vjDyWifMRoxjxmE1MD6TLgf4nJHKNP6Lg=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=EYe6OzzQ0UNNUSvF5hDwrQIRDZxv1JMn1lkPuXtPR3jB1QRc9fcPwtvsJCaRrXcvK HdPF6Ms3sSPCaurXQWiDAKrjYq80eJ8p/n5JT6VPu1W4eXRHhhaIJhaVeI9Oh3X8a2 ZWNeZplVolraTRGudnGD6674a/73VY5HiD/W7ps6JlBO5VqY6YEqkPdpBWy6l6oC6R GWo1CCb2pTi+g6b9iev7e7RpNJSj/5tSCgSMTWtZtQlDcq6ATtVBVY0/7BO8dntxdW OQKdbbTJOLWCWYGngGp8ZilO4WHuehiLKFmNL7nX3X2IVKKh7kz8oSP09346dtfDtt uZxgPdtqXbgOw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 1/2] drm/xe/ras: Wedge device if page offline list is full during offlining To: "Soham Purkait" , intel-xe@lists.freedesktop.org In-Reply-To: <20261203131610.1375755-5-soham.purkait@intel.com> References: <20261203131610.1375755-4-soham.purkait@intel.com> <20261203131610.1375755-5-soham.purkait@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 13:42:40 +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 3 potential issues to consider: - [Medium] drm/xe/ras: handle_device_memory_errors() requests reset on full offline list - [Medium] drm/xe/ras: send_page_offline_cmd() wedges before drm_dev_register() - [Low] drm/xe/ras: commit message names OUT_OF_RESOURCES instead of actual status -- commit 950318c0654d4d72359d087413eebbadfa126d78 Author: Soham Purkait drm/xe/ras: Wedge device if page offline list is full during offlining This commit declares the device wedged with recovery method 0 when send_page_offline_cmd() receives XE_RAS_STATUS_INSUFFICIENT_RESOURCES from the system controller firmware. > When a page offline request is sent to the firmware, it response with > OUT_OF_RESOURCES if its offline list in flash is full and cannot hold > any more pages. [Severity: Low] The commit message names OUT_OF_RESOURCES, while the code checks XE_RAS_STATUS_INSUFFICIENT_RESOURCES (and OUT_OF_RESOURCES does not exist in drivers/gpu/drm/xe). Should the commit message be updated to match? > diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c > index 9b04be3405ca7..b65c4ef42e459 100644 > --- a/drivers/gpu/drm/xe/xe_ras.c > +++ b/drivers/gpu/drm/xe/xe_ras.c > @@ -291,6 +291,10 @@ static int send_page_offline_cmd(struct xe_device *x= e, u64 page_address, > if (ret) { > xe_err(xe, "sysctrl: page offline command failed with status %#x\n", > response.status); > + if (response.status =3D=3D XE_RAS_STATUS_INSUFFICIENT_RESOURCES) { > + xe_err(xe, "[RAS]: page offline list is full\n"); > + xe_wedge_declare(xe, 0); > + } > return ret; > } [Severity: Medium] Should handle_device_memory_errors() return XE_RAS_RECOVERY_ACTION_DISCONNECT when send_page_offline_cmd() returns -ENOSPC, instead of requesting a bus reset? send_page_offline_cmd() wedges the device with recovery method 0 and returns -ENOSPC, which handle_page_offline() propagates to handle_device_memory_errors(): drivers/gpu/drm/xe/xe_ras.c:handle_device_memory_errors() { ... if (ret) { xe_wedge_declare(xe, DRM_WEDGE_RECOVERY_BUS_RESET); return XE_RAS_RECOVERY_ACTION_RESET; } } Under XE_WEDGED_MODE_NEVER, xe_wedge_declare() returns without setting xe->wedged.perm. ras_action_to_pci_result() then calls prepare_device_for_reset() -> xe_gt_wedge_declare() (hitting xe_gt_assert(gt, xe->wedged.mode)) and returns PCI_ERS_RESULT_NEED_RESET. Even under the default wedge mode, if an earlier error in the same xe_ras_process_errors() batch already wedged with DRM_WEDGE_RECOVERY_BUS_RESET, xe_wedge_declare(xe, 0) is silently ignored. [Severity: Medium] Can xe_wedge_declare(xe, 0) run during probe before drm_dev_register()? xe_device_probe() calls xe_ras_init() -> get_offline_queue() -> process_offline_pages() -> handle_page_offline() -> send_page_offline_cmd() before drm_dev_register() adds dev->primary->kdev. When probe subsequently fails, devres teardown races with wedge_work(): CPU0 (probe) CPU1 (kworker) xe_device_probe() xe_ras_init() ... send_page_offline_cmd() xe_wedge_declare(xe, 0) schedule_work(...) ... (probe fails before drm_dev_register()) wedge_work() drm_dev_wedged_event() kobject_uevent_env(...) <-- DEVPATH=3D/cardN (unregistered) drm_dev_put() xe_wedge_fini() disable_work_sync(...) If wedge_work() runs first, dev->primary->kdev has only been initialized by drm_sysfs_minor_alloc() and has a NULL parent, so drm_dev_wedged_event() emits a KOBJ_CHANGE uevent with DEVPATH=3D/cardN without any prior KOBJ_ADD and without matching standard DRM udev rules. If disable_work_sync() in xe_wedge_fini() runs first during probe teardown, the WEDGED=3Dunknown uevent is silently dropped. Note that commit 20bc4883c7c0 ("drm/xe/ras: Fix boot-time ras error processing") previously moved xe_ras_process_errors() to avoid wedging before DRM device registration, and commit "drm/xe/ras: Wedge device if page offline list is full at probe" still aborts probe before drm_dev_register(). --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203131610.1375= 755-4-soham.purkait@intel.com?part=3D1