From: Jiawen Liu <1298662399@qq.com>
To: Chen-Yu Tsai <wens@kernel.org>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>
Cc: dri-devel@lists.freedesktop.org,
linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] drm/sun4i: layer: stop frontend programming after resume failure
Date: Sun, 29 Nov 2026 17:05:07 +0400 [thread overview]
Message-ID: <tencent_116B9511F5BF45E29044BA914EFC8068BF08@qq.com> (raw)
In-Reply-To: <fe6c5928c90337afceaa.1.20261129142251759663@1298662399.qq.com>
sun4i_backend_layer_atomic_update() ignores a failed
sun4i_frontend_init() and still programs the frontend through MMIO. Now
that the runtime resume callback can report clock and reset failures,
stop the update before touching the frontend.
pm_runtime_get_sync() returns 1 when the device is already active, so
only a negative result is an error. On failure it retains the usage
reference, which the existing deferred-vblank path releases when the
plane is disabled.
Fixes: dd0421f47505 ("drm/sun4i: Add a driver for the display frontend")
Signed-off-by: Jiawen Liu <1298662399@qq.com>
---
drivers/gpu/drm/sun4i/sun4i_layer.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c
index cdfefbeee7b88..384e210d78503 100644
--- a/drivers/gpu/drm/sun4i/sun4i_layer.c
+++ b/drivers/gpu/drm/sun4i/sun4i_layer.c
@@ -84,11 +84,17 @@ static void sun4i_backend_layer_atomic_update(struct drm_plane *plane,
struct sun4i_layer *layer = plane_to_sun4i_layer(plane);
struct sun4i_backend *backend = layer->backend;
struct sun4i_frontend *frontend = backend->frontend;
+ int ret;
sun4i_backend_cleanup_layer(backend, layer->id);
if (layer_state->uses_frontend) {
- sun4i_frontend_init(frontend);
+ ret = sun4i_frontend_init(frontend);
+ if (ret < 0) {
+ dev_err(frontend->dev, "failed to resume frontend: %d\n",
+ ret);
+ return;
+ }
sun4i_frontend_update_coord(frontend, plane);
sun4i_frontend_update_buffer(frontend, plane);
sun4i_frontend_update_formats(frontend, plane,
--
2.34.1
parent reply other threads:[~2026-11-29 14:25 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <fe6c5928c90337afceaa.1.20261129142251759663@1298662399.qq.com>]
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=tencent_116B9511F5BF45E29044BA914EFC8068BF08@qq.com \
--to=1298662399@qq.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jernej.skrabec@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=samuel@sholland.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=wens@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®