From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0D739C47DA9 for ; Wed, 17 Jan 2024 10:52:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CA48510E68A; Wed, 17 Jan 2024 10:52:56 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id A3A6010E640 for ; Wed, 17 Jan 2024 10:52:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705488771; x=1737024771; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=F65hGX9V7kCoFup9ZqNeMmiDE7cWzON4MpwdkISF6X8=; b=QIASpBXcU4g7+ejxmmyFPW2Z2Z/rLfbHNCie0Yg5RBbh1PLm0F/qv6k/ hQWBXoPyT8IfYYwHqz+VN3UlbRBO3TlacExnLVWRf+coRwLiiHUtRTN4M +8w15o93bOaz4LnSVsRL9XKC/3IKeYm26Un64wyDx+l107TUOemOQjABc Pw64nGORcqWM2++P3H2tdshw43iLSdx2t/Dq4qzRW/RxCb7ZaOvLxM7I4 p1++YitStETlugKVPexlVUvN30fgrh/YEi5USpwJkvG2DNQXisx6CGYSv mlXeHy5I4QE1D/DpUkmSueUNqEvdhJ7x3TQzyulgx41QLH4Foyt4bwbEl g==; X-IronPort-AV: E=McAfee;i="6600,9927,10955"; a="486292283" X-IronPort-AV: E=Sophos;i="6.05,200,1701158400"; d="scan'208";a="486292283" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2024 02:52:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,200,1701158400"; d="scan'208";a="1843" Received: from clanggaa-mobl.ger.corp.intel.com (HELO fedora..) ([10.249.254.57]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2024 02:52:51 -0800 From: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= To: intel-xe@lists.freedesktop.org Subject: [CI 2/5] drm/ttm: return ENOSPC from ttm_bo_mem_space Date: Wed, 17 Jan 2024 11:52:33 +0100 Message-ID: <20240117105236.121836-3-thomas.hellstrom@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240117105236.121836-1-thomas.hellstrom@linux.intel.com> References: <20240117105236.121836-1-thomas.hellstrom@linux.intel.com> 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-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" From: Christian König Only convert it to ENOMEM in ttm_bo_validate. This allows ttm_bo_validate to distinct between an out of memory situation and just out of space in a placement domain. Signed-off-by: Christian König Reviewed-by: Thomas Hellström --- drivers/gpu/drm/ttm/ttm_bo.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index edf10618fe2b..8c1eaa74fa21 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -830,7 +830,7 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo, goto error; } - ret = -ENOMEM; + ret = -ENOSPC; if (!type_found) { pr_err(TTM_PFX "No compatible memory type found\n"); ret = -EINVAL; @@ -916,6 +916,9 @@ int ttm_bo_validate(struct ttm_buffer_object *bo, return -EINVAL; ret = ttm_bo_move_buffer(bo, placement, ctx); + /* For backward compatibility with userspace */ + if (ret == -ENOSPC) + return -ENOMEM; if (ret) return ret; -- 2.43.0