linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Clark <robdclark@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	Rob Clark <robdclark@chromium.org>,
	Caleb Connolly <caleb.connolly@linaro.org>,
	Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Jordan Crouse <jordan@cosmicpenguin.net>,
	Jonathan Marek <jonathan@marek.ca>,
	Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Sharat Masetty <smasetty@codeaurora.org>,
	Akhil P Oommen <akhilpo@codeaurora.org>,
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] drm/msm: Disable frequency clamping on a630
Date: Thu, 29 Jul 2021 11:39:40 -0700	[thread overview]
Message-ID: <20210729183942.2839925-1-robdclark@gmail.com> (raw)

From: Rob Clark <robdclark@chromium.org>

The more frequent frequency transitions resulting from clamping freq to
minimum when the GPU is idle seems to be causing some issue with the bus
getting voted off when it should be on.  (An enable racing with an async
disable?)  This might be a problem outside of the GPU, as I can't
reproduce this on a618 which uses the same GMU fw and same mechanism to
communicate with GMU to set opp.  For now, just revert to previous
devfreq behavior on a630 until the issue is understood.

Reported-by: Caleb Connolly <caleb.connolly@linaro.org>
Fixes: 9bc95570175a ("drm/msm: Devfreq tuning")
Signed-off-by: Rob Clark <robdclark@chromium.org>
---
 drivers/gpu/drm/msm/adreno/adreno_gpu.c |  3 +++
 drivers/gpu/drm/msm/msm_gpu.h           |  2 ++
 drivers/gpu/drm/msm/msm_gpu_devfreq.c   | 12 ++++++++++++
 3 files changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index 748665232d29..9fd08b413010 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -945,6 +945,9 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
 	pm_runtime_use_autosuspend(dev);
 	pm_runtime_enable(dev);
 
+	if (adreno_is_a630(adreno_gpu))
+		gpu->devfreq.disable_freq_clamping = true;
+
 	return msm_gpu_init(drm, pdev, &adreno_gpu->base, &funcs->base,
 			adreno_gpu->info->name, &adreno_gpu_config);
 }
diff --git a/drivers/gpu/drm/msm/msm_gpu.h b/drivers/gpu/drm/msm/msm_gpu.h
index 0e4b45bff2e6..7e11b667f939 100644
--- a/drivers/gpu/drm/msm/msm_gpu.h
+++ b/drivers/gpu/drm/msm/msm_gpu.h
@@ -112,6 +112,8 @@ struct msm_gpu_devfreq {
 	 * it is inactive.
 	 */
 	unsigned long idle_freq;
+
+	bool disable_freq_clamping;
 };
 
 struct msm_gpu {
diff --git a/drivers/gpu/drm/msm/msm_gpu_devfreq.c b/drivers/gpu/drm/msm/msm_gpu_devfreq.c
index 0a1ee20296a2..a832af436251 100644
--- a/drivers/gpu/drm/msm/msm_gpu_devfreq.c
+++ b/drivers/gpu/drm/msm/msm_gpu_devfreq.c
@@ -94,6 +94,12 @@ void msm_devfreq_init(struct msm_gpu *gpu)
 	if (!gpu->funcs->gpu_busy)
 		return;
 
+	/* Revert to previous polling interval if we aren't using freq clamping
+	 * to preserve previous behavior
+	 */
+	if (gpu->devfreq.disable_freq_clamping)
+		msm_devfreq_profile.polling_ms = 10;
+
 	msm_devfreq_profile.initial_freq = gpu->fast_rate;
 
 	/*
@@ -151,6 +157,9 @@ void msm_devfreq_active(struct msm_gpu *gpu)
 	unsigned int idle_time;
 	unsigned long target_freq = df->idle_freq;
 
+	if (gpu->devfreq.disable_freq_clamping)
+		return;
+
 	/*
 	 * Hold devfreq lock to synchronize with get_dev_status()/
 	 * target() callbacks
@@ -186,6 +195,9 @@ void msm_devfreq_idle(struct msm_gpu *gpu)
 	struct msm_gpu_devfreq *df = &gpu->devfreq;
 	unsigned long idle_freq, target_freq = 0;
 
+	if (gpu->devfreq.disable_freq_clamping)
+		return;
+
 	/*
 	 * Hold devfreq lock to synchronize with get_dev_status()/
 	 * target() callbacks
-- 
2.31.1


             reply	other threads:[~2021-07-29 18:35 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29 18:39 Rob Clark [this message]
2021-07-29 20:06 ` Caleb Connolly
2021-07-29 20:24   ` Rob Clark
2021-07-29 20:28     ` Caleb Connolly
2021-07-29 20:53       ` Rob Clark
2021-08-07 19:21         ` Caleb Connolly
2021-08-07 20:04           ` Rob Clark
2021-08-08 14:32             ` Caleb Connolly
2021-08-08 16:52               ` Rob Clark
2021-08-09 14:51                 ` Akhil P Oommen
2021-08-09 16:12                   ` Rob Clark
2021-08-09 16:18                     ` Caleb Connolly
2021-08-09 17:26                       ` Akhil P Oommen
2021-08-09 17:58                         ` Rob Clark
2021-08-09 20:35                           ` Caleb Connolly
2021-08-09 21:08                             ` Rob Clark
2021-09-07 15:43                               ` Bjorn Andersson
2021-09-08  2:21                         ` Bjorn Andersson
2021-09-08 13:49                           ` Caleb Connolly
2021-09-09 12:17                           ` Amit Pundir
2021-09-09 16:12                             ` Amit Pundir
2021-09-09 19:49                               ` Akhil P Oommen
2021-09-09 20:54                                 ` Rob Clark
2021-09-10 17:22                                   ` Rob Clark
2021-09-10 17:18                           ` Rob Clark
2021-09-10 17:34                             ` Caleb Connolly
2021-09-13  6:15                               ` Akhil P Oommen
2021-09-03 19:39         ` John Stultz
2021-09-03 20:29           ` Rob Clark
2021-09-06  8:01             ` Amit Pundir
2021-09-06 16:28               ` Rob Clark
2021-09-06 19:58                 ` Amit Pundir
2021-09-06 20:50                   ` Rob Clark
2021-09-06 21:27                     ` Rob Clark
2021-09-07  8:18                       ` Amit Pundir
2021-09-07  1:45                   ` Rob Clark
2021-09-07  8:25                     ` Amit Pundir
2021-09-07 14:25                       ` Rob Clark

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210729183942.2839925-1-robdclark@gmail.com \
    --to=robdclark@gmail.com \
    --cc=airlied@linux.ie \
    --cc=akhilpo@codeaurora.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=caleb.connolly@linaro.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jonathan@marek.ca \
    --cc=jordan@cosmicpenguin.net \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robdclark@chromium.org \
    --cc=saiprakash.ranjan@codeaurora.org \
    --cc=sean@poorly.run \
    --cc=smasetty@codeaurora.org \
    --subject='Re: [PATCH] drm/msm: Disable frequency clamping on a630' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox