dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jordan Crouse <jcrouse@codeaurora.org>
To: freedreno@lists.freedesktop.org
Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: [PATCH 1/8] drm/msm/adreno: Call dev_pm_opp_put()
Date: Tue, 21 Nov 2017 12:40:51 -0700	[thread overview]
Message-ID: <1511293258-12415-2-git-send-email-jcrouse@codeaurora.org> (raw)
In-Reply-To: <1511293258-12415-1-git-send-email-jcrouse@codeaurora.org>

We need to call dev_pm_opp_put() to put back the reference
for the OPP struct after calling the various dev_pm_opp_get_*
functions.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
---
 drivers/gpu/drm/msm/adreno/a5xx_power.c    | 8 +++++++-
 drivers/gpu/drm/msm/adreno/adreno_device.c | 4 +++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/a5xx_power.c b/drivers/gpu/drm/msm/adreno/a5xx_power.c
index e5700bb..4e4d965 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_power.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_power.c
@@ -103,10 +103,16 @@ static inline uint32_t _get_mvolts(struct msm_gpu *gpu, uint32_t freq)
 	struct msm_drm_private *priv = dev->dev_private;
 	struct platform_device *pdev = priv->gpu_pdev;
 	struct dev_pm_opp *opp;
+	u32 ret = 0;
 
 	opp = dev_pm_opp_find_freq_exact(&pdev->dev, freq, true);
 
-	return (!IS_ERR(opp)) ? dev_pm_opp_get_voltage(opp) / 1000 : 0;
+	if (!IS_ERR(opp)) {
+		ret = dev_pm_opp_get_voltage(opp) / 1000;
+		dev_pm_opp_put(opp);
+	}
+
+	return ret;
 }
 
 /* Setup thermal limit management */
diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c
index 05022ea..e1eb7e1 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_device.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
@@ -239,8 +239,10 @@ static int adreno_get_pwrlevels(struct device *dev,
 
 	/* Find the fastest defined rate */
 	opp = dev_pm_opp_find_freq_floor(dev, &freq);
-	if (!IS_ERR(opp))
+	if (!IS_ERR(opp)) {
 		config->fast_rate = dev_pm_opp_get_freq(opp);
+		dev_pm_opp_put(opp);
+	}
 
 	if (!config->fast_rate) {
 		DRM_DEV_INFO(dev,
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-11-21 19:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21 19:40 [PATCH 0/8] msm/gpu: devfreq support Jordan Crouse
2017-11-21 19:40 ` Jordan Crouse [this message]
2017-11-21 19:40 ` [PATCH 2/8] drm/msm/adreno: Remove a useless call to dev_pm_opp_get_freq() Jordan Crouse
     [not found] ` <1511293258-12415-1-git-send-email-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-11-21 19:40   ` [PATCH 3/8] drm/msm/gpu: Remove unused bus scaling code Jordan Crouse
2017-11-21 19:40   ` [PATCH 5/8] drm/msm/adreno: Move clock parsing to adreno_gpu_init() Jordan Crouse
2017-11-21 19:40   ` [PATCH 7/8] drm/msm/adreno: a5xx: Explicitly program the CP0 performance counter Jordan Crouse
2017-11-21 19:40 ` [PATCH 4/8] drm/msm/adreno: Cleanup chipid parsing Jordan Crouse
2017-11-21 19:40 ` [PATCH 6/8] drm/msm/adreno: Read the speed bins for a5xx targets Jordan Crouse
2017-11-21 19:40 ` [PATCH 8/8] drm/msm/gpu: Add devfreq support for the GPU Jordan Crouse
2017-11-23 21:24   ` kbuild test robot
2017-11-24  3:14   ` kbuild test robot

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=1511293258-12415-2-git-send-email-jcrouse@codeaurora.org \
    --to=jcrouse@codeaurora.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox