Skip to content

Commit 7242795

Browse files
committed
drm/msm/gpu: Remove mutex from wait_event condition
The mutex wasn't really protecting anything before. Before the previous patch we could still be racing with the scheduler's kthread, as that is not necessarily frozen yet. Now that we've parked the sched threads, the only race is with jobs retiring, and that is harmless, ie. Signed-off-by: Rob Clark <robdclark@chromium.org> Link: https://lore.kernel.org/r/20220310234611.424743-4-robdclark@gmail.com
1 parent 7e4167c commit 7242795

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

drivers/gpu/drm/msm/adreno/adreno_device.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -607,15 +607,6 @@ static int adreno_runtime_resume(struct device *dev)
607607
return gpu->funcs->pm_resume(gpu);
608608
}
609609

610-
static int active_submits(struct msm_gpu *gpu)
611-
{
612-
int active_submits;
613-
mutex_lock(&gpu->active_lock);
614-
active_submits = gpu->active_submits;
615-
mutex_unlock(&gpu->active_lock);
616-
return active_submits;
617-
}
618-
619610
static int adreno_runtime_suspend(struct device *dev)
620611
{
621612
struct msm_gpu *gpu = dev_to_gpu(dev);
@@ -669,7 +660,7 @@ static int adreno_system_suspend(struct device *dev)
669660
suspend_scheduler(gpu);
670661

671662
remaining = wait_event_timeout(gpu->retire_event,
672-
active_submits(gpu) == 0,
663+
gpu->active_submits == 0,
673664
msecs_to_jiffies(1000));
674665
if (remaining == 0) {
675666
dev_err(dev, "Timeout waiting for GPU to suspend\n");

0 commit comments

Comments
 (0)