public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: adv7511: Clear HPD IRQ before powering on device during resume()
@ 2025-12-19 10:46 Biju
  2026-01-12  8:15 ` Tommaso Merciai
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Biju @ 2025-12-19 10:46 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, Andy Yan, Douglas Anderson,
	Luca Ceresoli, Jesse Van Gavere, 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 using PSCI, s2ram powers down the SoC. Testing ADV7535
IRQ configured as edge-triggered interrupt on RZ/G3E SMARC EVK shows that
it is missing HPD IRQ during system resume, as the status change occurs
before the IRQ/pincontrol resume. Once the status bit is set, there won't
be any further IRQ unless the status bit is cleared.

Clear any pending HPD IRQs before powering on the ADV7535 device to
deliver HPD interrupts after resume().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/gpu/drm/bridge/adv7511/adv7511.h     |  1 +
 drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 32 ++++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511.h b/drivers/gpu/drm/bridge/adv7511/adv7511.h
index 8be7266fd4f4..03aa23836ca4 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511.h
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511.h
@@ -393,6 +393,7 @@ struct adv7511 {
 	bool cec_enabled_adap;
 	struct clk *cec_clk;
 	u32 cec_clk_freq;
+	bool suspended;
 };
 
 static inline struct adv7511 *bridge_to_adv7511(struct drm_bridge *bridge)
diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
index b9be86541307..8d9467187d7c 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
@@ -790,6 +790,25 @@ static void adv7511_bridge_atomic_enable(struct drm_bridge *bridge,
 	struct drm_connector_state *conn_state;
 	struct drm_crtc_state *crtc_state;
 
+	if (adv->i2c_main->irq && adv->suspended) {
+		unsigned int irq;
+
+		/*
+		 * If ADV7511 IRQ is configured as edge triggered interrupt, it
+		 * will miss the IRQ during system resume as the status change
+		 * occurs before IRQ/pincontrol resume. Once the status bit is
+		 * set there won't be any further IRQ unless the status bit is
+		 * cleared. So, clear the IRQ status bit for further delivery
+		 * of HPD IRQ.
+		 */
+		regmap_read(adv->regmap, ADV7511_REG_INT(0), &irq);
+		if (irq & ADV7511_INT0_HPD)
+			regmap_write(adv->regmap, ADV7511_REG_INT(0),
+				     ADV7511_INT0_HPD);
+
+		adv->suspended = false;
+	}
+
 	adv7511_power_on(adv);
 
 	connector = drm_atomic_get_new_connector_for_encoder(state, bridge->encoder);
@@ -1407,6 +1426,16 @@ static void adv7511_remove(struct i2c_client *i2c)
 	i2c_unregister_device(adv7511->i2c_edid);
 }
 
+static int adv7511_suspend(struct device *dev)
+{
+	struct i2c_client *i2c = to_i2c_client(dev);
+	struct adv7511 *adv7511 = i2c_get_clientdata(i2c);
+
+	adv7511->suspended = true;
+
+	return 0;
+}
+
 static const struct adv7511_chip_info adv7511_chip_info = {
 	.type = ADV7511,
 	.name = "ADV7511",
@@ -1439,6 +1468,8 @@ static const struct adv7511_chip_info adv7535_chip_info = {
 	.hpd_override_enable = true,
 };
 
+static DEFINE_SIMPLE_DEV_PM_OPS(adv7511_pm_ops, adv7511_suspend, NULL);
+
 static const struct i2c_device_id adv7511_i2c_ids[] = {
 	{ "adv7511", (kernel_ulong_t)&adv7511_chip_info },
 	{ "adv7511w", (kernel_ulong_t)&adv7511_chip_info },
@@ -1467,6 +1498,7 @@ static struct i2c_driver adv7511_driver = {
 	.driver = {
 		.name = "adv7511",
 		.of_match_table = adv7511_of_ids,
+		.pm = pm_sleep_ptr(&adv7511_pm_ops),
 	},
 	.id_table = adv7511_i2c_ids,
 	.probe = adv7511_probe,
-- 
2.43.0


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

* Re: [PATCH] drm/bridge: adv7511: Clear HPD IRQ before powering on device during resume()
  2025-12-19 10:46 [PATCH] drm/bridge: adv7511: Clear HPD IRQ before powering on device during resume() Biju
@ 2026-01-12  8:15 ` Tommaso Merciai
  2026-03-16 10:40 ` Biju Das
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Tommaso Merciai @ 2026-01-12  8:15 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, Andy Yan, Douglas Anderson, Luca Ceresoli,
	Jesse Van Gavere, dri-devel, linux-kernel, Geert Uytterhoeven,
	Prabhakar Mahadev Lad, linux-renesas-soc

Hi Biju,
Thanks for your patch!

On Fri, Dec 19, 2025 at 10:46:53AM +0000, Biju wrote:
> From: Biju Das <biju.das.jz@bp.renesas.com>
> 
> On RZ/G3E SMARC EVK using PSCI, s2ram powers down the SoC. Testing ADV7535
> IRQ configured as edge-triggered interrupt on RZ/G3E SMARC EVK shows that
> it is missing HPD IRQ during system resume, as the status change occurs
> before the IRQ/pincontrol resume. Once the status bit is set, there won't
> be any further IRQ unless the status bit is cleared.
> 
> Clear any pending HPD IRQs before powering on the ADV7535 device to
> deliver HPD interrupts after resume().
> 

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

> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
>  drivers/gpu/drm/bridge/adv7511/adv7511.h     |  1 +
>  drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 32 ++++++++++++++++++++
>  2 files changed, 33 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511.h b/drivers/gpu/drm/bridge/adv7511/adv7511.h
> index 8be7266fd4f4..03aa23836ca4 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511.h
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511.h
> @@ -393,6 +393,7 @@ struct adv7511 {
>  	bool cec_enabled_adap;
>  	struct clk *cec_clk;
>  	u32 cec_clk_freq;
> +	bool suspended;
>  };
>  
>  static inline struct adv7511 *bridge_to_adv7511(struct drm_bridge *bridge)
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> index b9be86541307..8d9467187d7c 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> @@ -790,6 +790,25 @@ static void adv7511_bridge_atomic_enable(struct drm_bridge *bridge,
>  	struct drm_connector_state *conn_state;
>  	struct drm_crtc_state *crtc_state;
>  
> +	if (adv->i2c_main->irq && adv->suspended) {
> +		unsigned int irq;
> +
> +		/*
> +		 * If ADV7511 IRQ is configured as edge triggered interrupt, it
> +		 * will miss the IRQ during system resume as the status change
> +		 * occurs before IRQ/pincontrol resume. Once the status bit is
> +		 * set there won't be any further IRQ unless the status bit is
> +		 * cleared. So, clear the IRQ status bit for further delivery
> +		 * of HPD IRQ.
> +		 */
> +		regmap_read(adv->regmap, ADV7511_REG_INT(0), &irq);
> +		if (irq & ADV7511_INT0_HPD)
> +			regmap_write(adv->regmap, ADV7511_REG_INT(0),
> +				     ADV7511_INT0_HPD);
> +
> +		adv->suspended = false;
> +	}
> +
>  	adv7511_power_on(adv);
>  
>  	connector = drm_atomic_get_new_connector_for_encoder(state, bridge->encoder);
> @@ -1407,6 +1426,16 @@ static void adv7511_remove(struct i2c_client *i2c)
>  	i2c_unregister_device(adv7511->i2c_edid);
>  }
>  
> +static int adv7511_suspend(struct device *dev)
> +{
> +	struct i2c_client *i2c = to_i2c_client(dev);
> +	struct adv7511 *adv7511 = i2c_get_clientdata(i2c);
> +
> +	adv7511->suspended = true;
> +
> +	return 0;
> +}
> +
>  static const struct adv7511_chip_info adv7511_chip_info = {
>  	.type = ADV7511,
>  	.name = "ADV7511",
> @@ -1439,6 +1468,8 @@ static const struct adv7511_chip_info adv7535_chip_info = {
>  	.hpd_override_enable = true,
>  };
>  
> +static DEFINE_SIMPLE_DEV_PM_OPS(adv7511_pm_ops, adv7511_suspend, NULL);
> +
>  static const struct i2c_device_id adv7511_i2c_ids[] = {
>  	{ "adv7511", (kernel_ulong_t)&adv7511_chip_info },
>  	{ "adv7511w", (kernel_ulong_t)&adv7511_chip_info },
> @@ -1467,6 +1498,7 @@ static struct i2c_driver adv7511_driver = {
>  	.driver = {
>  		.name = "adv7511",
>  		.of_match_table = adv7511_of_ids,
> +		.pm = pm_sleep_ptr(&adv7511_pm_ops),
>  	},
>  	.id_table = adv7511_i2c_ids,
>  	.probe = adv7511_probe,
> -- 
> 2.43.0
>

Kind Regards,
Tommaso

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

* RE: [PATCH] drm/bridge: adv7511: Clear HPD IRQ before powering on device during resume()
  2025-12-19 10:46 [PATCH] drm/bridge: adv7511: Clear HPD IRQ before powering on device during resume() Biju
  2026-01-12  8:15 ` Tommaso Merciai
@ 2026-03-16 10:40 ` Biju Das
  2026-03-16 11:22 ` Luca Ceresoli
  2026-03-16 14:02 ` Laurent Pinchart
  3 siblings, 0 replies; 8+ messages in thread
From: Biju Das @ 2026-03-16 10:40 UTC (permalink / raw)
  To: biju.das.au, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter
  Cc: laurent.pinchart, Jonas Karlman, Jernej Skrabec, Dmitry Baryshkov,
	Tommaso Merciai, Andy Yan, Douglas Anderson, Luca Ceresoli,
	Jesse Van Gavere, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, Geert Uytterhoeven,
	Prabhakar Mahadev Lad, biju.das.au,
	linux-renesas-soc@vger.kernel.org

Hi All,

> -----Original Message-----
> From: Biju <biju.das.au@gmail.com>
> Sent: 19 December 2025 10:47
> Subject: [PATCH] drm/bridge: adv7511: Clear HPD IRQ before powering on device during resume()
> 
> From: Biju Das <biju.das.jz@bp.renesas.com>
> 
> On RZ/G3E SMARC EVK using PSCI, s2ram powers down the SoC. Testing ADV7535 IRQ configured as edge-
> triggered interrupt on RZ/G3E SMARC EVK shows that it is missing HPD IRQ during system resume, as the
> status change occurs before the IRQ/pincontrol resume. Once the status bit is set, there won't be any
> further IRQ unless the status bit is cleared.
> 
> Clear any pending HPD IRQs before powering on the ADV7535 device to deliver HPD interrupts after
> resume().
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
>  drivers/gpu/drm/bridge/adv7511/adv7511.h     |  1 +
>  drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 32 ++++++++++++++++++++
>  2 files changed, 33 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511.h b/drivers/gpu/drm/bridge/adv7511/adv7511.h
> index 8be7266fd4f4..03aa23836ca4 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511.h
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511.h
> @@ -393,6 +393,7 @@ struct adv7511 {
>  	bool cec_enabled_adap;
>  	struct clk *cec_clk;
>  	u32 cec_clk_freq;
> +	bool suspended;
>  };
> 
>  static inline struct adv7511 *bridge_to_adv7511(struct drm_bridge *bridge) diff --git
> a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> index b9be86541307..8d9467187d7c 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> @@ -790,6 +790,25 @@ static void adv7511_bridge_atomic_enable(struct drm_bridge *bridge,
>  	struct drm_connector_state *conn_state;
>  	struct drm_crtc_state *crtc_state;
> 
> +	if (adv->i2c_main->irq && adv->suspended) {
> +		unsigned int irq;
> +
> +		/*
> +		 * If ADV7511 IRQ is configured as edge triggered interrupt, it
> +		 * will miss the IRQ during system resume as the status change
> +		 * occurs before IRQ/pincontrol resume. Once the status bit is
> +		 * set there won't be any further IRQ unless the status bit is
> +		 * cleared. So, clear the IRQ status bit for further delivery
> +		 * of HPD IRQ.
> +		 */
> +		regmap_read(adv->regmap, ADV7511_REG_INT(0), &irq);
> +		if (irq & ADV7511_INT0_HPD)
> +			regmap_write(adv->regmap, ADV7511_REG_INT(0),
> +				     ADV7511_INT0_HPD);
> +
> +		adv->suspended = false;
> +	}
> +
>  	adv7511_power_on(adv);
> 
>  	connector = drm_atomic_get_new_connector_for_encoder(state, bridge->encoder); @@ -1407,6
> +1426,16 @@ static void adv7511_remove(struct i2c_client *i2c)
>  	i2c_unregister_device(adv7511->i2c_edid);
>  }
> 
> +static int adv7511_suspend(struct device *dev) {
> +	struct i2c_client *i2c = to_i2c_client(dev);
> +	struct adv7511 *adv7511 = i2c_get_clientdata(i2c);
> +
> +	adv7511->suspended = true;
> +
> +	return 0;
> +}
> +
>  static const struct adv7511_chip_info adv7511_chip_info = {
>  	.type = ADV7511,
>  	.name = "ADV7511",
> @@ -1439,6 +1468,8 @@ static const struct adv7511_chip_info adv7535_chip_info = {
>  	.hpd_override_enable = true,
>  };
> 
> +static DEFINE_SIMPLE_DEV_PM_OPS(adv7511_pm_ops, adv7511_suspend, NULL);
> +
>  static const struct i2c_device_id adv7511_i2c_ids[] = {
>  	{ "adv7511", (kernel_ulong_t)&adv7511_chip_info },
>  	{ "adv7511w", (kernel_ulong_t)&adv7511_chip_info }, @@ -1467,6 +1498,7 @@ static struct
> i2c_driver adv7511_driver = {
>  	.driver = {
>  		.name = "adv7511",
>  		.of_match_table = adv7511_of_ids,
> +		.pm = pm_sleep_ptr(&adv7511_pm_ops),
>  	},
>  	.id_table = adv7511_i2c_ids,
>  	.probe = adv7511_probe,
> --
> 2.43.0

Gentle ping.

Cheers,
Biju


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

* Re: [PATCH] drm/bridge: adv7511: Clear HPD IRQ before powering on device during resume()
  2025-12-19 10:46 [PATCH] drm/bridge: adv7511: Clear HPD IRQ before powering on device during resume() Biju
  2026-01-12  8:15 ` Tommaso Merciai
  2026-03-16 10:40 ` Biju Das
@ 2026-03-16 11:22 ` Luca Ceresoli
  2026-03-16 14:02 ` Laurent Pinchart
  3 siblings, 0 replies; 8+ messages in thread
From: Luca Ceresoli @ 2026-03-16 11:22 UTC (permalink / raw)
  To: Biju, 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, Andy Yan, Douglas Anderson,
	Jesse Van Gavere, dri-devel, linux-kernel, Geert Uytterhoeven,
	Prabhakar Mahadev Lad, linux-renesas-soc

On Fri Dec 19, 2025 at 11:46 AM CET, Biju wrote:
> From: Biju Das <biju.das.jz@bp.renesas.com>
>
> On RZ/G3E SMARC EVK using PSCI, s2ram powers down the SoC. Testing ADV7535
> IRQ configured as edge-triggered interrupt on RZ/G3E SMARC EVK shows that
> it is missing HPD IRQ during system resume, as the status change occurs
> before the IRQ/pincontrol resume. Once the status bit is set, there won't
> be any further IRQ unless the status bit is cleared.
>
> Clear any pending HPD IRQs before powering on the ADV7535 device to
> deliver HPD interrupts after resume().
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH] drm/bridge: adv7511: Clear HPD IRQ before powering on device during resume()
  2025-12-19 10:46 [PATCH] drm/bridge: adv7511: Clear HPD IRQ before powering on device during resume() Biju
                   ` (2 preceding siblings ...)
  2026-03-16 11:22 ` Luca Ceresoli
@ 2026-03-16 14:02 ` Laurent Pinchart
  2026-03-16 17:59   ` Biju Das
  3 siblings, 1 reply; 8+ messages in thread
From: Laurent Pinchart @ 2026-03-16 14:02 UTC (permalink / raw)
  To: Biju
  Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Biju Das, Jonas Karlman, Jernej Skrabec, Dmitry Baryshkov,
	Tommaso Merciai, Andy Yan, Douglas Anderson, Luca Ceresoli,
	Jesse Van Gavere, dri-devel, linux-kernel, Geert Uytterhoeven,
	Prabhakar Mahadev Lad, linux-renesas-soc

Hi Biju,

Thank you for the patch.

On Fri, Dec 19, 2025 at 10:46:53AM +0000, Biju wrote:
> From: Biju Das <biju.das.jz@bp.renesas.com>
> 
> On RZ/G3E SMARC EVK using PSCI, s2ram powers down the SoC. Testing ADV7535
> IRQ configured as edge-triggered interrupt on RZ/G3E SMARC EVK shows that
> it is missing HPD IRQ during system resume, as the status change occurs
> before the IRQ/pincontrol resume. Once the status bit is set, there won't
> be any further IRQ unless the status bit is cleared.
> 
> Clear any pending HPD IRQs before powering on the ADV7535 device to
> deliver HPD interrupts after resume().

This issue doesn't seem to be specific to the ADV7511. Any device that
uses an edge-triggered interrupt could suffer from the same problem.
Implementing a work around in the driver doesn't seem to be a solution
that would scale.

> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
>  drivers/gpu/drm/bridge/adv7511/adv7511.h     |  1 +
>  drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 32 ++++++++++++++++++++
>  2 files changed, 33 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511.h b/drivers/gpu/drm/bridge/adv7511/adv7511.h
> index 8be7266fd4f4..03aa23836ca4 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511.h
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511.h
> @@ -393,6 +393,7 @@ struct adv7511 {
>  	bool cec_enabled_adap;
>  	struct clk *cec_clk;
>  	u32 cec_clk_freq;
> +	bool suspended;
>  };
>  
>  static inline struct adv7511 *bridge_to_adv7511(struct drm_bridge *bridge)
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> index b9be86541307..8d9467187d7c 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> @@ -790,6 +790,25 @@ static void adv7511_bridge_atomic_enable(struct drm_bridge *bridge,
>  	struct drm_connector_state *conn_state;
>  	struct drm_crtc_state *crtc_state;
>  
> +	if (adv->i2c_main->irq && adv->suspended) {
> +		unsigned int irq;
> +
> +		/*
> +		 * If ADV7511 IRQ is configured as edge triggered interrupt, it
> +		 * will miss the IRQ during system resume as the status change
> +		 * occurs before IRQ/pincontrol resume. Once the status bit is

That seems very platform-specific.

> +		 * set there won't be any further IRQ unless the status bit is
> +		 * cleared. So, clear the IRQ status bit for further delivery
> +		 * of HPD IRQ.
> +		 */
> +		regmap_read(adv->regmap, ADV7511_REG_INT(0), &irq);
> +		if (irq & ADV7511_INT0_HPD)
> +			regmap_write(adv->regmap, ADV7511_REG_INT(0),
> +				     ADV7511_INT0_HPD);

Why do you need to read and test the IRQ here ? If ADV7511_INT0_HPD
isn't set, a write will be a no-op and will keep it cleared. If it is
set, it will clear it. It seems that an unconditional

		regmap_write(adv->regmap, ADV7511_REG_INT(0),
			     ADV7511_INT0_HPD);

should be enough.

> +
> +		adv->suspended = false;
> +	}
> +
>  	adv7511_power_on(adv);
>  
>  	connector = drm_atomic_get_new_connector_for_encoder(state, bridge->encoder);
> @@ -1407,6 +1426,16 @@ static void adv7511_remove(struct i2c_client *i2c)
>  	i2c_unregister_device(adv7511->i2c_edid);
>  }
>  
> +static int adv7511_suspend(struct device *dev)
> +{
> +	struct i2c_client *i2c = to_i2c_client(dev);
> +	struct adv7511 *adv7511 = i2c_get_clientdata(i2c);
> +
> +	adv7511->suspended = true;
> +
> +	return 0;
> +}
> +
>  static const struct adv7511_chip_info adv7511_chip_info = {
>  	.type = ADV7511,
>  	.name = "ADV7511",
> @@ -1439,6 +1468,8 @@ static const struct adv7511_chip_info adv7535_chip_info = {
>  	.hpd_override_enable = true,
>  };
>  
> +static DEFINE_SIMPLE_DEV_PM_OPS(adv7511_pm_ops, adv7511_suspend, NULL);
> +
>  static const struct i2c_device_id adv7511_i2c_ids[] = {
>  	{ "adv7511", (kernel_ulong_t)&adv7511_chip_info },
>  	{ "adv7511w", (kernel_ulong_t)&adv7511_chip_info },
> @@ -1467,6 +1498,7 @@ static struct i2c_driver adv7511_driver = {
>  	.driver = {
>  		.name = "adv7511",
>  		.of_match_table = adv7511_of_ids,
> +		.pm = pm_sleep_ptr(&adv7511_pm_ops),
>  	},
>  	.id_table = adv7511_i2c_ids,
>  	.probe = adv7511_probe,

-- 
Regards,

Laurent Pinchart

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

* RE: [PATCH] drm/bridge: adv7511: Clear HPD IRQ before powering on device during resume()
  2026-03-16 14:02 ` Laurent Pinchart
@ 2026-03-16 17:59   ` Biju Das
  2026-03-17 23:29     ` Laurent Pinchart
  0 siblings, 1 reply; 8+ messages in thread
From: Biju Das @ 2026-03-16 17:59 UTC (permalink / raw)
  To: Laurent Pinchart, biju.das.au
  Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Jonas Karlman, Jernej Skrabec, Dmitry Baryshkov, Tommaso Merciai,
	Andy Yan, Douglas Anderson, Luca Ceresoli, Jesse Van Gavere,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Geert Uytterhoeven, Prabhakar Mahadev Lad,
	linux-renesas-soc@vger.kernel.org

Hi Laurent,

Thanks for the feedback.

> -----Original Message-----
> From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Sent: 16 March 2026 14:03
> Subject: Re: [PATCH] drm/bridge: adv7511: Clear HPD IRQ before powering on device during resume()
> 
> Hi Biju,
> 
> Thank you for the patch.
> 
> On Fri, Dec 19, 2025 at 10:46:53AM +0000, Biju wrote:
> > From: Biju Das <biju.das.jz@bp.renesas.com>
> >
> > On RZ/G3E SMARC EVK using PSCI, s2ram powers down the SoC. Testing
> > ADV7535 IRQ configured as edge-triggered interrupt on RZ/G3E SMARC EVK
> > shows that it is missing HPD IRQ during system resume, as the status
> > change occurs before the IRQ/pincontrol resume. Once the status bit is
> > set, there won't be any further IRQ unless the status bit is cleared.
> >
> > Clear any pending HPD IRQs before powering on the ADV7535 device to
> > deliver HPD interrupts after resume().
> 
> This issue doesn't seem to be specific to the ADV7511. Any device that uses an edge-triggered
> interrupt could suffer from the same problem.
> Implementing a work around in the driver doesn't seem to be a solution that would scale.

I don't see any bridge device is complaining about similar issues in Linux kernel.
Looks like, other bridge devices do not have such restriction.

> 
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> >  drivers/gpu/drm/bridge/adv7511/adv7511.h     |  1 +
> >  drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 32
> > ++++++++++++++++++++
> >  2 files changed, 33 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511.h
> > b/drivers/gpu/drm/bridge/adv7511/adv7511.h
> > index 8be7266fd4f4..03aa23836ca4 100644
> > --- a/drivers/gpu/drm/bridge/adv7511/adv7511.h
> > +++ b/drivers/gpu/drm/bridge/adv7511/adv7511.h
> > @@ -393,6 +393,7 @@ struct adv7511 {
> >  	bool cec_enabled_adap;
> >  	struct clk *cec_clk;
> >  	u32 cec_clk_freq;
> > +	bool suspended;
> >  };
> >
> >  static inline struct adv7511 *bridge_to_adv7511(struct drm_bridge
> > *bridge) diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > index b9be86541307..8d9467187d7c 100644
> > --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > @@ -790,6 +790,25 @@ static void adv7511_bridge_atomic_enable(struct drm_bridge *bridge,
> >  	struct drm_connector_state *conn_state;
> >  	struct drm_crtc_state *crtc_state;
> >
> > +	if (adv->i2c_main->irq && adv->suspended) {
> > +		unsigned int irq;
> > +
> > +		/*
> > +		 * If ADV7511 IRQ is configured as edge triggered interrupt, it
> > +		 * will miss the IRQ during system resume as the status change
> > +		 * occurs before IRQ/pincontrol resume. Once the status bit is
> 
> That seems very platform-specific.

OK, I will reword something like. Is it ok for you?

The HPD status change occurs before the interrupt/pin control resume.
Once the status bit is set, there will be no further delivery of interrupts
unless the status bit is cleared. Therefore, clear the interrupt status bit
for further delivery of HPD interrupts.

> 
> > +		 * set there won't be any further IRQ unless the status bit is
> > +		 * cleared. So, clear the IRQ status bit for further delivery
> > +		 * of HPD IRQ.
> > +		 */
> > +		regmap_read(adv->regmap, ADV7511_REG_INT(0), &irq);
> > +		if (irq & ADV7511_INT0_HPD)
> > +			regmap_write(adv->regmap, ADV7511_REG_INT(0),
> > +				     ADV7511_INT0_HPD);
> 
> Why do you need to read and test the IRQ here ? If ADV7511_INT0_HPD isn't set, a write will be a no-op
> and will keep it cleared. If it is set, it will clear it. It seems that an unconditional
> 
> 		regmap_write(adv->regmap, ADV7511_REG_INT(0),
> 			     ADV7511_INT0_HPD);
> 
> should be enough.

Agreed, I will make this unconditional.

Cheers,
Biju



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

* Re: [PATCH] drm/bridge: adv7511: Clear HPD IRQ before powering on device during resume()
  2026-03-16 17:59   ` Biju Das
@ 2026-03-17 23:29     ` Laurent Pinchart
  2026-03-18  6:57       ` Biju Das
  0 siblings, 1 reply; 8+ messages in thread
From: Laurent Pinchart @ 2026-03-17 23:29 UTC (permalink / raw)
  To: Biju Das
  Cc: biju.das.au, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Jonas Karlman, Jernej Skrabec, Dmitry Baryshkov,
	Tommaso Merciai, Andy Yan, Douglas Anderson, Luca Ceresoli,
	Jesse Van Gavere, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, Geert Uytterhoeven,
	Prabhakar Mahadev Lad, linux-renesas-soc@vger.kernel.org

On Mon, Mar 16, 2026 at 05:59:57PM +0000, Biju Das wrote:
> On 16 March 2026 14:03, Laurent Pinchart wrote:
> > On Fri, Dec 19, 2025 at 10:46:53AM +0000, Biju wrote:
> > > From: Biju Das <biju.das.jz@bp.renesas.com>
> > >
> > > On RZ/G3E SMARC EVK using PSCI, s2ram powers down the SoC. Testing
> > > ADV7535 IRQ configured as edge-triggered interrupt on RZ/G3E SMARC EVK
> > > shows that it is missing HPD IRQ during system resume, as the status
> > > change occurs before the IRQ/pincontrol resume. Once the status bit is
> > > set, there won't be any further IRQ unless the status bit is cleared.
> > >
> > > Clear any pending HPD IRQs before powering on the ADV7535 device to
> > > deliver HPD interrupts after resume().
> > 
> > This issue doesn't seem to be specific to the ADV7511. Any device that uses an edge-triggered
> > interrupt could suffer from the same problem.
> > Implementing a work around in the driver doesn't seem to be a solution that would scale.
> 
> I don't see any bridge device is complaining about similar issues in Linux kernel.

This is exactly why this patch concerns me. The issue doesn't seem to be
specific to the ADV7511, yet no other bridge driver implements anything
similar. It seems to indicate something else is wrong.

I understand and agree with the analysis of the issue (although I find
it weird that the interrupt controller or pin controller would be
resumed after the ADV7511), but any device with an edge-triggered
interrupt should then suffer from the same problem. This means it
shouldn't be handled at individual drivers level, unless there's
something I'm missing that makes the problem very specific to the
ADV7511. Otherwise, a more generic solution is needed.

> Looks like, other bridge devices do not have such restriction.
>
> > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > > ---
> > >  drivers/gpu/drm/bridge/adv7511/adv7511.h     |  1 +
> > >  drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 32 ++++++++++++++++++++
> > >  2 files changed, 33 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511.h
> > > b/drivers/gpu/drm/bridge/adv7511/adv7511.h
> > > index 8be7266fd4f4..03aa23836ca4 100644
> > > --- a/drivers/gpu/drm/bridge/adv7511/adv7511.h
> > > +++ b/drivers/gpu/drm/bridge/adv7511/adv7511.h
> > > @@ -393,6 +393,7 @@ struct adv7511 {
> > >  	bool cec_enabled_adap;
> > >  	struct clk *cec_clk;
> > >  	u32 cec_clk_freq;
> > > +	bool suspended;
> > >  };
> > >
> > >  static inline struct adv7511 *bridge_to_adv7511(struct drm_bridge
> > > *bridge) diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > > b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > > index b9be86541307..8d9467187d7c 100644
> > > --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > > +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > > @@ -790,6 +790,25 @@ static void adv7511_bridge_atomic_enable(struct drm_bridge *bridge,
> > >  	struct drm_connector_state *conn_state;
> > >  	struct drm_crtc_state *crtc_state;
> > >
> > > +	if (adv->i2c_main->irq && adv->suspended) {
> > > +		unsigned int irq;
> > > +
> > > +		/*
> > > +		 * If ADV7511 IRQ is configured as edge triggered interrupt, it
> > > +		 * will miss the IRQ during system resume as the status change
> > > +		 * occurs before IRQ/pincontrol resume. Once the status bit is
> > 
> > That seems very platform-specific.
> 
> OK, I will reword something like. Is it ok for you?
> 
> The HPD status change occurs before the interrupt/pin control resume.
> Once the status bit is set, there will be no further delivery of interrupts
> unless the status bit is cleared. Therefore, clear the interrupt status bit
> for further delivery of HPD interrupts.
> 
> > 
> > > +		 * set there won't be any further IRQ unless the status bit is
> > > +		 * cleared. So, clear the IRQ status bit for further delivery
> > > +		 * of HPD IRQ.
> > > +		 */
> > > +		regmap_read(adv->regmap, ADV7511_REG_INT(0), &irq);
> > > +		if (irq & ADV7511_INT0_HPD)
> > > +			regmap_write(adv->regmap, ADV7511_REG_INT(0),
> > > +				     ADV7511_INT0_HPD);
> > 
> > Why do you need to read and test the IRQ here ? If ADV7511_INT0_HPD isn't set, a write will be a no-op
> > and will keep it cleared. If it is set, it will clear it. It seems that an unconditional
> > 
> > 		regmap_write(adv->regmap, ADV7511_REG_INT(0),
> > 			     ADV7511_INT0_HPD);
> > 
> > should be enough.
> 
> Agreed, I will make this unconditional.

-- 
Regards,

Laurent Pinchart

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

* RE: [PATCH] drm/bridge: adv7511: Clear HPD IRQ before powering on device during resume()
  2026-03-17 23:29     ` Laurent Pinchart
@ 2026-03-18  6:57       ` Biju Das
  0 siblings, 0 replies; 8+ messages in thread
From: Biju Das @ 2026-03-18  6:57 UTC (permalink / raw)
  To: laurent.pinchart
  Cc: biju.das.au, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Jonas Karlman, Jernej Skrabec, Dmitry Baryshkov,
	Tommaso Merciai, Andy Yan, Douglas Anderson, Luca Ceresoli,
	Jesse Van Gavere, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, Geert Uytterhoeven,
	Prabhakar Mahadev Lad, linux-renesas-soc@vger.kernel.org

Hi Laurent,

> -----Original Message-----
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Sent: 17 March 2026 23:30
> Subject: Re: [PATCH] drm/bridge: adv7511: Clear HPD IRQ before powering on device during resume()
> 
> On Mon, Mar 16, 2026 at 05:59:57PM +0000, Biju Das wrote:
> > On 16 March 2026 14:03, Laurent Pinchart wrote:
> > > On Fri, Dec 19, 2025 at 10:46:53AM +0000, Biju wrote:
> > > > From: Biju Das <biju.das.jz@bp.renesas.com>
> > > >
> > > > On RZ/G3E SMARC EVK using PSCI, s2ram powers down the SoC. Testing
> > > > ADV7535 IRQ configured as edge-triggered interrupt on RZ/G3E SMARC
> > > > EVK shows that it is missing HPD IRQ during system resume, as the
> > > > status change occurs before the IRQ/pincontrol resume. Once the
> > > > status bit is set, there won't be any further IRQ unless the status bit is cleared.
> > > >
> > > > Clear any pending HPD IRQs before powering on the ADV7535 device
> > > > to deliver HPD interrupts after resume().
> > >
> > > This issue doesn't seem to be specific to the ADV7511. Any device
> > > that uses an edge-triggered interrupt could suffer from the same problem.
> > > Implementing a work around in the driver doesn't seem to be a solution that would scale.
> >
> > I don't see any bridge device is complaining about similar issues in Linux kernel.
> 
> This is exactly why this patch concerns me. The issue doesn't seem to be specific to the ADV7511, yet
> no other bridge driver implements anything similar. It seems to indicate something else is wrong.
> 
> I understand and agree with the analysis of the issue (although I find it weird that the interrupt
> controller or pin controller would be resumed after the ADV7511), but any device with an edge-
> triggered interrupt should then suffer from the same problem. This means it shouldn't be handled at
> individual drivers level, unless there's something I'm missing that makes the problem very specific to
> the ADV7511. Otherwise, a more generic solution is needed.

ADV7535 is special device, hardware reset automatically set the status bit, if a connector is
connected without software is turning power on unlike other devices.

Do you know any other bridge device shows this issue? i.e., without software turning the power on,
bridge device sets the status bit during power on reset??

Cheers,
Biju

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

end of thread, other threads:[~2026-03-18  6:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-19 10:46 [PATCH] drm/bridge: adv7511: Clear HPD IRQ before powering on device during resume() Biju
2026-01-12  8:15 ` Tommaso Merciai
2026-03-16 10:40 ` Biju Das
2026-03-16 11:22 ` Luca Ceresoli
2026-03-16 14:02 ` Laurent Pinchart
2026-03-16 17:59   ` Biju Das
2026-03-17 23:29     ` Laurent Pinchart
2026-03-18  6:57       ` Biju Das

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