summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorJordan Crouse <jcrouse@codeaurora.org>2017-02-13 10:14:12 -0700
committerJordan Crouse <jcrouse@codeaurora.org>2017-02-19 16:07:56 -0700
commit41f5926f415faab24d14b278cd98b6b4b3bca928 (patch)
treebe3ff54b47879b17d77e2c4027bfca41799332cf /drivers/gpu
parentffd2f3eb423812150b36e4c8cbd711f6d220c321 (diff)
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/msm/adreno/adreno_gpu.c9
-rw-r--r--drivers/gpu/drm/msm/msm_gpu.c3
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index 0fcaa44e44d4..74c80a98c420 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -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);
+ }
}
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index 91d2a95d1567..7b8f2d02b56d 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -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);
}