drm/msm: Detach the MMU during msm_gpu_cleanup()

Make sure to detach the MMU device before destroying the address
space.

Change-Id: Ic0dedbadff27fed017840a61ec5e0d55ce0c71e6
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
This commit is contained in:
Jordan Crouse 2017-02-13 10:14:12 -07:00
parent ffd2f3eb42
commit 41f5926f41
2 changed files with 9 additions and 3 deletions

View file

@ -427,6 +427,8 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
void adreno_gpu_cleanup(struct adreno_gpu *gpu)
{
struct msm_gem_address_space *aspace = gpu->base.aspace;
if (gpu->memptrs_bo) {
if (gpu->memptrs_iova)
msm_gem_put_iova(gpu->memptrs_bo, gpu->base.id);
@ -434,5 +436,12 @@ void adreno_gpu_cleanup(struct adreno_gpu *gpu)
}
release_firmware(gpu->pm4);
release_firmware(gpu->pfp);
msm_gpu_cleanup(&gpu->base);
if (aspace) {
aspace->mmu->funcs->detach(aspace->mmu,
iommu_ports, ARRAY_SIZE(iommu_ports));
msm_gem_address_space_destroy(aspace);
}
}

View file

@ -702,7 +702,4 @@ void msm_gpu_cleanup(struct msm_gpu *gpu)
msm_gem_put_iova(gpu->rb->bo, gpu->id);
msm_ringbuffer_destroy(gpu->rb);
}
if (gpu->aspace)
msm_gem_address_space_destroy(gpu->aspace);
}