All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/msm/devfreq: Restrict idle clamping to a618 for now
@ 2021-10-18 15:36 Rob Clark
  2021-10-18 16:42 ` John Stultz
  0 siblings, 1 reply; 4+ messages in thread
From: Rob Clark @ 2021-10-18 15:36 UTC (permalink / raw)
  To: dri-devel
  Cc: freedreno, linux-arm-msm, Caleb Connolly, John Stultz, Rob Clark,
	Rob Clark, Sean Paul, David Airlie, Daniel Vetter, Jordan Crouse,
	Akhil P Oommen, Jonathan Marek, Dmitry Baryshkov,
	Sai Prakash Ranjan, Sharat Masetty, Douglas Anderson, open list

From: Rob Clark <robdclark@chromium.org>

Until we better understand the stability issues caused by frequent
frequency changes, lets limit them to a618.

Signed-off-by: Rob Clark <robdclark@chromium.org>
---
Caleb/John, I think this should help as a workaround for the power
instability issues on a630.. could you give it a try?

 drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 7 +++++++
 drivers/gpu/drm/msm/msm_gpu.h         | 4 ++++
 drivers/gpu/drm/msm/msm_gpu_devfreq.c | 3 ++-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index 33da25b81615..267a880811d6 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -1838,6 +1838,13 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev)
 			adreno_cmp_rev(ADRENO_REV(6, 3, 5, ANY_ID), info->rev)))
 		adreno_gpu->base.hw_apriv = true;
 
+	/*
+	 * For now only clamp to idle freq for devices where this is known not
+	 * to cause power supply issues:
+	 */
+	if (info && (info->revn == 618))
+		gpu->clamp_to_idle = true;
+
 	a6xx_llc_slices_init(pdev, a6xx_gpu);
 
 	ret = a6xx_set_supported_hw(&pdev->dev, config->rev);
diff --git a/drivers/gpu/drm/msm/msm_gpu.h b/drivers/gpu/drm/msm/msm_gpu.h
index 59870095ea41..59cdd00b69d0 100644
--- a/drivers/gpu/drm/msm/msm_gpu.h
+++ b/drivers/gpu/drm/msm/msm_gpu.h
@@ -210,6 +210,10 @@ struct msm_gpu {
 	uint32_t suspend_count;
 
 	struct msm_gpu_state *crashstate;
+
+	/* Enable clamping to idle freq when inactive: */
+	bool clamp_to_idle;
+
 	/* True if the hardware supports expanded apriv (a650 and newer) */
 	bool hw_apriv;
 
diff --git a/drivers/gpu/drm/msm/msm_gpu_devfreq.c b/drivers/gpu/drm/msm/msm_gpu_devfreq.c
index d32b729b4616..8b7473f69cb8 100644
--- a/drivers/gpu/drm/msm/msm_gpu_devfreq.c
+++ b/drivers/gpu/drm/msm/msm_gpu_devfreq.c
@@ -214,7 +214,8 @@ static void msm_devfreq_idle_work(struct kthread_work *work)
 
 	idle_freq = get_freq(gpu);
 
-	msm_devfreq_target(&gpu->pdev->dev, &target_freq, 0);
+	if (gpu->clamp_to_idle)
+		msm_devfreq_target(&gpu->pdev->dev, &target_freq, 0);
 
 	df->idle_time = ktime_get();
 	df->idle_freq = idle_freq;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/msm/devfreq: Restrict idle clamping to a618 for now
  2021-10-18 15:36 [PATCH] drm/msm/devfreq: Restrict idle clamping to a618 for now Rob Clark
@ 2021-10-18 16:42 ` John Stultz
  2021-10-18 17:33   ` Caleb Connolly
  0 siblings, 1 reply; 4+ messages in thread
From: John Stultz @ 2021-10-18 16:42 UTC (permalink / raw)
  To: Rob Clark
  Cc: dri-devel, open list:DRM DRIVER FOR MSM ADRENO GPU,
	linux-arm-msm, Caleb Connolly, Rob Clark, Sean Paul,
	David Airlie, Daniel Vetter, Jordan Crouse, Akhil P Oommen,
	Jonathan Marek, Dmitry Baryshkov, Sai Prakash Ranjan,
	Sharat Masetty, Douglas Anderson, open list, Amit Pundir

On Mon, Oct 18, 2021 at 8:31 AM Rob Clark <robdclark@gmail.com> wrote:
>
> From: Rob Clark <robdclark@chromium.org>
>
> Until we better understand the stability issues caused by frequent
> frequency changes, lets limit them to a618.
>
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
> Caleb/John, I think this should help as a workaround for the power
> instability issues on a630.. could you give it a try?

While I hit it fairly often, I can't reliably reproduce the crash, but
in limited testing this seems ok to me.
I've not hit the crash so far, nor seen any other negative side
effects over 5.14.

So for what that's worth:
Tested-by: John Stultz <john.stultz@linaro.org>

Caleb has better luck tripping this issue right away, so they can
hopefully provide a more assured response.

thanks
-john

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/msm/devfreq: Restrict idle clamping to a618 for now
  2021-10-18 16:42 ` John Stultz
@ 2021-10-18 17:33   ` Caleb Connolly
  2021-10-18 21:39     ` Rob Clark
  0 siblings, 1 reply; 4+ messages in thread
From: Caleb Connolly @ 2021-10-18 17:33 UTC (permalink / raw)
  To: John Stultz, Rob Clark
  Cc: dri-devel, open list:DRM DRIVER FOR MSM ADRENO GPU,
	linux-arm-msm, Rob Clark, Sean Paul, David Airlie, Daniel Vetter,
	Jordan Crouse, Akhil P Oommen, Jonathan Marek, Dmitry Baryshkov,
	Sai Prakash Ranjan, Sharat Masetty, Douglas Anderson, open list,
	Amit Pundir

Hi all,

On 18/10/2021 17:42, John Stultz wrote:
> On Mon, Oct 18, 2021 at 8:31 AM Rob Clark <robdclark@gmail.com> wrote:
>>
>> From: Rob Clark <robdclark@chromium.org>
>>
>> Until we better understand the stability issues caused by frequent
>> frequency changes, lets limit them to a618.
>>
>> Signed-off-by: Rob Clark <robdclark@chromium.org>
>> ---
>> Caleb/John, I think this should help as a workaround for the power
>> instability issues on a630.. could you give it a try?
> 
> While I hit it fairly often, I can't reliably reproduce the crash, but
> in limited testing this seems ok to me.
> I've not hit the crash so far, nor seen any other negative side
> effects over 5.14.
> 
> So for what that's worth:
> Tested-by: John Stultz <john.stultz@linaro.org>
> 
> Caleb has better luck tripping this issue right away, so they can
> hopefully provide a more assured response.
This prevents the crash on the OnePlus 6 as the frequency can no longer go to zero.

I would like to find a better solution that still allows proper idling on a630, but that can wait for 5.16.

Tested-by: Caleb Connolly <caleb.connolly@linaro.org>
> 
> thanks
> -john
> 

-- 
Kind Regards,
Caleb (they/them)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/msm/devfreq: Restrict idle clamping to a618 for now
  2021-10-18 17:33   ` Caleb Connolly
@ 2021-10-18 21:39     ` Rob Clark
  0 siblings, 0 replies; 4+ messages in thread
From: Rob Clark @ 2021-10-18 21:39 UTC (permalink / raw)
  To: Caleb Connolly
  Cc: John Stultz, dri-devel, open list:DRM DRIVER FOR MSM ADRENO GPU,
	linux-arm-msm, Rob Clark, Sean Paul, David Airlie, Daniel Vetter,
	Jordan Crouse, Akhil P Oommen, Jonathan Marek, Dmitry Baryshkov,
	Sai Prakash Ranjan, Sharat Masetty, Douglas Anderson, open list,
	Amit Pundir

On Mon, Oct 18, 2021 at 10:33 AM Caleb Connolly
<caleb.connolly@linaro.org> wrote:
>
> Hi all,
>
> On 18/10/2021 17:42, John Stultz wrote:
> > On Mon, Oct 18, 2021 at 8:31 AM Rob Clark <robdclark@gmail.com> wrote:
> >>
> >> From: Rob Clark <robdclark@chromium.org>
> >>
> >> Until we better understand the stability issues caused by frequent
> >> frequency changes, lets limit them to a618.
> >>
> >> Signed-off-by: Rob Clark <robdclark@chromium.org>
> >> ---
> >> Caleb/John, I think this should help as a workaround for the power
> >> instability issues on a630.. could you give it a try?
> >
> > While I hit it fairly often, I can't reliably reproduce the crash, but
> > in limited testing this seems ok to me.
> > I've not hit the crash so far, nor seen any other negative side
> > effects over 5.14.
> >
> > So for what that's worth:
> > Tested-by: John Stultz <john.stultz@linaro.org>
> >
> > Caleb has better luck tripping this issue right away, so they can
> > hopefully provide a more assured response.
> This prevents the crash on the OnePlus 6 as the frequency can no longer go to zero.
>
> I would like to find a better solution that still allows proper idling on a630, but that can wait for 5.16.
>
> Tested-by: Caleb Connolly <caleb.connolly@linaro.org>

Thanks for testing, I've sent one last -fixes pull request with this patch

BR,
-R

> >
> > thanks
> > -john
> >
>
> --
> Kind Regards,
> Caleb (they/them)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-18 21:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18 15:36 [PATCH] drm/msm/devfreq: Restrict idle clamping to a618 for now Rob Clark
2021-10-18 16:42 ` John Stultz
2021-10-18 17:33   ` Caleb Connolly
2021-10-18 21:39     ` Rob Clark

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.