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 61B5344C660 for ; Wed, 29 Jul 2026 10:50:32 +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=1785322234; cv=none; b=ruuUjlXmtek86zDDoX83ER6mdT6H4isfQJ8R9RKIAryXHoUuhTyRm3Wzw4hhy5MmFbv3ytrwG76v2VAvjCxaUDhe6tACls7CXUnnIA41DhdrwX85TeMaDrL+5rIC1fNOjsgIXwBnYrJK7boAo3crRnrILJ7WAFN+GRBXEZ3sbm0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785322234; c=relaxed/simple; bh=Es1RRL0a262QkHX37B5D8Xzm0Us1aCw66RTeZbBN99Q=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=oRYNr1ycDeHmNQmY3VZTgExHulZuKaYeAP8KFYDcw8LI2VcwkGyQtFZF53HewQCTm9xp83HrhosWJONA02Zzs8ANKObGjKEvmOA7iwhQQrRxhA219dtnfTGcAHTT+XHmmLYZJ7gZXetpH1a9oNEyKRV7gOwbgOQVXQ3GbkaUZio= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DdOqMT05; 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="DdOqMT05" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2DE11F00A3D; Wed, 29 Jul 2026 10:50:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785322230; bh=7K62gf9mnsw8YXwfAXUUc0dbkDPfOG2M824LVx15Ovw=; h=Subject:To:Cc:From:Date; b=DdOqMT05kwJq7kTPS5p4MybxWJ3idOxUqyfi4lR44p8jsJb2LPOKrjGvMDJynPMXW xY1F1EZCQplJ2ZwiI+eCDt3J0I5N+qJT61XXssgLpG9csPxwQhykjc2L7hO07cM4vp Tk5OkD0QVGDneoLH1qW+fu81HVnFDH5oxMVHGmbQ= Subject: FAILED: patch "[PATCH] drm/amdgpu: Respect placement requirements in amdgpu_gtt_mgr" failed to apply to 6.6-stable tree To: timur.kristof@gmail.com,alexander.deucher@amd.com,christian.koenig@amd.com Cc: From: Date: Wed, 29 Jul 2026 12:50:09 +0200 Message-ID: <2026072909-lunar-eaten-0bc0@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.6-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.6.y git checkout FETCH_HEAD git cherry-pick -x 8882f8897e554053af9e72f4c2da8b1e2cce56c7 # git commit -s git send-email --to '' --in-reply-to '2026072909-lunar-eaten-0bc0@gregkh' --subject-prefix 'PATCH 6.6.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; } /**