From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4C33A15442C; Thu, 3 Jul 2025 15:07:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751555248; cv=none; b=YYvKgiyG7MupoWfVUM3k0jZUruSOibTJje+/iLasphQpm7e0e6NFUmAi/23F107Knb0eM3fwhfXtCle638D/zKvTJPntbwOyPfka75K/dvJZZm38TSzJQO8yowhOLdqU8JNFu3VtHG4iWnfbQusNa5Jg6fNkYVjLDU9ZIRmomco= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751555248; c=relaxed/simple; bh=ItRMOX/l/tbuo8nvKCWZBowG9Rlb4ozv2zsOokGmdjs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K+lTVJEPPePh+nc9jAxPG9wYjjMUGgOS8Fag4JrymJdK5La4gdjvE1coOB1AAtwV7WbTDPJQDAVIviNH9hizxyp9m1AwYugmKQzzoG3S9RIvy7n/C2tutnzKjPHCmYZqP52bGMjqJL6869zd2Zuy4PDUgLOv8ahCW48BMxRevWM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=f0Le9aAy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="f0Le9aAy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77987C4CEE3; Thu, 3 Jul 2025 15:07:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1751555247; bh=ItRMOX/l/tbuo8nvKCWZBowG9Rlb4ozv2zsOokGmdjs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f0Le9aAyI7K2QnuKvzaybTI/kksXiGQ6maZwfrXkAJlnR95MRC8Irj7QOL/WWY3pM Fitdz/bONrpFesk0kR/iHJSk6co/o+AAZ42GCv6asdlrS0SELpBWMQuYWjZ3OXQiSt OOYOgDSQIb7bTpSReNJ+71Y9qFXFrp1Ygiq9dPtk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, John Olender , Alex Deucher , Arunpravin Paneer Selvam Subject: [PATCH 6.15 220/263] drm/amdgpu: amdgpu_vram_mgr_new(): Clamp lpfn to total vram Date: Thu, 3 Jul 2025 16:42:20 +0200 Message-ID: <20250703144013.204382951@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250703144004.276210867@linuxfoundation.org> References: <20250703144004.276210867@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: John Olender commit 4d2f6b4e4c7ed32e7fa39fcea37344a9eab99094 upstream. The drm_mm allocator tolerated being passed end > mm->size, but the drm_buddy allocator does not. Restore the pre-buddy-allocator behavior of allowing such placements. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3448 Signed-off-by: John Olender Reviewed-by: Alex Deucher Reviewed-by: Arunpravin Paneer Selvam Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c @@ -463,7 +463,7 @@ static int amdgpu_vram_mgr_new(struct tt int r; lpfn = (u64)place->lpfn << PAGE_SHIFT; - if (!lpfn) + if (!lpfn || lpfn > man->size) lpfn = man->size; fpfn = (u64)place->fpfn << PAGE_SHIFT;