On Wed, 3 Aug 2022 at 13:15, Akhil P Oommen <quic_akhilpo@xxxxxxxxxxx> wrote: > > On 8/2/2022 12:44 PM, Dmitry Baryshkov wrote: > > On 30/07/2022 12:40, Akhil P Oommen wrote: > >> Because there could be transient votes from other drivers/tz/hyp which > >> may keep the cx gdsc enabled, we should poll until cx gdsc collapses. > >> We can use the reset framework to poll for cx gdsc collapse from gpucc > >> clk driver. > >> > >> This feature requires support from the platform's gpucc driver. > >> > >> Signed-off-by: Akhil P Oommen <quic_akhilpo@xxxxxxxxxxx> > >> --- > >> > >> Changes in v3: > >> - Use reset interface from gpucc driver to poll for cx gdsc collapse > >> https://patchwork.freedesktop.org/series/106860/ > >> > >> drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 4 ++++ > >> drivers/gpu/drm/msm/msm_gpu.c | 4 ++++ > >> drivers/gpu/drm/msm/msm_gpu.h | 4 ++++ > >> 3 files changed, 12 insertions(+) > >> > >> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > >> b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > >> index 1b049c5..721d5e6 100644 > >> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > >> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c > >> @@ -10,6 +10,7 @@ > >> #include <linux/bitfield.h> > >> #include <linux/devfreq.h> > >> +#include <linux/reset.h> > >> #include <linux/soc/qcom/llcc-qcom.h> > >> #define GPU_PAS_ID 13 > >> @@ -1224,6 +1225,9 @@ static void a6xx_recover(struct msm_gpu *gpu) > >> /* And the final one from recover worker */ > >> pm_runtime_put_sync(&gpu->pdev->dev); > >> + /* Call into gpucc driver to poll for cx gdsc collapse */ > >> + reset_control_reset(gpu->cx_collapse); > > > > Do we have a race between the last pm_runtime_put_sync(), this polling > > and other voters removing their votes beforehand? > I can't see any issue with a race here. reset_control_reset() will > return immediately in that case. Ack, ok then. Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> -- With best wishes Dmitry