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 54CFC606A322 for ; Thu, 3 Dec 2026 10:48:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=YPx+II2K Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 17DB01127DB; Thu, 3 Dec 2026 10:47:59 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id 793F71127C2; Thu, 3 Dec 2026 10:47:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796294871; x=1827830871; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PSydb/MX/q1YCrYURyVlwacX1hhZjmUbPr+UrPqsr2k=; b=YPx+II2KMMT0gsI2NHu08yXcw0WWz6TAU1G6dtCcqViEYFePL6fBU4RP jKNuYvy3GF1rrXdqyWKPIDeMXWPS13xiFDbvEUrSJZ8i/yNEhE2KfmAJR BCmmITkHto8oXYBgt6xX4D43796AweFMQ8Q5xQXAPOzdcU1NgVlaaFp2Q uoLr22sxkEGNy3c05DLCwlAW13cAPtvp0v305jygA98iIskH1No5zu1jm a33tOy2YXtXPM7n6kIPqN4lzlirq6tGmHVNSvyz3zaBmUVcHs3xn3dqT6 CQbEQcz+oXjf02ommiQxcHs/qIquIbF1aMbkSRRrM7DfdB/G5TvaoptWn A==; X-CSE-ConnectionGUID: Cfi9gIn1T92oq4sXu1ustQ== X-CSE-MsgGUID: lg2N6IOTQDu5H5DvxvBt4g== X-IronPort-AV: E=McAfee;i="6800,10657,11984"; a="5161233" X-IronPort-AV: E=Sophos;i="6.27,248,1787036400"; d="scan'208";a="5161233" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 02:47:50 -0800 X-CSE-ConnectionGUID: IFlDss81QByP8fo/JC9WtA== X-CSE-MsgGUID: LZRpeC53RV6WlXPE4h3vbw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,248,1787036400"; d="scan'208";a="13761700" Received: from ettammin-mobl3.ger.corp.intel.com (HELO fedora) ([10.245.244.105]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 02:47:48 -0800 From: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= To: intel-xe@lists.freedesktop.org Cc: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Matthew Brost , Rodrigo Vivi , stable@vger.kernel.org, Natalie Vock , Arun Pravin , Matthew Auld , DRI-devel Subject: [PATCH v3 2/3] drm/xe: Don't fail runtime suspend permanently on VRAM eviction -ENOMEM Date: Thu, 3 Dec 2026 11:47:14 +0100 Message-ID: <20261203104715.270111-3-thomas.hellstrom@linux.intel.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261203104715.270111-1-thomas.hellstrom@linux.intel.com> References: <20261203104715.270111-1-thomas.hellstrom@linux.intel.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: , Sender: "Intel-xe" X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 If evicting VRAM to system memory fails with -ENOMEM during runtime suspend to D3cold, the error is returned to the runtime PM core. Runtime PM treats any error other than -EAGAIN or -EBUSY from the ->runtime_suspend() callback as fatal, records it in dev->power.runtime_error, and refuses further runtime PM operations on the device until the error is cleared. Memory shortage is a transient condition. Backup objects for pinned BOs are already allocated with __GFP_RETRY_MAYFAIL, and a following patch makes eviction of non-pinned BOs use it as well, which makes -ENOMEM more likely to occur. Convert -ENOMEM from the eviction to -EAGAIN so that the device stays active and runtime suspend is retried at a later idle transition. v2: - Reword the commit message for the new patch order v3: - Rebase onto latest drm-tip Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs") Cc: Matthew Brost Cc: Rodrigo Vivi Cc: intel-xe@lists.freedesktop.org Cc: # v6.8+ Reviewed-by: Rodrigo Vivi Signed-off-by: Thomas Hellström --- drivers/gpu/drm/xe/xe_pm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c index 00d321a7d646..a7571cdc04dc 100644 --- a/drivers/gpu/drm/xe/xe_pm.c +++ b/drivers/gpu/drm/xe/xe_pm.c @@ -582,8 +582,16 @@ int xe_pm_runtime_suspend(struct xe_device *xe) if (xe->d3cold.allowed) { err = xe_bo_evict_all(xe); - if (err) + if (err) { + /* + * Runtime PM treats errors other than -EAGAIN and + * -EBUSY as fatal, so report memory shortage as + * transient to allow a later retry. + */ + if (err == -ENOMEM) + err = -EAGAIN; goto out_resume; + } } for_each_gt(gt, xe, id) { -- 2.56.1