diff options
author | Rob Clark <robdclark@gmail.com> | 2014-07-11 11:59:22 -0400 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2014-08-04 11:55:29 -0400 |
commit | a1ad35233345e7ddd9ea3ea7b841432f4723d743 (patch) | |
tree | 89fa09c7bfbf0367280bd998c0dfc4508b205776 /drivers/gpu/drm/msm/msm_gpu.c | |
parent | 944fc36c31ed685cf8d3d125eb681ae7198f06fc (diff) |
drm/msm: fix potential deadlock in gpu init
Somewhere along the way, the firmware loader sprouted another lock
dependency, resulting in possible deadlock scenario:
&dev->struct_mutex --> &sb->s_type->i_mutex_key#2 --> &mm->mmap_sem
which is problematic vs things like gem mmap.
So introduce a separate mutex to synchronize gpu init.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_gpu.c')
-rw-r--r-- | drivers/gpu/drm/msm/msm_gpu.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c index 915240b4b80a..4a0dce587745 100644 --- a/drivers/gpu/drm/msm/msm_gpu.c +++ b/drivers/gpu/drm/msm/msm_gpu.c | |||
@@ -612,8 +612,11 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev, | |||
612 | } | 612 | } |
613 | gpu->id = msm_register_mmu(drm, gpu->mmu); | 613 | gpu->id = msm_register_mmu(drm, gpu->mmu); |
614 | 614 | ||
615 | |||
615 | /* Create ringbuffer: */ | 616 | /* Create ringbuffer: */ |
617 | mutex_lock(&drm->struct_mutex); | ||
616 | gpu->rb = msm_ringbuffer_new(gpu, ringsz); | 618 | gpu->rb = msm_ringbuffer_new(gpu, ringsz); |
619 | mutex_unlock(&drm->struct_mutex); | ||
617 | if (IS_ERR(gpu->rb)) { | 620 | if (IS_ERR(gpu->rb)) { |
618 | ret = PTR_ERR(gpu->rb); | 621 | ret = PTR_ERR(gpu->rb); |
619 | gpu->rb = NULL; | 622 | gpu->rb = NULL; |