From: Myeonghun Pak <mhun512@gmail.com>
To: Sumit Semwal <sumit.semwal@linaro.org>,
Casey Connolly <casey.connolly@linaro.org>
Cc: Myeonghun Pak <mhun512@gmail.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Jessica Zhang <jesszhan0024@gmail.com>,
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>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Ijae Kim <ae878000@gmail.com>, Taegyu Kim <tmk5904@psu.edu>,
Yuho Choi <dbgh9129@gmail.com>
Subject: [PATCH v1] drm/panel: lg-sw43408: remove panel on DSI attach failure
Date: Mon, 20 Apr 2026 16:38:27 +0900 [thread overview]
Message-ID: <20260420073945.65849-1-mhun512@gmail.com> (raw)
In-Reply-To: <Casey Connolly <casey.connolly@linaro.org>
The probe path registers the panel by calling drm_panel_add() in
sw43408_add(), then returns the result of mipi_dsi_attach() directly
from sw43408_probe().
If mipi_dsi_attach() fails, the probe path exits without calling
drm_panel_remove(), leaving the panel registered in the global DRM
panel list. The .remove() callback does not cover this case because
it is only invoked after a successful probe.
Fix this by unwinding the panel registration with drm_panel_remove()
when mipi_dsi_attach() fails.
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Co-developed-by: Taegyu Kim <tmk5904@psu.edu>
Signed-off-by: Taegyu Kim <tmk5904@psu.edu>
Co-developed-by: Yuho Choi <dbgh9129@gmail.com>
Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
---
drivers/gpu/drm/panel/panel-lg-sw43408.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/panel/panel-lg-sw43408.c b/drivers/gpu/drm/panel/panel-lg-sw43408.c
index 293826c50..0eb78bc90 100644
--- a/drivers/gpu/drm/panel/panel-lg-sw43408.c
+++ b/drivers/gpu/drm/panel/panel-lg-sw43408.c
@@ -294,7 +294,13 @@ static int sw43408_probe(struct mipi_dsi_device *dsi)
dsi->dsc = &ctx->dsc;
- return mipi_dsi_attach(dsi);
+ ret = mipi_dsi_attach(dsi);
+ if (ret < 0) {
+ drm_panel_remove(&ctx->base);
+ return ret;
+ }
+
+ return 0;
}
static void sw43408_remove(struct mipi_dsi_device *dsi)
--
next parent reply other threads:[~2026-04-21 7:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Casey Connolly <casey.connolly@linaro.org>
2026-04-20 7:38 ` Myeonghun Pak [this message]
2026-04-22 19:24 ` [PATCH v1] drm/panel: lg-sw43408: remove panel on DSI attach failure Dmitry Baryshkov
2026-04-23 11:25 ` Myeonghun Pak
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=20260420073945.65849-1-mhun512@gmail.com \
--to=mhun512@gmail.com \
--cc=ae878000@gmail.com \
--cc=airlied@gmail.com \
--cc=casey.connolly@linaro.org \
--cc=dbgh9129@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jesszhan0024@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=simona@ffwll.ch \
--cc=sumit.semwal@linaro.org \
--cc=tmk5904@psu.edu \
--cc=tzimmermann@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.