[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF6AEGvjD3LRm40mPr4n+jzx71WmwYpVWizUDLct9cgafjFRyw@mail.gmail.com>
Date: Tue, 12 Jul 2022 09:44:35 -0700
From: Rob Clark <robdclark@...il.com>
To: Akhil P Oommen <quic_akhilpo@...cinc.com>
Cc: Doug Anderson <dianders@...omium.org>, Sean Paul <sean@...rly.run>,
Jonathan Marek <jonathan@...ek.ca>,
David Airlie <airlied@...ux.ie>,
linux-arm-msm <linux-arm-msm@...r.kernel.org>,
Konrad Dybcio <konrad.dybcio@...ainline.org>,
Abhinav Kumar <quic_abhinavk@...cinc.com>,
dri-devel <dri-devel@...ts.freedesktop.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Matthias Kaehlcke <mka@...omium.org>,
Daniel Vetter <daniel@...ll.ch>,
Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
Jordan Crouse <jordan@...micpenguin.net>,
freedreno <freedreno@...ts.freedesktop.org>,
Chia-I Wu <olvaffe@...il.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [Freedreno] [PATCH v2 3/7] drm/msm: Fix cx collapse issue during recovery
On Mon, Jul 11, 2022 at 10:05 PM Akhil P Oommen
<quic_akhilpo@...cinc.com> wrote:
>
> On 7/12/2022 4:52 AM, Doug Anderson wrote:
> > Hi,
> >
> > On Fri, Jul 8, 2022 at 11:00 PM Akhil P Oommen <quic_akhilpo@...cinc.com> wrote:
> >> There are some hardware logic under CX domain. For a successful
> >> recovery, we should ensure cx headswitch collapses to ensure all the
> >> stale states are cleard out. This is especially true to for a6xx family
> >> where we can GMU co-processor.
> >>
> >> Currently, cx doesn't collapse due to a devlink between gpu and its
> >> smmu. So the *struct gpu device* needs to be runtime suspended to ensure
> >> that the iommu driver removes its vote on cx gdsc.
> >>
> >> Signed-off-by: Akhil P Oommen <quic_akhilpo@...cinc.com>
> >> ---
> >>
> >> (no changes since v1)
> >>
> >> drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 16 ++++++++++++++--
> >> drivers/gpu/drm/msm/msm_gpu.c | 2 --
> >> 2 files changed, 14 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> >> index 4d50110..7ed347c 100644
> >> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> >> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> >> @@ -1278,8 +1278,20 @@ static void a6xx_recover(struct msm_gpu *gpu)
> >> */
> >> gmu_write(&a6xx_gpu->gmu, REG_A6XX_GMU_GMU_PWR_COL_KEEPALIVE, 0);
> >>
> >> - gpu->funcs->pm_suspend(gpu);
> >> - gpu->funcs->pm_resume(gpu);
> >> + /*
> >> + * Now drop all the pm_runtime usage count to allow cx gdsc to collapse.
> >> + * First drop the usage count from all active submits
> >> + */
> >> + for (i = gpu->active_submits; i > 0; i--)
> >> + pm_runtime_put(&gpu->pdev->dev);
> >> +
> >> + /* And the final one from recover worker */
> >> + pm_runtime_put_sync(&gpu->pdev->dev);
> >> +
> >> + for (i = gpu->active_submits; i > 0; i--)
> >> + pm_runtime_get(&gpu->pdev->dev);
> >> +
> >> + pm_runtime_get_sync(&gpu->pdev->dev);
> > In response to v1, Rob suggested pm_runtime_force_suspend/resume().
> > Those seem like they would work to me, too. Why not use them?
> Quoting my previous response which I seem to have sent only to Freedreno
> list:
>
> "I believe it is supposed to be used only during system sleep state
> transitions. Btw, we don't want pm_runtime_get() calls from elsewhere to
> fail by disabling RPM here."
The comment about not wanting other runpm calls to fail is valid.. but
that is also solveable, ie. by holding a lock around runpm calls.
Which I think we need to do anyways, otherwise looping over
gpu->active_submits is racey..
I think pm_runtime_force_suspend/resume() is the least-bad option.. or
at least I'm not seeing any obvious alternative that is better
BR,
-R
Powered by blists - more mailing lists