From: Miaoqian Lin <linmq006@gmail.com>
To: Emma Anholt <emma@anholt.net>, David Airlie <airlied@linux.ie>,
Daniel Vetter <daniel@ffwll.ch>, Eric Anholt <eric@anholt.net>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Cc: linmq006@gmail.com
Subject: [PATCH v4] drm/v3d/v3d_drv: Fix PM disable depth imbalance
Date: Thu, 2 Jun 2022 06:44:07 +0400 [thread overview]
Message-ID: <20220602024408.43070-1-linmq006@gmail.com> (raw)
The pm_runtime_enable will increase power disable depth.
We need to call pm_runtime_disable() to balance it when needed
use devm_pm_runtime_enable() and handle it automatically/
Fixes: 57692c94dcbe ("drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
Changes in v4:
- use devm_pm_runtime_enable()
Changes in v3:
- call pm_runtime_disable() in v3d_platform_drm_remove
- update commit message
Changes in v2
- put pm_runtime_disable before dma_free_wc
- rename dma_free to pm_disable
v1: https://lore.kernel.org/r/20220105120442.14418-1-linmq006@gmail.com
v2: https://lore.kernel.org/r/20220106124657.32737-1-linmq006@gmail.com
v3: https://lore.kernel.org/all/20220601122050.1822-1-linmq006@gmail.com
---
drivers/gpu/drm/v3d/v3d_drv.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c
index 1afcd54fbbd5..563ad4b9c2e8 100644
--- a/drivers/gpu/drm/v3d/v3d_drv.c
+++ b/drivers/gpu/drm/v3d/v3d_drv.c
@@ -282,7 +282,9 @@ static int v3d_platform_drm_probe(struct platform_device *pdev)
pm_runtime_use_autosuspend(dev);
pm_runtime_set_autosuspend_delay(dev, 50);
- pm_runtime_enable(dev);
+ ret = devm_pm_runtime_enable(dev);
+ if (ret)
+ goto dma_free;
ret = v3d_gem_init(drm);
if (ret)
--
2.25.1
reply other threads:[~2022-06-02 2:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220602024408.43070-1-linmq006@gmail.com \
--to=linmq006@gmail.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=emma@anholt.net \
--cc=eric@anholt.net \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®