]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu: Fix the lpfn checking condition in drm buddy
authorMa Jun <Jun.Ma2@amd.com>
Wed, 14 Sep 2022 12:53:31 +0000 (20:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Nov 2022 09:04:04 +0000 (10:04 +0100)
commit e0b26b9482461e9528552f54fa662c2269f75b3f upstream.

Because the value of man->size is changed during suspend/resume process,
use mgr->mm.size instead of man->size here for lpfn checking.

Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
Suggested-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220914125331.2467162-1-Jun.Ma2@amd.com
Signed-off-by: Christian König <christian.koenig@amd.com>
Cc: "Limonciello, Mario" <Mario.Limonciello@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c

index 28ec5f8ac1c115ba4a907ad17c1a2077aacbd3aa..27159f1d112ec15da4b01c2310b0a11d45a568af 100644 (file)
@@ -435,7 +435,7 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
        if (place->flags & TTM_PL_FLAG_TOPDOWN)
                vres->flags |= DRM_BUDDY_TOPDOWN_ALLOCATION;
 
-       if (fpfn || lpfn != man->size)
+       if (fpfn || lpfn != mgr->mm.size)
                /* Allocate blocks in desired range */
                vres->flags |= DRM_BUDDY_RANGE_ALLOCATION;