From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796288035; b=vZxmW+zD1vonATbr3bRzNbew3k2I5HMaZ0x8y1PIKHe6WUkmwLN+paaPr6QyV5U0QFhy GyoC+gzu3aeMzxagU6ykBiFoZDf8x3rdy7prkzdGT7MyTWdSE9EMdACIxRFXf52EWH+CW 6R2siAgAEKNmvF/Vxi5HCqpYYlu1YnKDhEjQ+nBvGqBGalDY6k6lAe5Cq8Bl4d+8l9qhV ZfCwVMiZIHKO31UjmMn3C0lG7cyY4C/7+CWoyRm5OGRNuLkwSUALAnru5AAaGJdv41Xns 4iiEQt8wC7VowzRbSrBpopIWewR6x/AcGiowzvP4NRe40c1m4QJtw3MIlKZAMVYeLAA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796288035; 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=jueLXudCQXE1dfHpBuQ8tS134l/18U/GAYsAsnHbnw4=; b=g1PawtP7OfDFg70ruUSLoSogD2WW91fVGLHF/yOvFwfdY2mHGvs1h5BxKWt+k8Dip7sK 4hoj4/bBFuuRtTjTi7OIXK1waSKDIaTMzURf4dEyi5Nk6RpcoQ0W1/0Fbem2GGQYDaKir XaJT+svTljHZnwg4tirvwpKRJKj9KwnRvYluSm+R0cvVnv3/7ypysPx1qN03fqRxwNwdq PbFby+ZVVsvYinK4Q2Ga9HqgemH58fPceWl14WyDh6Ck9L2HJexlw4Y6TbinUgIEHOu6c qMLomBQ/XyGtfAov231p2rgp9deXJmb6sqmEU5206G6v71SQfjYtN+8Di4X4xtbHQ7w== 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=PlSi9OFI; arc=none smtp.remote-ip=192.198.163.18 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 24175606A322 for ; Thu, 3 Dec 2026 08:53:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 24175606A322 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=PlSi9OFI DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796288035; x=1827824035; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jueLXudCQXE1dfHpBuQ8tS134l/18U/GAYsAsnHbnw4=; b=PlSi9OFIL0OxyL0E8GFjm/j9tsVr62hvLE9t+skAvuzD265uJaRoikvs fsxIzpwOCuAhHB6GTnoU80M1RiSgXh1igbEBzrU8U+PLJXY7k6MIBSQZA dTD3V9w+TkSLsFeH2WD8/smB8otiDAKmtHpmww8kkR5U9/+bwWS8yxqg3 mTntZeuEto82RPMDQJa5sTdPQ8xn+8TTQMaln11hApAR5dsupSU4JH04q 7UtrcVVa+oXlF/HNcpOUbG5vA9gVf9P1PK1mS6TgJLrmxsPy2e6a4BPiz ddJShEawrCa2ffOs9HCpeMoOW5b+ugVaBRDG0vnM/vbALKhda+GRLkknC w==; X-CSE-ConnectionGUID: 3WY+Tt6eSuyJV6lXZ7896w== X-CSE-MsgGUID: rX57bQ73QsiimHohGF4FBg== X-IronPort-AV: E=McAfee;i="6800,10657,11984"; a="5248385" X-IronPort-AV: E=Sophos;i="6.27,248,1787036400"; d="scan'208";a="5248385" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 00:53:55 -0800 X-CSE-ConnectionGUID: KSQDGFgMQVWDGb0fsABLFg== X-CSE-MsgGUID: zOS4I/gjQ5G4WnI3WEZHpw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,248,1787036400"; d="scan'208";a="14077763" Received: from kniemiec-mobl1.ger.corp.intel.com (HELO fedora) ([10.245.244.75]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 00:53:53 -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 v2 2/3] drm/xe: Don't fail runtime suspend permanently on VRAM eviction -ENOMEM Date: Thu, 3 Dec 2026 09:53:20 +0100 Message-ID: <20261203085321.235694-3-thomas.hellstrom@linux.intel.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261203085321.235694-1-thomas.hellstrom@linux.intel.com> References: <20261203085321.235694-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. 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 103290fd6445..f1dc97afb72a 100644 --- a/drivers/gpu/drm/xe/xe_pm.c +++ b/drivers/gpu/drm/xe/xe_pm.c @@ -581,8 +581,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