public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/bridge: adv7511: Clear HPD IRQ during atomic_enable()
@ 2026-04-22 12:14 Biju
  2026-04-22 13:34 ` Tommaso Merciai
  0 siblings, 1 reply; 2+ messages in thread
From: Biju @ 2026-04-22 12:14 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: Biju Das, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Dmitry Baryshkov, Tommaso Merciai, Manikandan Muralidharan,
	Cristian Ciocaltea, dri-devel, linux-kernel, Geert Uytterhoeven,
	Prabhakar Mahadev Lad, Biju Das, linux-renesas-soc

From: Biju Das <biju.das.jz@bp.renesas.com>

On RZ/G3E SMARC EVK, suspend-to-RAM via PSCI powers down the ADV7535
chip entirely, causing the HPD status bit to be in a stale state on
resume. When the display controller driver's system PM resume callback
invokes drm_mode_config_helper_resume(), it calls the bridge's
atomic_enable(), but the stale HPD IRQ is never cleared, leading to
incorrect behaviour.

Clear the HPD status bit in adv7511_bridge_atomic_enable() after
powering on, so that any HPD interrupt latched before or during
power-loss is dismissed before normal operation resumes.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
Tested HPD, s2idle and s2ram on RZ/G3L SMARC EVK connected to ADV7535
on both polling and IRQ mode.
v1->v2:
 * Dropped PM support instead clearing latched HPD status bit in
   adv7511_bridge_atomic_enable()
 * Dropped suspended variable from struct adv7511.
 * Updated comment in adv7511_bridge_atomic_enable().
 * Clearing the HPD status bit unconditionally as there is no harm.
 * Updated commit header and description.
 * Dropped the tags.
---
 drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
index 6bd76c1fb007..7663814b4032 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
@@ -792,6 +792,13 @@ static void adv7511_bridge_atomic_enable(struct drm_bridge *bridge,
 
 	adv7511_power_on(adv);
 
+	/*
+	 * Clear the HPD status bit (ADV7511_INT0_HPD), so that any HPD
+	 * interrupt latched before or during power loss is dismissed before
+	 * normal operation resumes.
+	 */
+	regmap_write(adv->regmap, ADV7511_REG_INT(0), ADV7511_INT0_HPD);
+
 	connector = drm_atomic_get_new_connector_for_encoder(state, bridge->encoder);
 	if (WARN_ON(!connector))
 		return;
-- 
2.43.0


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

* Re: [PATCH v2] drm/bridge: adv7511: Clear HPD IRQ during atomic_enable()
  2026-04-22 12:14 [PATCH v2] drm/bridge: adv7511: Clear HPD IRQ during atomic_enable() Biju
@ 2026-04-22 13:34 ` Tommaso Merciai
  0 siblings, 0 replies; 2+ messages in thread
From: Tommaso Merciai @ 2026-04-22 13:34 UTC (permalink / raw)
  To: Biju
  Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Biju Das, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Dmitry Baryshkov, Manikandan Muralidharan, Cristian Ciocaltea,
	dri-devel, linux-kernel, Geert Uytterhoeven,
	Prabhakar Mahadev Lad, linux-renesas-soc

Hi Biju,
Thank you for your patch.

On Wed, Apr 22, 2026 at 01:14:54PM +0100, Biju wrote:
> From: Biju Das <biju.das.jz@bp.renesas.com>
> 
> On RZ/G3E SMARC EVK, suspend-to-RAM via PSCI powers down the ADV7535
> chip entirely, causing the HPD status bit to be in a stale state on
> resume. When the display controller driver's system PM resume callback
> invokes drm_mode_config_helper_resume(), it calls the bridge's
> atomic_enable(), but the stale HPD IRQ is never cleared, leading to
> incorrect behaviour.
> 
> Clear the HPD status bit in adv7511_bridge_atomic_enable() after
> powering on, so that any HPD interrupt latched before or during
> power-loss is dismissed before normal operation resumes.
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

Patch LGTM.

Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Reviewed-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>

Kind Regards,
Tommaso


> ---
> Tested HPD, s2idle and s2ram on RZ/G3L SMARC EVK connected to ADV7535
> on both polling and IRQ mode.
> v1->v2:
>  * Dropped PM support instead clearing latched HPD status bit in
>    adv7511_bridge_atomic_enable()
>  * Dropped suspended variable from struct adv7511.
>  * Updated comment in adv7511_bridge_atomic_enable().
>  * Clearing the HPD status bit unconditionally as there is no harm.
>  * Updated commit header and description.
>  * Dropped the tags.
> ---
>  drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> index 6bd76c1fb007..7663814b4032 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> @@ -792,6 +792,13 @@ static void adv7511_bridge_atomic_enable(struct drm_bridge *bridge,
>  
>  	adv7511_power_on(adv);
>  
> +	/*
> +	 * Clear the HPD status bit (ADV7511_INT0_HPD), so that any HPD
> +	 * interrupt latched before or during power loss is dismissed before
> +	 * normal operation resumes.
> +	 */
> +	regmap_write(adv->regmap, ADV7511_REG_INT(0), ADV7511_INT0_HPD);
> +
>  	connector = drm_atomic_get_new_connector_for_encoder(state, bridge->encoder);
>  	if (WARN_ON(!connector))
>  		return;
> -- 
> 2.43.0
> 

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

end of thread, other threads:[~2026-04-22 13:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-22 12:14 [PATCH v2] drm/bridge: adv7511: Clear HPD IRQ during atomic_enable() Biju
2026-04-22 13:34 ` Tommaso Merciai

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