From: Lucas Stach <l.stach@pengutronix.de>
To: etnaviv@lists.freedesktop.org
Cc: patchwork-lst@pengutronix.de, kernel@pengutronix.de,
dri-devel@lists.freedesktop.org,
Russell King <linux+etnaviv@armlinux.org.uk>
Subject: [PATCH 5/8] drm/etnaviv: avoid runtime PM usage in etnaviv_gpu_bind
Date: Wed, 7 Jun 2023 15:02:20 +0200 [thread overview]
Message-ID: <20230607130223.3533464-5-l.stach@pengutronix.de> (raw)
In-Reply-To: <20230607130223.3533464-1-l.stach@pengutronix.de>
Nothing in this callpath actually touches the GPU, so there is no reason
to get it out of suspend state here. Only if runtime PM isn't enabled at
all we must make sure to enable the clocks, so the GPU init routine can
access the GPU later on.
This also removes the need to guard against the state where the driver
isn't fully initialized yet in the runtime PM resume handler.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 57cf77ed2fcf..fb07d0e73802 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -1735,13 +1735,11 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master,
if (ret)
goto out_workqueue;
- if (IS_ENABLED(CONFIG_PM))
- ret = pm_runtime_get_sync(gpu->dev);
- else
+ if (!IS_ENABLED(CONFIG_PM)) {
ret = etnaviv_gpu_clk_enable(gpu);
- if (ret < 0)
- goto out_sched;
-
+ if (ret < 0)
+ goto out_sched;
+ }
gpu->drm = drm;
gpu->fence_context = dma_fence_context_alloc(1);
@@ -1753,9 +1751,6 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master,
priv->gpu[priv->num_gpus++] = gpu;
- pm_runtime_mark_last_busy(gpu->dev);
- pm_runtime_put_autosuspend(gpu->dev);
-
return 0;
out_sched:
@@ -1936,7 +1931,7 @@ static int etnaviv_gpu_rpm_resume(struct device *dev)
return ret;
/* Re-initialise the basic hardware state */
- if (gpu->drm && gpu->initialized) {
+ if (gpu->initialized) {
ret = etnaviv_gpu_hw_resume(gpu);
if (ret) {
etnaviv_gpu_clk_disable(gpu);
--
2.39.2
next prev parent reply other threads:[~2023-06-07 13:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-07 13:02 [PATCH 1/8] drm/etnaviv: move down etnaviv_gpu_recover_hang() in file Lucas Stach
2023-06-07 13:02 ` [PATCH 2/8] drm/etnaviv: free events the usual way in recover worker Lucas Stach
2023-06-14 18:39 ` Christian Gmeiner
2023-06-07 13:02 ` [PATCH 3/8] drm/etnaviv: move runtime PM handling to events Lucas Stach
2023-06-14 18:41 ` Christian Gmeiner
2023-06-15 9:37 ` Lucas Stach
2023-06-19 13:09 ` Christian Gmeiner
2023-06-07 13:02 ` [PATCH 4/8] drm/etnaviv: make clock handling symetric between runtime resume and suspend Lucas Stach
2023-06-14 18:42 ` Christian Gmeiner
2023-06-07 13:02 ` Lucas Stach [this message]
2023-06-19 13:12 ` [PATCH 5/8] drm/etnaviv: avoid runtime PM usage in etnaviv_gpu_bind Christian Gmeiner
2023-06-07 13:02 ` [PATCH 6/8] drm/etnaviv: better track GPU state Lucas Stach
2023-06-21 7:33 ` Christian Gmeiner
2023-06-07 13:02 ` [PATCH 7/8] drm/etnaviv: drop GPU initialized property Lucas Stach
2023-06-21 7:34 ` Christian Gmeiner
2023-06-07 13:02 ` [PATCH 8/8] drm/etnaviv: expedited MMU fault handling Lucas Stach
2023-06-21 7:35 ` Christian Gmeiner
2023-06-14 18:38 ` [PATCH 1/8] drm/etnaviv: move down etnaviv_gpu_recover_hang() in file Christian Gmeiner
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=20230607130223.3533464-5-l.stach@pengutronix.de \
--to=l.stach@pengutronix.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=etnaviv@lists.freedesktop.org \
--cc=kernel@pengutronix.de \
--cc=linux+etnaviv@armlinux.org.uk \
--cc=patchwork-lst@pengutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).