linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] drm/vc4: Fix for the HDMI detect power state
@ 2021-05-25  9:10 Maxime Ripard
  2021-05-25  9:10 ` [PATCH 1/3] drm: Mention the power state requirement on side-channel operations Maxime Ripard
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Maxime Ripard @ 2021-05-25  9:10 UTC (permalink / raw)
  To: dri-devel, Daniel Vetter, David Airlie, Maarten Lankhorst,
	Thomas Zimmermann, Maxime Ripard
  Cc: Daniel Vetter, Boris Brezillon, linux-kernel, Eric Anholt,
	Emma Anholt, Dave Stevenson, Phil Elwell, Tim Gover, Dom Cobley,
	Maxime Ripard

Hi,\r
\r
This fixes an issue found during a rework on the RPi3 where we would\r
end up with the detect callback of the HDMI connector called while the\r
device would be disabled.\r
\r
This unfortunately results in a complete CPU hang on the RaspberryPi.\r
\r
The documentation doesn't really provide any expectation on the power\r
state for various operations that could be performed while the device is\r
off, so the first patch makes that clear. The next two patches make sure\r
the device is sufficiently powered for detect to run without any issue.\r
\r
Let me know what you think,\r
Maxime\r
\r
Maxime Ripard (3):\r
  drm: Mention the power state requirement on side-channel operations\r
  drm/vc4: hdmi: Move the HSM clock enable to runtime_pm\r
  drm/vc4: hdmi: Make sure the controller is powered in detect\r
\r
 drivers/gpu/drm/vc4/vc4_hdmi.c | 45 ++++++++++++++++++++++++++--------\r
 include/drm/drm_connector.h    |  5 ++++\r
 include/drm/drm_dp_helper.h    |  4 +++\r
 include/drm/drm_mipi_dsi.h     |  5 ++++\r
 4 files changed, 49 insertions(+), 10 deletions(-)\r
\r
-- \r
2.31.1\r
\r

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

* [PATCH 1/3] drm: Mention the power state requirement on side-channel operations
  2021-05-25  9:10 [PATCH 0/3] drm/vc4: Fix for the HDMI detect power state Maxime Ripard
@ 2021-05-25  9:10 ` Maxime Ripard
  2021-05-25  9:10 ` [PATCH 2/3] drm/vc4: hdmi: Move the HSM clock enable to runtime_pm Maxime Ripard
  2021-05-25  9:10 ` [PATCH 3/3] drm/vc4: hdmi: Make sure the controller is powered in detect Maxime Ripard
  2 siblings, 0 replies; 7+ messages in thread
From: Maxime Ripard @ 2021-05-25  9:10 UTC (permalink / raw)
  To: dri-devel, Daniel Vetter, David Airlie, Maarten Lankhorst,
	Thomas Zimmermann, Maxime Ripard
  Cc: Daniel Vetter, Boris Brezillon, linux-kernel, Eric Anholt,
	Emma Anholt, Dave Stevenson, Phil Elwell, Tim Gover, Dom Cobley,
	Maxime Ripard

The drm_connector detect, drm_dp_aux transfer and mipi_dsi_host
operations typically require to access their underlying device to
perform what is expected of them.

However, there's no guarantee on the fact that the device has been
enabled through atomic_enable or similar that will usually power the
device. The access to an unpowered device is then an undefined behaviour
ranging from the access being ignored to a hard CPU hang.

Let's document that expectation to avoid as much as possible those
consequences.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 include/drm/drm_connector.h | 5 +++++
 include/drm/drm_dp_helper.h | 4 ++++
 include/drm/drm_mipi_dsi.h  | 5 +++++
 3 files changed, 14 insertions(+)

diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 714d1a01c065..0a1d9a0fcbb2 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -848,6 +848,11 @@ struct drm_connector_funcs {
 	 * locks to avoid races with concurrent modeset changes need to use
 	 * &drm_connector_helper_funcs.detect_ctx instead.
 	 *
+	 * Also note that this callback can be called no matter the
+	 * state the connector is in. Drivers that need the underlying
+	 * device to be powered to perform the detection will first need
+	 * to make sure it's been properly enabled.
+	 *
 	 * RETURNS:
 	 *
 	 * drm_connector_status indicating the connector's status.
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 06681bf46d81..4fcb027c8821 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -1884,6 +1884,10 @@ struct drm_dp_aux_cec {
  * Note that the aux helper code assumes that the @transfer() function only
  * modifies the reply field of the &drm_dp_aux_msg structure. The retry logic
  * and i2c helpers assume this is the case.
+ *
+ * Also note that @transfer() can be called no matter the state @dev is
+ * in. Drivers that need that device to be powered to perform this
+ * operation will first need to make sure it's been properly enabled.
  */
 struct drm_dp_aux {
 	const char *name;
diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
index 360e6377e84b..849d3029e303 100644
--- a/include/drm/drm_mipi_dsi.h
+++ b/include/drm/drm_mipi_dsi.h
@@ -80,6 +80,11 @@ int mipi_dsi_create_packet(struct mipi_dsi_packet *packet,
  * Note that typically DSI packet transmission is atomic, so the .transfer()
  * function will seldomly return anything other than the number of bytes
  * contained in the transmit buffer on success.
+ *
+ * Also note that those callbacks can be called no matter the state the
+ * host is in. Drivers that need the underlying device to be powered to
+ * perform these operations will first need to make sure it's been
+ * properly enabled.
  */
 struct mipi_dsi_host_ops {
 	int (*attach)(struct mipi_dsi_host *host,
-- 
2.31.1


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

* [PATCH 2/3] drm/vc4: hdmi: Move the HSM clock enable to runtime_pm
  2021-05-25  9:10 [PATCH 0/3] drm/vc4: Fix for the HDMI detect power state Maxime Ripard
  2021-05-25  9:10 ` [PATCH 1/3] drm: Mention the power state requirement on side-channel operations Maxime Ripard
@ 2021-05-25  9:10 ` Maxime Ripard
  2021-06-16 10:49   ` Dave Stevenson
  2021-05-25  9:10 ` [PATCH 3/3] drm/vc4: hdmi: Make sure the controller is powered in detect Maxime Ripard
  2 siblings, 1 reply; 7+ messages in thread
From: Maxime Ripard @ 2021-05-25  9:10 UTC (permalink / raw)
  To: dri-devel, Daniel Vetter, David Airlie, Maarten Lankhorst,
	Thomas Zimmermann, Maxime Ripard
  Cc: Daniel Vetter, Boris Brezillon, linux-kernel, Eric Anholt,
	Emma Anholt, Dave Stevenson, Phil Elwell, Tim Gover, Dom Cobley,
	Maxime Ripard

In order to access the HDMI controller, we need to make sure the HSM
clock is enabled. If we were to access it with the clock disabled, the
CPU would completely hang, resulting in an hard crash.

Since we have different code path that would require it, let's move that
clock enable / disable to runtime_pm that will take care of the
reference counting for us.

Fixes: 4f6e3d66ac52 ("drm/vc4: Add runtime PM support to the HDMI encoder driver")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 drivers/gpu/drm/vc4/vc4_hdmi.c | 41 +++++++++++++++++++++++++---------
 1 file changed, 31 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index f9de8632a28b..867009a471e1 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -632,7 +632,6 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder,
 		   HDMI_READ(HDMI_VID_CTL) & ~VC4_HD_VID_CTL_ENABLE);
 
 	clk_disable_unprepare(vc4_hdmi->pixel_bvb_clock);
-	clk_disable_unprepare(vc4_hdmi->hsm_clock);
 	clk_disable_unprepare(vc4_hdmi->pixel_clock);
 
 	ret = pm_runtime_put(&vc4_hdmi->pdev->dev);
@@ -943,13 +942,6 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
 		return;
 	}
 
-	ret = clk_prepare_enable(vc4_hdmi->hsm_clock);
-	if (ret) {
-		DRM_ERROR("Failed to turn on HSM clock: %d\n", ret);
-		clk_disable_unprepare(vc4_hdmi->pixel_clock);
-		return;
-	}
-
 	vc4_hdmi_cec_update_clk_div(vc4_hdmi);
 
 	if (pixel_rate > 297000000)
@@ -962,7 +954,6 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
 	ret = clk_set_min_rate(vc4_hdmi->pixel_bvb_clock, bvb_rate);
 	if (ret) {
 		DRM_ERROR("Failed to set pixel bvb clock rate: %d\n", ret);
-		clk_disable_unprepare(vc4_hdmi->hsm_clock);
 		clk_disable_unprepare(vc4_hdmi->pixel_clock);
 		return;
 	}
@@ -970,7 +961,6 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
 	ret = clk_prepare_enable(vc4_hdmi->pixel_bvb_clock);
 	if (ret) {
 		DRM_ERROR("Failed to turn on pixel bvb clock: %d\n", ret);
-		clk_disable_unprepare(vc4_hdmi->hsm_clock);
 		clk_disable_unprepare(vc4_hdmi->pixel_clock);
 		return;
 	}
@@ -2097,6 +2087,29 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi)
 	return 0;
 }
 
+#ifdef CONFIG_PM
+static int vc4_hdmi_runtime_suspend(struct device *dev)
+{
+	struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);
+
+	clk_disable_unprepare(vc4_hdmi->hsm_clock);
+
+	return 0;
+}
+
+static int vc4_hdmi_runtime_resume(struct device *dev)
+{
+	struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);
+	int ret;
+
+	ret = clk_prepare_enable(vc4_hdmi->hsm_clock);
+	if (ret)
+		return ret;
+
+	return 0;
+}
+#endif
+
 static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
 {
 	const struct vc4_hdmi_variant *variant = of_device_get_match_data(dev);
@@ -2353,11 +2366,19 @@ static const struct of_device_id vc4_hdmi_dt_match[] = {
 	{}
 };
 
+
+static const struct dev_pm_ops vc4_hdmi_pm_ops = {
+	SET_RUNTIME_PM_OPS(vc4_hdmi_runtime_suspend,
+			   vc4_hdmi_runtime_resume,
+			   NULL)
+};
+
 struct platform_driver vc4_hdmi_driver = {
 	.probe = vc4_hdmi_dev_probe,
 	.remove = vc4_hdmi_dev_remove,
 	.driver = {
 		.name = "vc4_hdmi",
 		.of_match_table = vc4_hdmi_dt_match,
+		.pm = &vc4_hdmi_pm_ops,
 	},
 };
-- 
2.31.1


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

* [PATCH 3/3] drm/vc4: hdmi: Make sure the controller is powered in detect
  2021-05-25  9:10 [PATCH 0/3] drm/vc4: Fix for the HDMI detect power state Maxime Ripard
  2021-05-25  9:10 ` [PATCH 1/3] drm: Mention the power state requirement on side-channel operations Maxime Ripard
  2021-05-25  9:10 ` [PATCH 2/3] drm/vc4: hdmi: Move the HSM clock enable to runtime_pm Maxime Ripard
@ 2021-05-25  9:10 ` Maxime Ripard
  2021-06-16 10:51   ` Dave Stevenson
  2 siblings, 1 reply; 7+ messages in thread
From: Maxime Ripard @ 2021-05-25  9:10 UTC (permalink / raw)
  To: dri-devel, Daniel Vetter, David Airlie, Maarten Lankhorst,
	Thomas Zimmermann, Maxime Ripard
  Cc: Daniel Vetter, Boris Brezillon, linux-kernel, Eric Anholt,
	Emma Anholt, Dave Stevenson, Phil Elwell, Tim Gover, Dom Cobley,
	Maxime Ripard

If the HPD GPIO is not available and drm_probe_ddc fails, we end up
reading the HDMI_HOTPLUG register, but the controller might be powered
off resulting in a CPU hang. Make sure we have the power domain and the
HSM clock powered during the detect cycle to prevent the hang from
happening.

Fixes: 4f6e3d66ac52 ("drm/vc4: Add runtime PM support to the HDMI encoder driver")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 867009a471e1..4b6857467e58 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -166,6 +166,8 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force)
 	struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector);
 	bool connected = false;
 
+	WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev));
+
 	if (vc4_hdmi->hpd_gpio) {
 		if (gpio_get_value_cansleep(vc4_hdmi->hpd_gpio) ^
 		    vc4_hdmi->hpd_active_low)
@@ -187,10 +189,12 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force)
 			}
 		}
 
+		pm_runtime_put(&vc4_hdmi->pdev->dev);
 		return connector_status_connected;
 	}
 
 	cec_phys_addr_invalidate(vc4_hdmi->cec_adap);
+	pm_runtime_put(&vc4_hdmi->pdev->dev);
 	return connector_status_disconnected;
 }
 
-- 
2.31.1


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

* Re: [PATCH 2/3] drm/vc4: hdmi: Move the HSM clock enable to runtime_pm
  2021-05-25  9:10 ` [PATCH 2/3] drm/vc4: hdmi: Move the HSM clock enable to runtime_pm Maxime Ripard
@ 2021-06-16 10:49   ` Dave Stevenson
  0 siblings, 0 replies; 7+ messages in thread
From: Dave Stevenson @ 2021-06-16 10:49 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: DRI Development, Daniel Vetter, David Airlie, Maarten Lankhorst,
	Thomas Zimmermann, Daniel Vetter, Boris Brezillon, LKML,
	Eric Anholt, Emma Anholt, Phil Elwell, Tim Gover, Dom Cobley,
	Maxime Ripard

Hi Maxime

On Tue, 25 May 2021 at 10:11, Maxime Ripard <maxime@cerno.tech> wrote:
>
> In order to access the HDMI controller, we need to make sure the HSM
> clock is enabled. If we were to access it with the clock disabled, the
> CPU would completely hang, resulting in an hard crash.
>
> Since we have different code path that would require it, let's move that
> clock enable / disable to runtime_pm that will take care of the
> reference counting for us.

This does change the order of clk_set_rate vs clk_prepare_enable, so
the clock is already running during
vc4_hdmi_encoder_pre_crtc_configure when the pixel rate is known.
However the crtc and HDMI blocks won't be actively passing pixels at
that point, so I don't see an issue with changing the rate. The clock
manager block will sort out the rate change happily.

Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>

> Fixes: 4f6e3d66ac52 ("drm/vc4: Add runtime PM support to the HDMI encoder driver")
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> ---
>  drivers/gpu/drm/vc4/vc4_hdmi.c | 41 +++++++++++++++++++++++++---------
>  1 file changed, 31 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
> index f9de8632a28b..867009a471e1 100644
> --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
> +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
> @@ -632,7 +632,6 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder,
>                    HDMI_READ(HDMI_VID_CTL) & ~VC4_HD_VID_CTL_ENABLE);
>
>         clk_disable_unprepare(vc4_hdmi->pixel_bvb_clock);
> -       clk_disable_unprepare(vc4_hdmi->hsm_clock);
>         clk_disable_unprepare(vc4_hdmi->pixel_clock);
>
>         ret = pm_runtime_put(&vc4_hdmi->pdev->dev);
> @@ -943,13 +942,6 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
>                 return;
>         }
>
> -       ret = clk_prepare_enable(vc4_hdmi->hsm_clock);
> -       if (ret) {
> -               DRM_ERROR("Failed to turn on HSM clock: %d\n", ret);
> -               clk_disable_unprepare(vc4_hdmi->pixel_clock);
> -               return;
> -       }
> -
>         vc4_hdmi_cec_update_clk_div(vc4_hdmi);
>
>         if (pixel_rate > 297000000)
> @@ -962,7 +954,6 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
>         ret = clk_set_min_rate(vc4_hdmi->pixel_bvb_clock, bvb_rate);
>         if (ret) {
>                 DRM_ERROR("Failed to set pixel bvb clock rate: %d\n", ret);
> -               clk_disable_unprepare(vc4_hdmi->hsm_clock);
>                 clk_disable_unprepare(vc4_hdmi->pixel_clock);
>                 return;
>         }
> @@ -970,7 +961,6 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
>         ret = clk_prepare_enable(vc4_hdmi->pixel_bvb_clock);
>         if (ret) {
>                 DRM_ERROR("Failed to turn on pixel bvb clock: %d\n", ret);
> -               clk_disable_unprepare(vc4_hdmi->hsm_clock);
>                 clk_disable_unprepare(vc4_hdmi->pixel_clock);
>                 return;
>         }
> @@ -2097,6 +2087,29 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi)
>         return 0;
>  }
>
> +#ifdef CONFIG_PM
> +static int vc4_hdmi_runtime_suspend(struct device *dev)
> +{
> +       struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);
> +
> +       clk_disable_unprepare(vc4_hdmi->hsm_clock);
> +
> +       return 0;
> +}
> +
> +static int vc4_hdmi_runtime_resume(struct device *dev)
> +{
> +       struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);
> +       int ret;
> +
> +       ret = clk_prepare_enable(vc4_hdmi->hsm_clock);
> +       if (ret)
> +               return ret;
> +
> +       return 0;
> +}
> +#endif
> +
>  static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
>  {
>         const struct vc4_hdmi_variant *variant = of_device_get_match_data(dev);
> @@ -2353,11 +2366,19 @@ static const struct of_device_id vc4_hdmi_dt_match[] = {
>         {}
>  };
>
> +
> +static const struct dev_pm_ops vc4_hdmi_pm_ops = {
> +       SET_RUNTIME_PM_OPS(vc4_hdmi_runtime_suspend,
> +                          vc4_hdmi_runtime_resume,
> +                          NULL)
> +};
> +
>  struct platform_driver vc4_hdmi_driver = {
>         .probe = vc4_hdmi_dev_probe,
>         .remove = vc4_hdmi_dev_remove,
>         .driver = {
>                 .name = "vc4_hdmi",
>                 .of_match_table = vc4_hdmi_dt_match,
> +               .pm = &vc4_hdmi_pm_ops,
>         },
>  };
> --
> 2.31.1
>

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

* Re: [PATCH 3/3] drm/vc4: hdmi: Make sure the controller is powered in detect
  2021-05-25  9:10 ` [PATCH 3/3] drm/vc4: hdmi: Make sure the controller is powered in detect Maxime Ripard
@ 2021-06-16 10:51   ` Dave Stevenson
  2021-06-16 12:35     ` Maxime Ripard
  0 siblings, 1 reply; 7+ messages in thread
From: Dave Stevenson @ 2021-06-16 10:51 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: DRI Development, Daniel Vetter, David Airlie, Maarten Lankhorst,
	Thomas Zimmermann, Daniel Vetter, Boris Brezillon, LKML,
	Eric Anholt, Emma Anholt, Phil Elwell, Tim Gover, Dom Cobley,
	Maxime Ripard

On Tue, 25 May 2021 at 10:11, Maxime Ripard <maxime@cerno.tech> wrote:
>
> If the HPD GPIO is not available and drm_probe_ddc fails, we end up
> reading the HDMI_HOTPLUG register, but the controller might be powered
> off resulting in a CPU hang. Make sure we have the power domain and the
> HSM clock powered during the detect cycle to prevent the hang from
> happening.
>
> Fixes: 4f6e3d66ac52 ("drm/vc4: Add runtime PM support to the HDMI encoder driver")
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>

Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>

> ---
>  drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
> index 867009a471e1..4b6857467e58 100644
> --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
> +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
> @@ -166,6 +166,8 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force)
>         struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector);
>         bool connected = false;
>
> +       WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev));
> +
>         if (vc4_hdmi->hpd_gpio) {
>                 if (gpio_get_value_cansleep(vc4_hdmi->hpd_gpio) ^
>                     vc4_hdmi->hpd_active_low)
> @@ -187,10 +189,12 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force)
>                         }
>                 }
>
> +               pm_runtime_put(&vc4_hdmi->pdev->dev);
>                 return connector_status_connected;
>         }
>
>         cec_phys_addr_invalidate(vc4_hdmi->cec_adap);
> +       pm_runtime_put(&vc4_hdmi->pdev->dev);
>         return connector_status_disconnected;
>  }
>
> --
> 2.31.1
>

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

* Re: [PATCH 3/3] drm/vc4: hdmi: Make sure the controller is powered in detect
  2021-06-16 10:51   ` Dave Stevenson
@ 2021-06-16 12:35     ` Maxime Ripard
  0 siblings, 0 replies; 7+ messages in thread
From: Maxime Ripard @ 2021-06-16 12:35 UTC (permalink / raw)
  To: Dave Stevenson
  Cc: DRI Development, Daniel Vetter, David Airlie, Maarten Lankhorst,
	Thomas Zimmermann, Daniel Vetter, Boris Brezillon, LKML,
	Eric Anholt, Emma Anholt, Phil Elwell, Tim Gover, Dom Cobley

[-- Attachment #1: Type: text/plain, Size: 796 bytes --]

On Wed, Jun 16, 2021 at 11:51:26AM +0100, Dave Stevenson wrote:
> On Tue, 25 May 2021 at 10:11, Maxime Ripard <maxime@cerno.tech> wrote:
> >
> > If the HPD GPIO is not available and drm_probe_ddc fails, we end up
> > reading the HDMI_HOTPLUG register, but the controller might be powered
> > off resulting in a CPU hang. Make sure we have the power domain and the
> > HSM clock powered during the detect cycle to prevent the hang from
> > happening.
> >
> > Fixes: 4f6e3d66ac52 ("drm/vc4: Add runtime PM support to the HDMI encoder driver")
> > Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> 
> Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>

Applied patches 2 and 3, I'll resend a new version of patch 1 after some
comments by Daniel on IRC.

Thanks!
Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

end of thread, other threads:[~2021-06-16 12:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25  9:10 [PATCH 0/3] drm/vc4: Fix for the HDMI detect power state Maxime Ripard
2021-05-25  9:10 ` [PATCH 1/3] drm: Mention the power state requirement on side-channel operations Maxime Ripard
2021-05-25  9:10 ` [PATCH 2/3] drm/vc4: hdmi: Move the HSM clock enable to runtime_pm Maxime Ripard
2021-06-16 10:49   ` Dave Stevenson
2021-05-25  9:10 ` [PATCH 3/3] drm/vc4: hdmi: Make sure the controller is powered in detect Maxime Ripard
2021-06-16 10:51   ` Dave Stevenson
2021-06-16 12:35     ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).