summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/adreno/a6xx_gmu.h
diff options
context:
space:
mode:
authorSean Paul <seanpaul@chromium.org>2019-05-23 13:16:40 -0400
committerSean Paul <seanpaul@chromium.org>2019-05-24 09:52:40 -0400
commit606ec90fc2266284f584a96ebf7f874589f56251 (patch)
tree45f6119c801279c24d5f95a9b93e99ea21e5214a /drivers/gpu/drm/msm/adreno/a6xx_gmu.h
parenta188339ca5a396acc588e5851ed7e19f66b0ebd9 (diff)
drm/msm/a6xx: Avoid freeing gmu resources multiple times
The driver checks for gmu->mmio as a sign that the device has been initialized, however there are failures in probe below the mmio init. If one of those is hit, mmio will be non-null but freed. In that case, a6xx_gmu_probe will return an error to a6xx_gpu_init which will in turn call a6xx_gmu_remove which checks gmu->mmio and tries to free resources for a second time. This causes a great boom. Fix this by adding an initialized member to gmu which is set on successful probe and cleared on removal. Changes in v2: - None Cc: Jordan Crouse <jcrouse@codeaurora.org> Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/20190523171653.138678-1-sean@poorly.run
Diffstat (limited to 'drivers/gpu/drm/msm/adreno/a6xx_gmu.h')
-rw-r--r--drivers/gpu/drm/msm/adreno/a6xx_gmu.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.h b/drivers/gpu/drm/msm/adreno/a6xx_gmu.h
index bedd8e6a63aa..39a26dd63674 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.h
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.h
@@ -75,6 +75,7 @@ struct a6xx_gmu {
struct a6xx_hfi_queue queues[2];
+ bool initialized;
bool hung;
};