]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu: Fix for BO move issue
authorArunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Tue, 18 Oct 2022 14:08:38 +0000 (07:08 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Nov 2022 15:00:21 +0000 (00:00 +0900)
commit 8273b4048664fff356fd10059033f0e2f5a422a1 upstream.

A user reported a bug on CAPE VERDE system where uvd_v3_1
IP component failed to initialize as there is an issue with
BO move code from one memory to other.

In function amdgpu_mem_visible() called by amdgpu_bo_move(),
when there are no blocks to compare or if we have a single
block then break the loop.

Fixes: 312b4dc11d4f ("drm/amdgpu: Fix VRAM BO swap issue")
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: "Limonciello, Mario" <Mario.Limonciello@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

index 794062ab57fca48b39cc209d1f43e3b5eb33fdb8..9e6c23266a1a0f01f1d00809cb077546a2104515 100644 (file)
@@ -439,6 +439,9 @@ static bool amdgpu_mem_visible(struct amdgpu_device *adev,
        while (cursor.remaining) {
                amdgpu_res_next(&cursor, cursor.size);
 
+               if (!cursor.remaining)
+                       break;
+
                /* ttm_resource_ioremap only supports contiguous memory */
                if (end != cursor.start)
                        return false;