mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: phucduc.bui@gmail.com
Cc: Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>, 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>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] drm/bridge: adv7511: use cache_only during power down
Date: Fri, 24 Jul 2026 13:39:01 +0300	[thread overview]
Message-ID: <20260724103901.GA1051157@killaraus.ideasonboard.com> (raw)
In-Reply-To: <20260724103235.57577-1-phucduc.bui@gmail.com>

On Fri, Jul 24, 2026 at 05:32:35PM +0700, phucduc.bui@gmail.com wrote:
> 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.

Please give a detailed example of a scenario where that can happen, and
make sure you can reproduce the scenario and see the issue on your
hardware.

> 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;
>  	}
>  

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2026-07-24 10:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24 10:32 phucduc.bui
2026-07-24 10:39 ` Laurent Pinchart [this message]
2026-07-24 10:56   ` Bui Duc Phuc
2026-07-24 12:20     ` Bui Duc Phuc

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=20260724103901.GA1051157@killaraus.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --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=phucduc.bui@gmail.com \
    --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

all inboxes | Powered by JetHome®