The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [RFC PATCH] drm/bridge: adv7511: use cache_only during power down
@ 2026-07-24 10:32 phucduc.bui
  2026-07-24 10:39 ` Laurent Pinchart
  0 siblings, 1 reply; 4+ messages in thread
From: phucduc.bui @ 2026-07-24 10:32 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong
  Cc: Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Luca Ceresoli, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, dri-devel,
	linux-kernel, bui duc phuc

From: bui duc phuc <phucduc.bui@gmail.com>

adv7511_power_on() and adv7511_power_off() restore the register state
using regcache_mark_dirty() and regcache_sync(), but nothing prevents
other code paths from accessing the registers over I2C while the chip
is powered down.
Wrap the power-down window with regcache_cache_only() to prevent direct
register accesses. It is unclear whether this is necessary or whether
it could affect the CEC or packet sub-regmaps, so send this as an RFC.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---

This RFC is related to the following patch series:
https://lore.kernel.org/all/20260724100803.50169-1-phucduc.bui@gmail.com/

 drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
index 3e470366bce0..49da1806797b 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
@@ -323,6 +323,7 @@ static void adv7511_power_off(struct adv7511 *adv7511)
 	__adv7511_power_off(adv7511);
 	if (adv7511->info->has_dsi)
 		adv7533_dsi_power_off(adv7511);
+	regcache_cache_only(adv7511->regmap, true);
 	adv7511->powered = false;
 }
 
@@ -374,11 +375,13 @@ static void adv7511_power_on(struct adv7511 *adv7511)
 	/*
 	 * Most of the registers are reset during power down or when HPD is low.
 	 */
+	regcache_cache_only(adv7511->regmap, false);
 	ret = regcache_sync(adv7511->regmap);
 	if (ret) {
 		dev_err(&adv7511->i2c_main->dev,
 			"Failed to sync register cache: %d\n", ret);
 		__adv7511_power_off(adv7511);
+		regcache_cache_only(adv7511->regmap, true);
 		return;
 	}
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-07-24 12:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-24 10:32 [RFC PATCH] drm/bridge: adv7511: use cache_only during power down phucduc.bui
2026-07-24 10:39 ` Laurent Pinchart
2026-07-24 10:56   ` Bui Duc Phuc
2026-07-24 12:20     ` Bui Duc Phuc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox