Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 368C344E659 for ; Wed, 29 Jul 2026 10:50:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785322231; cv=none; b=TvY6cckao3Pen3/y4LFRn3WoWEcXrVr3ydOp+DT/3tatuwY7lhHNZ3GjmOlF944bY+QfUcGEeiY8kiSqoW+sp3dYJZOTgW4305jixxVaH/5zlijQ+Oje+tMWOxjBBR/Xv44G0HeHrAsVU6LIaguUES80GQlKs3J998ULv43bxOc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785322231; c=relaxed/simple; bh=TBbCbqE2rtqwt4mRBjgqDh7/xAJJFR8KeSbnXL1B9gQ=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=SI1yS7gBWXtBjF3iBxM8/17AWGt7o+k7EY26PE53yk71CDIYNtmMGLPnHAIh9v7u7ycC6fy/iVhFlVhWwNprUFVYcbf3Op+BeSp8TIVKCNmsOgo3HlxY4kfhvzEKOkkUnSDvW2XiZ9Yli2N4jDYOGHVFYllC0SHL5ABdsMxLH1w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CKLPx/+g; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="CKLPx/+g" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A26A1F00A3A; Wed, 29 Jul 2026 10:50:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785322222; bh=ni9Tf54RyNtAt/7SwtnxuRbJvzDDvHQZ6fSnsDi5RMs=; h=Subject:To:Cc:From:Date; b=CKLPx/+ghFuVg+KGE5441GD6rGd5t7qHSXJ3jdmpQ1bTRPQ9SPxDVyi8jTYldV3pa 6mYdCAiX37q3N4+OPxsXBaPTvE+S8G8rI2Z3VChiXnsGGRStNMqI0AuZP+y3LURftW /eOp7VqDF4mD7qrGz3aCGF/BWfnL8O8yl8EpMYc8= Subject: FAILED: patch "[PATCH] drm/amdgpu: Respect placement requirements in amdgpu_gtt_mgr" failed to apply to 6.18-stable tree To: timur.kristof@gmail.com,alexander.deucher@amd.com,christian.koenig@amd.com Cc: From: Date: Wed, 29 Jul 2026 12:50:08 +0200 Message-ID: <2026072908-composure-fondly-c978@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.18-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y git checkout FETCH_HEAD git cherry-pick -x 8882f8897e554053af9e72f4c2da8b1e2cce56c7 # git commit -s git send-email --to '' --in-reply-to '2026072908-composure-fondly-c978@gregkh' --subject-prefix 'PATCH 6.18.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ From 8882f8897e554053af9e72f4c2da8b1e2cce56c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Mon, 25 May 2026 13:33:17 +0200 Subject: [PATCH] drm/amdgpu: Respect placement requirements in amdgpu_gtt_mgr functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When testing intersection and compatibility, respect the actual placement requirements. This is a pre-requisite for ensuring that UVD CS BOs do not cross 256M segments. Fixes: ded910f368a5 ("drm/amdgpu: Implement intersect/compatible functions") Suggested-by: Christian König Signed-off-by: Timur Kristóf Reviewed-by: Christian König Signed-off-by: Alex Deucher (cherry picked from commit bc06579ca29dee9c245a41b12e39c7bb6938af5d) Cc: stable@vger.kernel.org diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c index d23a91d029aa..0ea32561c4bc 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c @@ -272,7 +272,20 @@ static bool amdgpu_gtt_mgr_intersects(struct ttm_resource_manager *man, const struct ttm_place *place, size_t size) { - return !place->lpfn || amdgpu_gtt_mgr_has_gart_addr(res); + const struct drm_mm_node *const node = &to_ttm_range_mgr_node(res)->mm_nodes[0]; + const u32 num_pages = PFN_UP(size); + + if (!place->lpfn) + return true; + + if (!amdgpu_gtt_mgr_has_gart_addr(res)) + return false; + + if (place->fpfn >= (node->start + num_pages) || + (place->lpfn && place->lpfn <= node->start)) + return false; + + return true; } /** @@ -290,7 +303,20 @@ static bool amdgpu_gtt_mgr_compatible(struct ttm_resource_manager *man, const struct ttm_place *place, size_t size) { - return !place->lpfn || amdgpu_gtt_mgr_has_gart_addr(res); + const struct drm_mm_node *const node = &to_ttm_range_mgr_node(res)->mm_nodes[0]; + const u32 num_pages = PFN_UP(size); + + if (!place->lpfn) + return true; + + if (!amdgpu_gtt_mgr_has_gart_addr(res)) + return false; + + if (node->start < place->fpfn || + (place->lpfn && (node->start + num_pages) > place->lpfn)) + return false; + + return true; } /**