aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGravatar Philip Yang <Philip.Yang@amd.com> 2024-03-11 18:07:34 -0400
committerGravatar Alex Deucher <alexander.deucher@amd.com> 2024-03-20 13:12:57 -0400
commit6c6064cbe58b43533e3451ad6a8ba9736c109ac3 (patch)
tree93712843112903e2ae697a75fafd726f14897e83 /drivers
parentdrm/amdgpu/vcn: enable vcn1 fw load for VCN 4_0_6 (diff)
downloadlinux-6c6064cbe58b43533e3451ad6a8ba9736c109ac3.tar.gz
linux-6c6064cbe58b43533e3451ad6a8ba9736c109ac3.tar.bz2
linux-6c6064cbe58b43533e3451ad6a8ba9736c109ac3.zip
drm/amdgpu: amdgpu_ttm_gart_bind set gtt bound flag
Otherwise after the GTT bo is released, the GTT and gart space is freed but amdgpu_ttm_backend_unbind will not clear the gart page table entry and leave valid mapping entry pointing to the stale system page. Then if GPU access the gart address mistakely, it will read undefined value instead page fault, harder to debug and reproduce the real issue. Cc: stable@vger.kernel.org Signed-off-by: Philip Yang <Philip.Yang@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 8722beba494e..fc418e670fda 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -864,6 +864,7 @@ static void amdgpu_ttm_gart_bind(struct amdgpu_device *adev,
amdgpu_gart_bind(adev, gtt->offset, ttm->num_pages,
gtt->ttm.dma_address, flags);
}
+ gtt->bound = true;
}
/*