dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Myeonghun Pak <mhun512@gmail.com>
To: Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Luca Ceresoli <luca.ceresoli@bootlin.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>,
	Vasily Khoruzhick <anarsoul@gmail.com>,
	Torsten Duwe <duwe@suse.de>, Icenowy Zheng <icenowy@aosc.io>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Ijae Kim <ae878000@gmail.com>
Subject: [PATCH] drm/bridge: anx6345: Power off the bridge on removal
Date: Sun, 13 Sep 2026 18:22:00 -0400	[thread overview]
Message-ID: <20260913222200.86645-1-mhun512@gmail.com> (raw)

The probe callback powers on the bridge to read its chip ID and leaves it
powered on when the ID check succeeds. This enables both regulators and
prepares the optional panel. If the device is removed before the bridge
disable callback runs, these resources remain active after removal.

Power off the bridge in the remove callback before unregistering its I2C
dummy clients. Check the powered flag first to avoid disabling regulators
again when the bridge disable callback has already powered it off.

This issue was identified during our ongoing static-analysis research
while reviewing kernel code.

Fixes: 6aa192698089 ("drm/bridge: Add Analogix anx6345 support")
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Assisted-by: OpenAI:GPT-5.6
---
Validated with an ARM64 W=1 object build and strict checkpatch.
No hardware runtime or active-display unbind testing was performed.

 drivers/gpu/drm/bridge/analogix/analogix-anx6345.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c
index 407834a03b638991a5a7a4c64dbe3263bfd0d8a9..43c02f312a46593bfe4a0c46f06940006ee566b6 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c
@@ -775,6 +775,9 @@ static void anx6345_i2c_remove(struct i2c_client *client)
 
 	drm_bridge_remove(&anx6345->bridge);
 
+	if (anx6345->powered)
+		anx6345_poweroff(anx6345);
+
 	unregister_i2c_dummy_clients(anx6345);
 
 	drm_edid_free(anx6345->drm_edid);

                 reply	other threads:[~2026-09-13 22:22 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=20260913222200.86645-1-mhun512@gmail.com \
    --to=mhun512@gmail.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=ae878000@gmail.com \
    --cc=airlied@gmail.com \
    --cc=anarsoul@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=duwe@suse.de \
    --cc=icenowy@aosc.io \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=simona@ffwll.ch \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox