[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3b066b63-c180-09c6-e39f-b408464b5bc1@quicinc.com>
Date: Fri, 18 Mar 2022 02:15:34 +0530
From: Akhil P Oommen <quic_akhilpo@...cinc.com>
To: Rob Clark <robdclark@...il.com>, <dri-devel@...ts.freedesktop.org>
CC: Rob Clark <robdclark@...omium.org>,
Jonathan Marek <jonathan@...ek.ca>,
David Airlie <airlied@...ux.ie>,
<linux-arm-msm@...r.kernel.org>,
"Vladimir Lypak" <vladimir.lypak@...il.com>,
Abhinav Kumar <quic_abhinavk@...cinc.com>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Sean Paul <sean@...rly.run>, Daniel Vetter <daniel@...ll.ch>,
<freedreno@...ts.freedesktop.org>,
open list <linux-kernel@...r.kernel.org>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>
Subject: Re: [Freedreno] [PATCH 3/3] drm/msm/gpu: Remove mutex from wait_event
condition
On 3/11/2022 5:16 AM, Rob Clark wrote:
> From: Rob Clark <robdclark@...omium.org>
>
> 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@...omium.org>
> ---
> drivers/gpu/drm/msm/adreno/adreno_device.c | 11 +----------
> 1 file changed, 1 insertion(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c
> index 0440a98988fc..661dfa7681fb 100644
> --- a/drivers/gpu/drm/msm/adreno/adreno_device.c
> +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
> @@ -607,15 +607,6 @@ static int adreno_runtime_resume(struct device *dev)
> return gpu->funcs->pm_resume(gpu);
> }
>
> -static int active_submits(struct msm_gpu *gpu)
> -{
> - int active_submits;
> - mutex_lock(&gpu->active_lock);
> - active_submits = gpu->active_submits;
> - mutex_unlock(&gpu->active_lock);
I assumed that this lock here was to ensure proper barriers while
reading active_submits. Is that not required?
-Akhil.
> - return active_submits;
> -}
> -
> static int adreno_runtime_suspend(struct device *dev)
> {
> struct msm_gpu *gpu = dev_to_gpu(dev);
> @@ -669,7 +660,7 @@ static int adreno_system_suspend(struct device *dev)
> suspend_scheduler(gpu);
>
> remaining = wait_event_timeout(gpu->retire_event,
> - active_submits(gpu) == 0,
> + gpu->active_submits == 0,
> msecs_to_jiffies(1000));
> if (remaining == 0) {
> dev_err(dev, "Timeout waiting for GPU to suspend\n");
Powered by blists - more mailing lists