From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.175.65.13 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796294870; b=oSr7uQq02Edj+BsqVswcnD7B7Q4GSJTLDWa2Ug5dJlezJ49xatM4g8JmfFR5FPcGHaHz NTEb1Q2KlajWChluRHL5hITsMLHIKobjmxF3cXCdTO7efes9bQVT4smc9N3N1PrvyXfW/ WaboNE+9/M97ZTfI57UeGyP1gHk9qUKWiV7WDKhvYIuqQRgguMvC0dHsyPoO3ONo8nW2/ PAMY3SKT1DaR2DnNlAWRjR7mrnl4NnQIoI+5YKCRECQyN2ZXLdJzmVq9p7v+qAScFyk9T rCaRG9ttF1dg9ZQjTMQQvOLlm+UHZJn9wgKMpLanN1B316zZcG71S5eD+HydBs2W8BA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796294870; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Type:Content-Transfer-Encoding; bh=PSydb/MX/q1YCrYURyVlwacX1hhZjmUbPr+UrPqsr2k=; b=UXhbrmRnsLpjAxW+cyn8gPBmLuG3mcEjsnBdADoAHHBOg4DyiLUIlohBlRdgnSu0ITqR ewQUcxinEhcbDsFAmq/0YieP317crS85AGnXzDFCOBgkYF5vUePRYjCE0U09E5WjF8/xA hibVY0fcnrk5ERU3bL3TqpJvCv+ApFkb8x465uX9/h7VulrheCnPgMYaQX19rfkPispDb N1UfSerlkhpJ4G/nLkZhwRn++AguVU44v4KMvDVEn/jlRu52VxrehemipXDC6I1kvjTrM 5O9uud0O+k6+VgZmVNtu37zBZwkk5HN32KMNJLgwShFgjG9YYAL38GmQ2wDHbVqm9CQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=YPx+II2K; arc=none smtp.remote-ip=198.175.65.13 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C850606A322 for ; Thu, 3 Dec 2026 10:47:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4C850606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com 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 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: 7CgRsGRGTB+j+y3jSWXz2g== X-CSE-MsgGUID: iIOZ3a7zQCe8PwlYryTPog== X-IronPort-AV: E=McAfee;i="6800,10657,11984"; a="5161231" X-IronPort-AV: E=Sophos;i="6.27,248,1787036400"; d="scan'208";a="5161231" 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-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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