All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2022-11-02 18:06 ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:06 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
DRM driver do a proper work of calling
drm_bridge_connector_en/disable_hpd() in right places. Rather than
teaching each and every driver how to properly handle
drm_bridge_connector's HPD, make that automatic.

Add two additional drm_connector helper funcs: enable_hpd() and
disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
is the time where the drm_bridge_connector's functions are called by the
drivers too).

Changes since v2:
 - Fixed a typo in the commit message of the second patch.

Changes since v1:
 - Rebased on top of v6.1-rc1
 - Removed the drm_bridge_connector_enable_hpd() from
   drm_bridge_connector_init()
 - Removed extra underscore prefix from
   drm_bridge_connector_en/disable_hpd() helpers

Dmitry Baryshkov (7):
  drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
  drm/probe-helper: enable and disable HPD on connectors
  drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
  drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
  drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
  drm/omap: stop using drm_bridge_connector_en/disable_hpd()
  drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()

 drivers/gpu/drm/drm_bridge_connector.c   | 27 +++-------------
 drivers/gpu/drm/drm_probe_helper.c       | 40 ++++++++++++++++++-----
 drivers/gpu/drm/imx/dcss/dcss-dev.c      |  4 ---
 drivers/gpu/drm/imx/dcss/dcss-kms.c      |  2 --
 drivers/gpu/drm/msm/hdmi/hdmi.c          |  2 --
 drivers/gpu/drm/omapdrm/omap_drv.c       | 41 ------------------------
 include/drm/drm_bridge_connector.h       |  2 --
 include/drm/drm_modeset_helper_vtables.h | 22 +++++++++++++
 8 files changed, 59 insertions(+), 81 deletions(-)

-- 
2.35.1


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

* [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2022-11-02 18:06 ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:06 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel

From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
DRM driver do a proper work of calling
drm_bridge_connector_en/disable_hpd() in right places. Rather than
teaching each and every driver how to properly handle
drm_bridge_connector's HPD, make that automatic.

Add two additional drm_connector helper funcs: enable_hpd() and
disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
is the time where the drm_bridge_connector's functions are called by the
drivers too).

Changes since v2:
 - Fixed a typo in the commit message of the second patch.

Changes since v1:
 - Rebased on top of v6.1-rc1
 - Removed the drm_bridge_connector_enable_hpd() from
   drm_bridge_connector_init()
 - Removed extra underscore prefix from
   drm_bridge_connector_en/disable_hpd() helpers

Dmitry Baryshkov (7):
  drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
  drm/probe-helper: enable and disable HPD on connectors
  drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
  drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
  drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
  drm/omap: stop using drm_bridge_connector_en/disable_hpd()
  drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()

 drivers/gpu/drm/drm_bridge_connector.c   | 27 +++-------------
 drivers/gpu/drm/drm_probe_helper.c       | 40 ++++++++++++++++++-----
 drivers/gpu/drm/imx/dcss/dcss-dev.c      |  4 ---
 drivers/gpu/drm/imx/dcss/dcss-kms.c      |  2 --
 drivers/gpu/drm/msm/hdmi/hdmi.c          |  2 --
 drivers/gpu/drm/omapdrm/omap_drv.c       | 41 ------------------------
 include/drm/drm_bridge_connector.h       |  2 --
 include/drm/drm_modeset_helper_vtables.h | 22 +++++++++++++
 8 files changed, 59 insertions(+), 81 deletions(-)

-- 
2.35.1


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

* [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2022-11-02 18:06 ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:06 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
DRM driver do a proper work of calling
drm_bridge_connector_en/disable_hpd() in right places. Rather than
teaching each and every driver how to properly handle
drm_bridge_connector's HPD, make that automatic.

Add two additional drm_connector helper funcs: enable_hpd() and
disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
is the time where the drm_bridge_connector's functions are called by the
drivers too).

Changes since v2:
 - Fixed a typo in the commit message of the second patch.

Changes since v1:
 - Rebased on top of v6.1-rc1
 - Removed the drm_bridge_connector_enable_hpd() from
   drm_bridge_connector_init()
 - Removed extra underscore prefix from
   drm_bridge_connector_en/disable_hpd() helpers

Dmitry Baryshkov (7):
  drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
  drm/probe-helper: enable and disable HPD on connectors
  drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
  drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
  drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
  drm/omap: stop using drm_bridge_connector_en/disable_hpd()
  drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()

 drivers/gpu/drm/drm_bridge_connector.c   | 27 +++-------------
 drivers/gpu/drm/drm_probe_helper.c       | 40 ++++++++++++++++++-----
 drivers/gpu/drm/imx/dcss/dcss-dev.c      |  4 ---
 drivers/gpu/drm/imx/dcss/dcss-kms.c      |  2 --
 drivers/gpu/drm/msm/hdmi/hdmi.c          |  2 --
 drivers/gpu/drm/omapdrm/omap_drv.c       | 41 ------------------------
 include/drm/drm_bridge_connector.h       |  2 --
 include/drm/drm_modeset_helper_vtables.h | 22 +++++++++++++
 8 files changed, 59 insertions(+), 81 deletions(-)

-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v3 1/7] drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
  2022-11-02 18:06 ` Dmitry Baryshkov
  (?)
@ 2022-11-02 18:06   ` Dmitry Baryshkov
  -1 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:06 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

Merge drm_kms_helper_poll_disable() and drm_kms_helper_poll_fini() code
into a common helper function.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/drm_probe_helper.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index 69b0b2b9cc1c..f97fda3b1d34 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -803,6 +803,17 @@ bool drm_kms_helper_is_poll_worker(void)
 }
 EXPORT_SYMBOL(drm_kms_helper_is_poll_worker);
 
+static void drm_kms_helper_poll_disable_fini(struct drm_device *dev, bool fini)
+{
+	if (!dev->mode_config.poll_enabled)
+		return;
+
+	if (fini)
+		dev->mode_config.poll_enabled = false;
+
+	cancel_delayed_work_sync(&dev->mode_config.output_poll_work);
+}
+
 /**
  * drm_kms_helper_poll_disable - disable output polling
  * @dev: drm_device
@@ -819,9 +830,7 @@ EXPORT_SYMBOL(drm_kms_helper_is_poll_worker);
  */
 void drm_kms_helper_poll_disable(struct drm_device *dev)
 {
-	if (!dev->mode_config.poll_enabled)
-		return;
-	cancel_delayed_work_sync(&dev->mode_config.output_poll_work);
+	drm_kms_helper_poll_disable_fini(dev, false);
 }
 EXPORT_SYMBOL(drm_kms_helper_poll_disable);
 
@@ -859,11 +868,7 @@ EXPORT_SYMBOL(drm_kms_helper_poll_init);
  */
 void drm_kms_helper_poll_fini(struct drm_device *dev)
 {
-	if (!dev->mode_config.poll_enabled)
-		return;
-
-	dev->mode_config.poll_enabled = false;
-	cancel_delayed_work_sync(&dev->mode_config.output_poll_work);
+	drm_kms_helper_poll_disable_fini(dev, true);
 }
 EXPORT_SYMBOL(drm_kms_helper_poll_fini);
 
-- 
2.35.1


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

* [PATCH v3 1/7] drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
@ 2022-11-02 18:06   ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:06 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel

Merge drm_kms_helper_poll_disable() and drm_kms_helper_poll_fini() code
into a common helper function.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/drm_probe_helper.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index 69b0b2b9cc1c..f97fda3b1d34 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -803,6 +803,17 @@ bool drm_kms_helper_is_poll_worker(void)
 }
 EXPORT_SYMBOL(drm_kms_helper_is_poll_worker);
 
+static void drm_kms_helper_poll_disable_fini(struct drm_device *dev, bool fini)
+{
+	if (!dev->mode_config.poll_enabled)
+		return;
+
+	if (fini)
+		dev->mode_config.poll_enabled = false;
+
+	cancel_delayed_work_sync(&dev->mode_config.output_poll_work);
+}
+
 /**
  * drm_kms_helper_poll_disable - disable output polling
  * @dev: drm_device
@@ -819,9 +830,7 @@ EXPORT_SYMBOL(drm_kms_helper_is_poll_worker);
  */
 void drm_kms_helper_poll_disable(struct drm_device *dev)
 {
-	if (!dev->mode_config.poll_enabled)
-		return;
-	cancel_delayed_work_sync(&dev->mode_config.output_poll_work);
+	drm_kms_helper_poll_disable_fini(dev, false);
 }
 EXPORT_SYMBOL(drm_kms_helper_poll_disable);
 
@@ -859,11 +868,7 @@ EXPORT_SYMBOL(drm_kms_helper_poll_init);
  */
 void drm_kms_helper_poll_fini(struct drm_device *dev)
 {
-	if (!dev->mode_config.poll_enabled)
-		return;
-
-	dev->mode_config.poll_enabled = false;
-	cancel_delayed_work_sync(&dev->mode_config.output_poll_work);
+	drm_kms_helper_poll_disable_fini(dev, true);
 }
 EXPORT_SYMBOL(drm_kms_helper_poll_fini);
 
-- 
2.35.1


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

* [PATCH v3 1/7] drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
@ 2022-11-02 18:06   ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:06 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

Merge drm_kms_helper_poll_disable() and drm_kms_helper_poll_fini() code
into a common helper function.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/drm_probe_helper.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index 69b0b2b9cc1c..f97fda3b1d34 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -803,6 +803,17 @@ bool drm_kms_helper_is_poll_worker(void)
 }
 EXPORT_SYMBOL(drm_kms_helper_is_poll_worker);
 
+static void drm_kms_helper_poll_disable_fini(struct drm_device *dev, bool fini)
+{
+	if (!dev->mode_config.poll_enabled)
+		return;
+
+	if (fini)
+		dev->mode_config.poll_enabled = false;
+
+	cancel_delayed_work_sync(&dev->mode_config.output_poll_work);
+}
+
 /**
  * drm_kms_helper_poll_disable - disable output polling
  * @dev: drm_device
@@ -819,9 +830,7 @@ EXPORT_SYMBOL(drm_kms_helper_is_poll_worker);
  */
 void drm_kms_helper_poll_disable(struct drm_device *dev)
 {
-	if (!dev->mode_config.poll_enabled)
-		return;
-	cancel_delayed_work_sync(&dev->mode_config.output_poll_work);
+	drm_kms_helper_poll_disable_fini(dev, false);
 }
 EXPORT_SYMBOL(drm_kms_helper_poll_disable);
 
@@ -859,11 +868,7 @@ EXPORT_SYMBOL(drm_kms_helper_poll_init);
  */
 void drm_kms_helper_poll_fini(struct drm_device *dev)
 {
-	if (!dev->mode_config.poll_enabled)
-		return;
-
-	dev->mode_config.poll_enabled = false;
-	cancel_delayed_work_sync(&dev->mode_config.output_poll_work);
+	drm_kms_helper_poll_disable_fini(dev, true);
 }
 EXPORT_SYMBOL(drm_kms_helper_poll_fini);
 
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v3 2/7] drm/probe-helper: enable and disable HPD on connectors
  2022-11-02 18:06 ` Dmitry Baryshkov
  (?)
@ 2022-11-02 18:07   ` Dmitry Baryshkov
  -1 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:07 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

Introduce two drm_connector_helper_funcs: enable_hpd() and disable_hpd().
They are called by drm_kms_helper_poll_enable() and
drm_kms_helper_poll_disable() (and thus drm_kms_helper_poll_init() and
drm_kms_helper_poll_fini()) respectively.

This allows DRM drivers to rely on drm_kms_helper_poll for enabling and
disabling HPD detection rather than doing that manually.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/drm_probe_helper.c       | 19 +++++++++++++++++++
 include/drm/drm_modeset_helper_vtables.h | 22 ++++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index f97fda3b1d34..a7b4590d8ec1 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -251,6 +251,12 @@ void drm_kms_helper_poll_enable(struct drm_device *dev)
 
 	drm_connector_list_iter_begin(dev, &conn_iter);
 	drm_for_each_connector_iter(connector, &conn_iter) {
+		const struct drm_connector_helper_funcs *funcs =
+			connector->helper_private;
+
+		if (funcs && funcs->enable_hpd)
+			funcs->enable_hpd(connector);
+
 		if (connector->polled & (DRM_CONNECTOR_POLL_CONNECT |
 					 DRM_CONNECTOR_POLL_DISCONNECT))
 			poll = true;
@@ -805,12 +811,25 @@ EXPORT_SYMBOL(drm_kms_helper_is_poll_worker);
 
 static void drm_kms_helper_poll_disable_fini(struct drm_device *dev, bool fini)
 {
+	struct drm_connector *connector;
+	struct drm_connector_list_iter conn_iter;
+
 	if (!dev->mode_config.poll_enabled)
 		return;
 
 	if (fini)
 		dev->mode_config.poll_enabled = false;
 
+	drm_connector_list_iter_begin(dev, &conn_iter);
+	drm_for_each_connector_iter(connector, &conn_iter) {
+		const struct drm_connector_helper_funcs *funcs =
+			connector->helper_private;
+
+		if (funcs && funcs->disable_hpd)
+			funcs->disable_hpd(connector);
+	}
+	drm_connector_list_iter_end(&conn_iter);
+
 	cancel_delayed_work_sync(&dev->mode_config.output_poll_work);
 }
 
diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h
index fafa70ac1337..7aa1f01223f9 100644
--- a/include/drm/drm_modeset_helper_vtables.h
+++ b/include/drm/drm_modeset_helper_vtables.h
@@ -1143,6 +1143,28 @@ struct drm_connector_helper_funcs {
 	 */
 	void (*cleanup_writeback_job)(struct drm_writeback_connector *connector,
 				      struct drm_writeback_job *job);
+
+	/**
+	 * @enable_hpd:
+	 *
+	 * Enable hot-plug detection for the connector.
+	 *
+	 * This operation is optional.
+	 *
+	 * This callback is used by the drm_kms_helper_poll_enable() helpers.
+	 */
+	void (*enable_hpd)(struct drm_connector *connector);
+
+	/**
+	 * @disable_hpd:
+	 *
+	 * Disable hot-plug detection for the connector.
+	 *
+	 * This operation is optional.
+	 *
+	 * This callback is used by the drm_kms_helper_poll_disable() helpers.
+	 */
+	void (*disable_hpd)(struct drm_connector *connector);
 };
 
 /**
-- 
2.35.1


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

* [PATCH v3 2/7] drm/probe-helper: enable and disable HPD on connectors
@ 2022-11-02 18:07   ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:07 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel

Introduce two drm_connector_helper_funcs: enable_hpd() and disable_hpd().
They are called by drm_kms_helper_poll_enable() and
drm_kms_helper_poll_disable() (and thus drm_kms_helper_poll_init() and
drm_kms_helper_poll_fini()) respectively.

This allows DRM drivers to rely on drm_kms_helper_poll for enabling and
disabling HPD detection rather than doing that manually.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/drm_probe_helper.c       | 19 +++++++++++++++++++
 include/drm/drm_modeset_helper_vtables.h | 22 ++++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index f97fda3b1d34..a7b4590d8ec1 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -251,6 +251,12 @@ void drm_kms_helper_poll_enable(struct drm_device *dev)
 
 	drm_connector_list_iter_begin(dev, &conn_iter);
 	drm_for_each_connector_iter(connector, &conn_iter) {
+		const struct drm_connector_helper_funcs *funcs =
+			connector->helper_private;
+
+		if (funcs && funcs->enable_hpd)
+			funcs->enable_hpd(connector);
+
 		if (connector->polled & (DRM_CONNECTOR_POLL_CONNECT |
 					 DRM_CONNECTOR_POLL_DISCONNECT))
 			poll = true;
@@ -805,12 +811,25 @@ EXPORT_SYMBOL(drm_kms_helper_is_poll_worker);
 
 static void drm_kms_helper_poll_disable_fini(struct drm_device *dev, bool fini)
 {
+	struct drm_connector *connector;
+	struct drm_connector_list_iter conn_iter;
+
 	if (!dev->mode_config.poll_enabled)
 		return;
 
 	if (fini)
 		dev->mode_config.poll_enabled = false;
 
+	drm_connector_list_iter_begin(dev, &conn_iter);
+	drm_for_each_connector_iter(connector, &conn_iter) {
+		const struct drm_connector_helper_funcs *funcs =
+			connector->helper_private;
+
+		if (funcs && funcs->disable_hpd)
+			funcs->disable_hpd(connector);
+	}
+	drm_connector_list_iter_end(&conn_iter);
+
 	cancel_delayed_work_sync(&dev->mode_config.output_poll_work);
 }
 
diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h
index fafa70ac1337..7aa1f01223f9 100644
--- a/include/drm/drm_modeset_helper_vtables.h
+++ b/include/drm/drm_modeset_helper_vtables.h
@@ -1143,6 +1143,28 @@ struct drm_connector_helper_funcs {
 	 */
 	void (*cleanup_writeback_job)(struct drm_writeback_connector *connector,
 				      struct drm_writeback_job *job);
+
+	/**
+	 * @enable_hpd:
+	 *
+	 * Enable hot-plug detection for the connector.
+	 *
+	 * This operation is optional.
+	 *
+	 * This callback is used by the drm_kms_helper_poll_enable() helpers.
+	 */
+	void (*enable_hpd)(struct drm_connector *connector);
+
+	/**
+	 * @disable_hpd:
+	 *
+	 * Disable hot-plug detection for the connector.
+	 *
+	 * This operation is optional.
+	 *
+	 * This callback is used by the drm_kms_helper_poll_disable() helpers.
+	 */
+	void (*disable_hpd)(struct drm_connector *connector);
 };
 
 /**
-- 
2.35.1


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

* [PATCH v3 2/7] drm/probe-helper: enable and disable HPD on connectors
@ 2022-11-02 18:07   ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:07 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

Introduce two drm_connector_helper_funcs: enable_hpd() and disable_hpd().
They are called by drm_kms_helper_poll_enable() and
drm_kms_helper_poll_disable() (and thus drm_kms_helper_poll_init() and
drm_kms_helper_poll_fini()) respectively.

This allows DRM drivers to rely on drm_kms_helper_poll for enabling and
disabling HPD detection rather than doing that manually.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/drm_probe_helper.c       | 19 +++++++++++++++++++
 include/drm/drm_modeset_helper_vtables.h | 22 ++++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index f97fda3b1d34..a7b4590d8ec1 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -251,6 +251,12 @@ void drm_kms_helper_poll_enable(struct drm_device *dev)
 
 	drm_connector_list_iter_begin(dev, &conn_iter);
 	drm_for_each_connector_iter(connector, &conn_iter) {
+		const struct drm_connector_helper_funcs *funcs =
+			connector->helper_private;
+
+		if (funcs && funcs->enable_hpd)
+			funcs->enable_hpd(connector);
+
 		if (connector->polled & (DRM_CONNECTOR_POLL_CONNECT |
 					 DRM_CONNECTOR_POLL_DISCONNECT))
 			poll = true;
@@ -805,12 +811,25 @@ EXPORT_SYMBOL(drm_kms_helper_is_poll_worker);
 
 static void drm_kms_helper_poll_disable_fini(struct drm_device *dev, bool fini)
 {
+	struct drm_connector *connector;
+	struct drm_connector_list_iter conn_iter;
+
 	if (!dev->mode_config.poll_enabled)
 		return;
 
 	if (fini)
 		dev->mode_config.poll_enabled = false;
 
+	drm_connector_list_iter_begin(dev, &conn_iter);
+	drm_for_each_connector_iter(connector, &conn_iter) {
+		const struct drm_connector_helper_funcs *funcs =
+			connector->helper_private;
+
+		if (funcs && funcs->disable_hpd)
+			funcs->disable_hpd(connector);
+	}
+	drm_connector_list_iter_end(&conn_iter);
+
 	cancel_delayed_work_sync(&dev->mode_config.output_poll_work);
 }
 
diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h
index fafa70ac1337..7aa1f01223f9 100644
--- a/include/drm/drm_modeset_helper_vtables.h
+++ b/include/drm/drm_modeset_helper_vtables.h
@@ -1143,6 +1143,28 @@ struct drm_connector_helper_funcs {
 	 */
 	void (*cleanup_writeback_job)(struct drm_writeback_connector *connector,
 				      struct drm_writeback_job *job);
+
+	/**
+	 * @enable_hpd:
+	 *
+	 * Enable hot-plug detection for the connector.
+	 *
+	 * This operation is optional.
+	 *
+	 * This callback is used by the drm_kms_helper_poll_enable() helpers.
+	 */
+	void (*enable_hpd)(struct drm_connector *connector);
+
+	/**
+	 * @disable_hpd:
+	 *
+	 * Disable hot-plug detection for the connector.
+	 *
+	 * This operation is optional.
+	 *
+	 * This callback is used by the drm_kms_helper_poll_disable() helpers.
+	 */
+	void (*disable_hpd)(struct drm_connector *connector);
 };
 
 /**
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v3 3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
  2022-11-02 18:06 ` Dmitry Baryshkov
  (?)
@ 2022-11-02 18:07   ` Dmitry Baryshkov
  -1 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:07 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

Use drm_connector's helpers enable_hpd and disable_hpd to enable and
disable HPD automatically by the means of drm_kms_helper_poll_*
functions. As the drm_bridge_connector_enable_hpd() and
drm_bridge_connector_disable_hpd() functions are now unused, replace
them with stubs to ease driver migration.

Enabling the HPD from drm_bridge_connector_init() can happen too early,
before the driver is prepared to handle HPD events. As the
drm_bridge_connector_enable_hpd() is empty anyway, drop this call
anyway.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/drm_bridge_connector.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
index 1c7d936523df..0e13bc87a6ac 100644
--- a/drivers/gpu/drm/drm_bridge_connector.c
+++ b/drivers/gpu/drm/drm_bridge_connector.c
@@ -136,6 +136,11 @@ static void drm_bridge_connector_hpd_cb(void *cb_data,
  * This is typically used by display drivers in their resume handler.
  */
 void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
+{
+}
+EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
+
+static void _drm_bridge_connector_enable_hpd(struct drm_connector *connector)
 {
 	struct drm_bridge_connector *bridge_connector =
 		to_drm_bridge_connector(connector);
@@ -145,7 +150,6 @@ void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
 		drm_bridge_hpd_enable(hpd, drm_bridge_connector_hpd_cb,
 				      bridge_connector);
 }
-EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
 
 /**
  * drm_bridge_connector_disable_hpd - Disable hot-plug detection for the
@@ -156,6 +160,11 @@ EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
  * This is typically used by display drivers in their suspend handler.
  */
 void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
+{
+}
+EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
+
+static void _drm_bridge_connector_disable_hpd(struct drm_connector *connector)
 {
 	struct drm_bridge_connector *bridge_connector =
 		to_drm_bridge_connector(connector);
@@ -164,7 +173,6 @@ void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
 	if (hpd)
 		drm_bridge_hpd_disable(hpd);
 }
-EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
 
 /* -----------------------------------------------------------------------------
  * Bridge Connector Functions
@@ -305,6 +313,8 @@ static int drm_bridge_connector_get_modes(struct drm_connector *connector)
 static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = {
 	.get_modes = drm_bridge_connector_get_modes,
 	/* No need for .mode_valid(), the bridges are checked by the core. */
+	.enable_hpd = _drm_bridge_connector_enable_hpd,
+	.disable_hpd = _drm_bridge_connector_disable_hpd,
 };
 
 /* -----------------------------------------------------------------------------
@@ -387,10 +397,8 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
 				    connector_type, ddc);
 	drm_connector_helper_add(connector, &drm_bridge_connector_helper_funcs);
 
-	if (bridge_connector->bridge_hpd) {
+	if (bridge_connector->bridge_hpd)
 		connector->polled = DRM_CONNECTOR_POLL_HPD;
-		drm_bridge_connector_enable_hpd(connector);
-	}
 	else if (bridge_connector->bridge_detect)
 		connector->polled = DRM_CONNECTOR_POLL_CONNECT
 				  | DRM_CONNECTOR_POLL_DISCONNECT;
-- 
2.35.1


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

* [PATCH v3 3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
@ 2022-11-02 18:07   ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:07 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel

Use drm_connector's helpers enable_hpd and disable_hpd to enable and
disable HPD automatically by the means of drm_kms_helper_poll_*
functions. As the drm_bridge_connector_enable_hpd() and
drm_bridge_connector_disable_hpd() functions are now unused, replace
them with stubs to ease driver migration.

Enabling the HPD from drm_bridge_connector_init() can happen too early,
before the driver is prepared to handle HPD events. As the
drm_bridge_connector_enable_hpd() is empty anyway, drop this call
anyway.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/drm_bridge_connector.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
index 1c7d936523df..0e13bc87a6ac 100644
--- a/drivers/gpu/drm/drm_bridge_connector.c
+++ b/drivers/gpu/drm/drm_bridge_connector.c
@@ -136,6 +136,11 @@ static void drm_bridge_connector_hpd_cb(void *cb_data,
  * This is typically used by display drivers in their resume handler.
  */
 void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
+{
+}
+EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
+
+static void _drm_bridge_connector_enable_hpd(struct drm_connector *connector)
 {
 	struct drm_bridge_connector *bridge_connector =
 		to_drm_bridge_connector(connector);
@@ -145,7 +150,6 @@ void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
 		drm_bridge_hpd_enable(hpd, drm_bridge_connector_hpd_cb,
 				      bridge_connector);
 }
-EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
 
 /**
  * drm_bridge_connector_disable_hpd - Disable hot-plug detection for the
@@ -156,6 +160,11 @@ EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
  * This is typically used by display drivers in their suspend handler.
  */
 void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
+{
+}
+EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
+
+static void _drm_bridge_connector_disable_hpd(struct drm_connector *connector)
 {
 	struct drm_bridge_connector *bridge_connector =
 		to_drm_bridge_connector(connector);
@@ -164,7 +173,6 @@ void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
 	if (hpd)
 		drm_bridge_hpd_disable(hpd);
 }
-EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
 
 /* -----------------------------------------------------------------------------
  * Bridge Connector Functions
@@ -305,6 +313,8 @@ static int drm_bridge_connector_get_modes(struct drm_connector *connector)
 static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = {
 	.get_modes = drm_bridge_connector_get_modes,
 	/* No need for .mode_valid(), the bridges are checked by the core. */
+	.enable_hpd = _drm_bridge_connector_enable_hpd,
+	.disable_hpd = _drm_bridge_connector_disable_hpd,
 };
 
 /* -----------------------------------------------------------------------------
@@ -387,10 +397,8 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
 				    connector_type, ddc);
 	drm_connector_helper_add(connector, &drm_bridge_connector_helper_funcs);
 
-	if (bridge_connector->bridge_hpd) {
+	if (bridge_connector->bridge_hpd)
 		connector->polled = DRM_CONNECTOR_POLL_HPD;
-		drm_bridge_connector_enable_hpd(connector);
-	}
 	else if (bridge_connector->bridge_detect)
 		connector->polled = DRM_CONNECTOR_POLL_CONNECT
 				  | DRM_CONNECTOR_POLL_DISCONNECT;
-- 
2.35.1


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

* [PATCH v3 3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
@ 2022-11-02 18:07   ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:07 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

Use drm_connector's helpers enable_hpd and disable_hpd to enable and
disable HPD automatically by the means of drm_kms_helper_poll_*
functions. As the drm_bridge_connector_enable_hpd() and
drm_bridge_connector_disable_hpd() functions are now unused, replace
them with stubs to ease driver migration.

Enabling the HPD from drm_bridge_connector_init() can happen too early,
before the driver is prepared to handle HPD events. As the
drm_bridge_connector_enable_hpd() is empty anyway, drop this call
anyway.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/drm_bridge_connector.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
index 1c7d936523df..0e13bc87a6ac 100644
--- a/drivers/gpu/drm/drm_bridge_connector.c
+++ b/drivers/gpu/drm/drm_bridge_connector.c
@@ -136,6 +136,11 @@ static void drm_bridge_connector_hpd_cb(void *cb_data,
  * This is typically used by display drivers in their resume handler.
  */
 void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
+{
+}
+EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
+
+static void _drm_bridge_connector_enable_hpd(struct drm_connector *connector)
 {
 	struct drm_bridge_connector *bridge_connector =
 		to_drm_bridge_connector(connector);
@@ -145,7 +150,6 @@ void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
 		drm_bridge_hpd_enable(hpd, drm_bridge_connector_hpd_cb,
 				      bridge_connector);
 }
-EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
 
 /**
  * drm_bridge_connector_disable_hpd - Disable hot-plug detection for the
@@ -156,6 +160,11 @@ EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
  * This is typically used by display drivers in their suspend handler.
  */
 void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
+{
+}
+EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
+
+static void _drm_bridge_connector_disable_hpd(struct drm_connector *connector)
 {
 	struct drm_bridge_connector *bridge_connector =
 		to_drm_bridge_connector(connector);
@@ -164,7 +173,6 @@ void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
 	if (hpd)
 		drm_bridge_hpd_disable(hpd);
 }
-EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
 
 /* -----------------------------------------------------------------------------
  * Bridge Connector Functions
@@ -305,6 +313,8 @@ static int drm_bridge_connector_get_modes(struct drm_connector *connector)
 static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = {
 	.get_modes = drm_bridge_connector_get_modes,
 	/* No need for .mode_valid(), the bridges are checked by the core. */
+	.enable_hpd = _drm_bridge_connector_enable_hpd,
+	.disable_hpd = _drm_bridge_connector_disable_hpd,
 };
 
 /* -----------------------------------------------------------------------------
@@ -387,10 +397,8 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
 				    connector_type, ddc);
 	drm_connector_helper_add(connector, &drm_bridge_connector_helper_funcs);
 
-	if (bridge_connector->bridge_hpd) {
+	if (bridge_connector->bridge_hpd)
 		connector->polled = DRM_CONNECTOR_POLL_HPD;
-		drm_bridge_connector_enable_hpd(connector);
-	}
 	else if (bridge_connector->bridge_detect)
 		connector->polled = DRM_CONNECTOR_POLL_CONNECT
 				  | DRM_CONNECTOR_POLL_DISCONNECT;
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v3 4/7] drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
  2022-11-02 18:06 ` Dmitry Baryshkov
  (?)
@ 2022-11-02 18:07   ` Dmitry Baryshkov
  -1 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:07 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

The functionality of drm_bridge_connector_enable_hpd() and
drm_bridge_connector_disable_hpd() is provided automatically by the
drm_kms_poll helpers. Stop calling these functions manually.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/imx/dcss/dcss-dev.c | 4 ----
 drivers/gpu/drm/imx/dcss/dcss-kms.c | 2 --
 2 files changed, 6 deletions(-)

diff --git a/drivers/gpu/drm/imx/dcss/dcss-dev.c b/drivers/gpu/drm/imx/dcss/dcss-dev.c
index 3f5750cc2673..0d8e44f20ec4 100644
--- a/drivers/gpu/drm/imx/dcss/dcss-dev.c
+++ b/drivers/gpu/drm/imx/dcss/dcss-dev.c
@@ -257,8 +257,6 @@ int dcss_dev_suspend(struct device *dev)
 	struct dcss_kms_dev *kms = container_of(ddev, struct dcss_kms_dev, base);
 	int ret;
 
-	drm_bridge_connector_disable_hpd(kms->connector);
-
 	drm_mode_config_helper_suspend(ddev);
 
 	if (pm_runtime_suspended(dev))
@@ -292,8 +290,6 @@ int dcss_dev_resume(struct device *dev)
 
 	drm_mode_config_helper_resume(ddev);
 
-	drm_bridge_connector_enable_hpd(kms->connector);
-
 	return 0;
 }
 #endif /* CONFIG_PM_SLEEP */
diff --git a/drivers/gpu/drm/imx/dcss/dcss-kms.c b/drivers/gpu/drm/imx/dcss/dcss-kms.c
index b4f82ebca532..16ef8aa6da37 100644
--- a/drivers/gpu/drm/imx/dcss/dcss-kms.c
+++ b/drivers/gpu/drm/imx/dcss/dcss-kms.c
@@ -151,7 +151,6 @@ struct dcss_kms_dev *dcss_kms_attach(struct dcss_dev *dcss)
 	return kms;
 
 cleanup_crtc:
-	drm_bridge_connector_disable_hpd(kms->connector);
 	drm_kms_helper_poll_fini(drm);
 	dcss_crtc_deinit(crtc, drm);
 
@@ -167,7 +166,6 @@ void dcss_kms_detach(struct dcss_kms_dev *kms)
 	struct drm_device *drm = &kms->base;
 
 	drm_dev_unregister(drm);
-	drm_bridge_connector_disable_hpd(kms->connector);
 	drm_kms_helper_poll_fini(drm);
 	drm_atomic_helper_shutdown(drm);
 	drm_crtc_vblank_off(&kms->crtc.base);
-- 
2.35.1


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

* [PATCH v3 4/7] drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
@ 2022-11-02 18:07   ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:07 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel

The functionality of drm_bridge_connector_enable_hpd() and
drm_bridge_connector_disable_hpd() is provided automatically by the
drm_kms_poll helpers. Stop calling these functions manually.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/imx/dcss/dcss-dev.c | 4 ----
 drivers/gpu/drm/imx/dcss/dcss-kms.c | 2 --
 2 files changed, 6 deletions(-)

diff --git a/drivers/gpu/drm/imx/dcss/dcss-dev.c b/drivers/gpu/drm/imx/dcss/dcss-dev.c
index 3f5750cc2673..0d8e44f20ec4 100644
--- a/drivers/gpu/drm/imx/dcss/dcss-dev.c
+++ b/drivers/gpu/drm/imx/dcss/dcss-dev.c
@@ -257,8 +257,6 @@ int dcss_dev_suspend(struct device *dev)
 	struct dcss_kms_dev *kms = container_of(ddev, struct dcss_kms_dev, base);
 	int ret;
 
-	drm_bridge_connector_disable_hpd(kms->connector);
-
 	drm_mode_config_helper_suspend(ddev);
 
 	if (pm_runtime_suspended(dev))
@@ -292,8 +290,6 @@ int dcss_dev_resume(struct device *dev)
 
 	drm_mode_config_helper_resume(ddev);
 
-	drm_bridge_connector_enable_hpd(kms->connector);
-
 	return 0;
 }
 #endif /* CONFIG_PM_SLEEP */
diff --git a/drivers/gpu/drm/imx/dcss/dcss-kms.c b/drivers/gpu/drm/imx/dcss/dcss-kms.c
index b4f82ebca532..16ef8aa6da37 100644
--- a/drivers/gpu/drm/imx/dcss/dcss-kms.c
+++ b/drivers/gpu/drm/imx/dcss/dcss-kms.c
@@ -151,7 +151,6 @@ struct dcss_kms_dev *dcss_kms_attach(struct dcss_dev *dcss)
 	return kms;
 
 cleanup_crtc:
-	drm_bridge_connector_disable_hpd(kms->connector);
 	drm_kms_helper_poll_fini(drm);
 	dcss_crtc_deinit(crtc, drm);
 
@@ -167,7 +166,6 @@ void dcss_kms_detach(struct dcss_kms_dev *kms)
 	struct drm_device *drm = &kms->base;
 
 	drm_dev_unregister(drm);
-	drm_bridge_connector_disable_hpd(kms->connector);
 	drm_kms_helper_poll_fini(drm);
 	drm_atomic_helper_shutdown(drm);
 	drm_crtc_vblank_off(&kms->crtc.base);
-- 
2.35.1


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

* [PATCH v3 4/7] drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
@ 2022-11-02 18:07   ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:07 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

The functionality of drm_bridge_connector_enable_hpd() and
drm_bridge_connector_disable_hpd() is provided automatically by the
drm_kms_poll helpers. Stop calling these functions manually.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/imx/dcss/dcss-dev.c | 4 ----
 drivers/gpu/drm/imx/dcss/dcss-kms.c | 2 --
 2 files changed, 6 deletions(-)

diff --git a/drivers/gpu/drm/imx/dcss/dcss-dev.c b/drivers/gpu/drm/imx/dcss/dcss-dev.c
index 3f5750cc2673..0d8e44f20ec4 100644
--- a/drivers/gpu/drm/imx/dcss/dcss-dev.c
+++ b/drivers/gpu/drm/imx/dcss/dcss-dev.c
@@ -257,8 +257,6 @@ int dcss_dev_suspend(struct device *dev)
 	struct dcss_kms_dev *kms = container_of(ddev, struct dcss_kms_dev, base);
 	int ret;
 
-	drm_bridge_connector_disable_hpd(kms->connector);
-
 	drm_mode_config_helper_suspend(ddev);
 
 	if (pm_runtime_suspended(dev))
@@ -292,8 +290,6 @@ int dcss_dev_resume(struct device *dev)
 
 	drm_mode_config_helper_resume(ddev);
 
-	drm_bridge_connector_enable_hpd(kms->connector);
-
 	return 0;
 }
 #endif /* CONFIG_PM_SLEEP */
diff --git a/drivers/gpu/drm/imx/dcss/dcss-kms.c b/drivers/gpu/drm/imx/dcss/dcss-kms.c
index b4f82ebca532..16ef8aa6da37 100644
--- a/drivers/gpu/drm/imx/dcss/dcss-kms.c
+++ b/drivers/gpu/drm/imx/dcss/dcss-kms.c
@@ -151,7 +151,6 @@ struct dcss_kms_dev *dcss_kms_attach(struct dcss_dev *dcss)
 	return kms;
 
 cleanup_crtc:
-	drm_bridge_connector_disable_hpd(kms->connector);
 	drm_kms_helper_poll_fini(drm);
 	dcss_crtc_deinit(crtc, drm);
 
@@ -167,7 +166,6 @@ void dcss_kms_detach(struct dcss_kms_dev *kms)
 	struct drm_device *drm = &kms->base;
 
 	drm_dev_unregister(drm);
-	drm_bridge_connector_disable_hpd(kms->connector);
 	drm_kms_helper_poll_fini(drm);
 	drm_atomic_helper_shutdown(drm);
 	drm_crtc_vblank_off(&kms->crtc.base);
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v3 5/7] drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
  2022-11-02 18:06 ` Dmitry Baryshkov
  (?)
@ 2022-11-02 18:07   ` Dmitry Baryshkov
  -1 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:07 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

The functionality of drm_bridge_connector_enable_hpd() and
drm_bridge_connector_disable_hpd() is provided automatically by the
drm_kms_poll helpers. Stop calling these functions manually.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/msm/hdmi/hdmi.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index 93fe61b86967..a540c45d4fd3 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -348,8 +348,6 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi,
 		goto fail;
 	}
 
-	drm_bridge_connector_enable_hpd(hdmi->connector);
-
 	ret = msm_hdmi_hpd_enable(hdmi->bridge);
 	if (ret < 0) {
 		DRM_DEV_ERROR(&hdmi->pdev->dev, "failed to enable HPD: %d\n", ret);
-- 
2.35.1


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

* [PATCH v3 5/7] drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
@ 2022-11-02 18:07   ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:07 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel

The functionality of drm_bridge_connector_enable_hpd() and
drm_bridge_connector_disable_hpd() is provided automatically by the
drm_kms_poll helpers. Stop calling these functions manually.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/msm/hdmi/hdmi.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index 93fe61b86967..a540c45d4fd3 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -348,8 +348,6 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi,
 		goto fail;
 	}
 
-	drm_bridge_connector_enable_hpd(hdmi->connector);
-
 	ret = msm_hdmi_hpd_enable(hdmi->bridge);
 	if (ret < 0) {
 		DRM_DEV_ERROR(&hdmi->pdev->dev, "failed to enable HPD: %d\n", ret);
-- 
2.35.1


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

* [PATCH v3 5/7] drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
@ 2022-11-02 18:07   ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:07 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

The functionality of drm_bridge_connector_enable_hpd() and
drm_bridge_connector_disable_hpd() is provided automatically by the
drm_kms_poll helpers. Stop calling these functions manually.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/msm/hdmi/hdmi.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index 93fe61b86967..a540c45d4fd3 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -348,8 +348,6 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi,
 		goto fail;
 	}
 
-	drm_bridge_connector_enable_hpd(hdmi->connector);
-
 	ret = msm_hdmi_hpd_enable(hdmi->bridge);
 	if (ret < 0) {
 		DRM_DEV_ERROR(&hdmi->pdev->dev, "failed to enable HPD: %d\n", ret);
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v3 6/7] drm/omap: stop using drm_bridge_connector_en/disable_hpd()
  2022-11-02 18:06 ` Dmitry Baryshkov
  (?)
@ 2022-11-02 18:07   ` Dmitry Baryshkov
  -1 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:07 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

The functionality of drm_bridge_connector_enable_hpd() and
drm_bridge_connector_disable_hpd() is provided automatically by the
drm_kms_poll helpers. Stop calling these functions manually.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/omapdrm/omap_drv.c | 41 ------------------------------
 1 file changed, 41 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index eaf67b9e5f12..699ed814e021 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -545,44 +545,6 @@ static void omap_modeset_fini(struct drm_device *ddev)
 	drm_mode_config_cleanup(ddev);
 }
 
-/*
- * Enable the HPD in external components if supported
- */
-static void omap_modeset_enable_external_hpd(struct drm_device *ddev)
-{
-	struct omap_drm_private *priv = ddev->dev_private;
-	unsigned int i;
-
-	for (i = 0; i < priv->num_pipes; i++) {
-		struct drm_connector *connector = priv->pipes[i].connector;
-
-		if (!connector)
-			continue;
-
-		if (priv->pipes[i].output->bridge)
-			drm_bridge_connector_enable_hpd(connector);
-	}
-}
-
-/*
- * Disable the HPD in external components if supported
- */
-static void omap_modeset_disable_external_hpd(struct drm_device *ddev)
-{
-	struct omap_drm_private *priv = ddev->dev_private;
-	unsigned int i;
-
-	for (i = 0; i < priv->num_pipes; i++) {
-		struct drm_connector *connector = priv->pipes[i].connector;
-
-		if (!connector)
-			continue;
-
-		if (priv->pipes[i].output->bridge)
-			drm_bridge_connector_disable_hpd(connector);
-	}
-}
-
 /*
  * drm ioctl funcs
  */
@@ -782,7 +744,6 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)
 	omap_fbdev_init(ddev);
 
 	drm_kms_helper_poll_init(ddev);
-	omap_modeset_enable_external_hpd(ddev);
 
 	/*
 	 * Register the DRM device with the core and the connectors with
@@ -795,7 +756,6 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)
 	return 0;
 
 err_cleanup_helpers:
-	omap_modeset_disable_external_hpd(ddev);
 	drm_kms_helper_poll_fini(ddev);
 
 	omap_fbdev_fini(ddev);
@@ -822,7 +782,6 @@ static void omapdrm_cleanup(struct omap_drm_private *priv)
 
 	drm_dev_unregister(ddev);
 
-	omap_modeset_disable_external_hpd(ddev);
 	drm_kms_helper_poll_fini(ddev);
 
 	omap_fbdev_fini(ddev);
-- 
2.35.1


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

* [PATCH v3 6/7] drm/omap: stop using drm_bridge_connector_en/disable_hpd()
@ 2022-11-02 18:07   ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:07 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel

The functionality of drm_bridge_connector_enable_hpd() and
drm_bridge_connector_disable_hpd() is provided automatically by the
drm_kms_poll helpers. Stop calling these functions manually.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/omapdrm/omap_drv.c | 41 ------------------------------
 1 file changed, 41 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index eaf67b9e5f12..699ed814e021 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -545,44 +545,6 @@ static void omap_modeset_fini(struct drm_device *ddev)
 	drm_mode_config_cleanup(ddev);
 }
 
-/*
- * Enable the HPD in external components if supported
- */
-static void omap_modeset_enable_external_hpd(struct drm_device *ddev)
-{
-	struct omap_drm_private *priv = ddev->dev_private;
-	unsigned int i;
-
-	for (i = 0; i < priv->num_pipes; i++) {
-		struct drm_connector *connector = priv->pipes[i].connector;
-
-		if (!connector)
-			continue;
-
-		if (priv->pipes[i].output->bridge)
-			drm_bridge_connector_enable_hpd(connector);
-	}
-}
-
-/*
- * Disable the HPD in external components if supported
- */
-static void omap_modeset_disable_external_hpd(struct drm_device *ddev)
-{
-	struct omap_drm_private *priv = ddev->dev_private;
-	unsigned int i;
-
-	for (i = 0; i < priv->num_pipes; i++) {
-		struct drm_connector *connector = priv->pipes[i].connector;
-
-		if (!connector)
-			continue;
-
-		if (priv->pipes[i].output->bridge)
-			drm_bridge_connector_disable_hpd(connector);
-	}
-}
-
 /*
  * drm ioctl funcs
  */
@@ -782,7 +744,6 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)
 	omap_fbdev_init(ddev);
 
 	drm_kms_helper_poll_init(ddev);
-	omap_modeset_enable_external_hpd(ddev);
 
 	/*
 	 * Register the DRM device with the core and the connectors with
@@ -795,7 +756,6 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)
 	return 0;
 
 err_cleanup_helpers:
-	omap_modeset_disable_external_hpd(ddev);
 	drm_kms_helper_poll_fini(ddev);
 
 	omap_fbdev_fini(ddev);
@@ -822,7 +782,6 @@ static void omapdrm_cleanup(struct omap_drm_private *priv)
 
 	drm_dev_unregister(ddev);
 
-	omap_modeset_disable_external_hpd(ddev);
 	drm_kms_helper_poll_fini(ddev);
 
 	omap_fbdev_fini(ddev);
-- 
2.35.1


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

* [PATCH v3 6/7] drm/omap: stop using drm_bridge_connector_en/disable_hpd()
@ 2022-11-02 18:07   ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:07 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

The functionality of drm_bridge_connector_enable_hpd() and
drm_bridge_connector_disable_hpd() is provided automatically by the
drm_kms_poll helpers. Stop calling these functions manually.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/omapdrm/omap_drv.c | 41 ------------------------------
 1 file changed, 41 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index eaf67b9e5f12..699ed814e021 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -545,44 +545,6 @@ static void omap_modeset_fini(struct drm_device *ddev)
 	drm_mode_config_cleanup(ddev);
 }
 
-/*
- * Enable the HPD in external components if supported
- */
-static void omap_modeset_enable_external_hpd(struct drm_device *ddev)
-{
-	struct omap_drm_private *priv = ddev->dev_private;
-	unsigned int i;
-
-	for (i = 0; i < priv->num_pipes; i++) {
-		struct drm_connector *connector = priv->pipes[i].connector;
-
-		if (!connector)
-			continue;
-
-		if (priv->pipes[i].output->bridge)
-			drm_bridge_connector_enable_hpd(connector);
-	}
-}
-
-/*
- * Disable the HPD in external components if supported
- */
-static void omap_modeset_disable_external_hpd(struct drm_device *ddev)
-{
-	struct omap_drm_private *priv = ddev->dev_private;
-	unsigned int i;
-
-	for (i = 0; i < priv->num_pipes; i++) {
-		struct drm_connector *connector = priv->pipes[i].connector;
-
-		if (!connector)
-			continue;
-
-		if (priv->pipes[i].output->bridge)
-			drm_bridge_connector_disable_hpd(connector);
-	}
-}
-
 /*
  * drm ioctl funcs
  */
@@ -782,7 +744,6 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)
 	omap_fbdev_init(ddev);
 
 	drm_kms_helper_poll_init(ddev);
-	omap_modeset_enable_external_hpd(ddev);
 
 	/*
 	 * Register the DRM device with the core and the connectors with
@@ -795,7 +756,6 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)
 	return 0;
 
 err_cleanup_helpers:
-	omap_modeset_disable_external_hpd(ddev);
 	drm_kms_helper_poll_fini(ddev);
 
 	omap_fbdev_fini(ddev);
@@ -822,7 +782,6 @@ static void omapdrm_cleanup(struct omap_drm_private *priv)
 
 	drm_dev_unregister(ddev);
 
-	omap_modeset_disable_external_hpd(ddev);
 	drm_kms_helper_poll_fini(ddev);
 
 	omap_fbdev_fini(ddev);
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v3 7/7] drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
  2022-11-02 18:06 ` Dmitry Baryshkov
  (?)
@ 2022-11-02 18:07   ` Dmitry Baryshkov
  -1 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:07 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

Now as all drivers stopped calling drm_bridge_connector_enable_hpd() and
drm_bridge_connector_disable_hpd() it is safe to remove them complelely.
Rename our internal helpers to remove the underscore prefix.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/drm_bridge_connector.c | 33 ++++----------------------
 include/drm/drm_bridge_connector.h     |  2 --
 2 files changed, 4 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
index 0e13bc87a6ac..19ae4a177ac3 100644
--- a/drivers/gpu/drm/drm_bridge_connector.c
+++ b/drivers/gpu/drm/drm_bridge_connector.c
@@ -128,19 +128,7 @@ static void drm_bridge_connector_hpd_cb(void *cb_data,
 	drm_kms_helper_hotplug_event(dev);
 }
 
-/**
- * drm_bridge_connector_enable_hpd - Enable hot-plug detection for the connector
- * @connector: The DRM bridge connector
- *
- * This function enables hot-plug detection for the given bridge connector.
- * This is typically used by display drivers in their resume handler.
- */
-void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
-{
-}
-EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
-
-static void _drm_bridge_connector_enable_hpd(struct drm_connector *connector)
+static void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
 {
 	struct drm_bridge_connector *bridge_connector =
 		to_drm_bridge_connector(connector);
@@ -151,20 +139,7 @@ static void _drm_bridge_connector_enable_hpd(struct drm_connector *connector)
 				      bridge_connector);
 }
 
-/**
- * drm_bridge_connector_disable_hpd - Disable hot-plug detection for the
- * connector
- * @connector: The DRM bridge connector
- *
- * This function disables hot-plug detection for the given bridge connector.
- * This is typically used by display drivers in their suspend handler.
- */
-void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
-{
-}
-EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
-
-static void _drm_bridge_connector_disable_hpd(struct drm_connector *connector)
+static void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
 {
 	struct drm_bridge_connector *bridge_connector =
 		to_drm_bridge_connector(connector);
@@ -313,8 +288,8 @@ static int drm_bridge_connector_get_modes(struct drm_connector *connector)
 static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = {
 	.get_modes = drm_bridge_connector_get_modes,
 	/* No need for .mode_valid(), the bridges are checked by the core. */
-	.enable_hpd = _drm_bridge_connector_enable_hpd,
-	.disable_hpd = _drm_bridge_connector_disable_hpd,
+	.enable_hpd = drm_bridge_connector_enable_hpd,
+	.disable_hpd = drm_bridge_connector_disable_hpd,
 };
 
 /* -----------------------------------------------------------------------------
diff --git a/include/drm/drm_bridge_connector.h b/include/drm/drm_bridge_connector.h
index 33f6c3bbdb4a..69630815fb09 100644
--- a/include/drm/drm_bridge_connector.h
+++ b/include/drm/drm_bridge_connector.h
@@ -10,8 +10,6 @@ struct drm_connector;
 struct drm_device;
 struct drm_encoder;
 
-void drm_bridge_connector_enable_hpd(struct drm_connector *connector);
-void drm_bridge_connector_disable_hpd(struct drm_connector *connector);
 struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
 						struct drm_encoder *encoder);
 
-- 
2.35.1


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

* [PATCH v3 7/7] drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
@ 2022-11-02 18:07   ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:07 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel

Now as all drivers stopped calling drm_bridge_connector_enable_hpd() and
drm_bridge_connector_disable_hpd() it is safe to remove them complelely.
Rename our internal helpers to remove the underscore prefix.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/drm_bridge_connector.c | 33 ++++----------------------
 include/drm/drm_bridge_connector.h     |  2 --
 2 files changed, 4 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
index 0e13bc87a6ac..19ae4a177ac3 100644
--- a/drivers/gpu/drm/drm_bridge_connector.c
+++ b/drivers/gpu/drm/drm_bridge_connector.c
@@ -128,19 +128,7 @@ static void drm_bridge_connector_hpd_cb(void *cb_data,
 	drm_kms_helper_hotplug_event(dev);
 }
 
-/**
- * drm_bridge_connector_enable_hpd - Enable hot-plug detection for the connector
- * @connector: The DRM bridge connector
- *
- * This function enables hot-plug detection for the given bridge connector.
- * This is typically used by display drivers in their resume handler.
- */
-void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
-{
-}
-EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
-
-static void _drm_bridge_connector_enable_hpd(struct drm_connector *connector)
+static void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
 {
 	struct drm_bridge_connector *bridge_connector =
 		to_drm_bridge_connector(connector);
@@ -151,20 +139,7 @@ static void _drm_bridge_connector_enable_hpd(struct drm_connector *connector)
 				      bridge_connector);
 }
 
-/**
- * drm_bridge_connector_disable_hpd - Disable hot-plug detection for the
- * connector
- * @connector: The DRM bridge connector
- *
- * This function disables hot-plug detection for the given bridge connector.
- * This is typically used by display drivers in their suspend handler.
- */
-void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
-{
-}
-EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
-
-static void _drm_bridge_connector_disable_hpd(struct drm_connector *connector)
+static void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
 {
 	struct drm_bridge_connector *bridge_connector =
 		to_drm_bridge_connector(connector);
@@ -313,8 +288,8 @@ static int drm_bridge_connector_get_modes(struct drm_connector *connector)
 static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = {
 	.get_modes = drm_bridge_connector_get_modes,
 	/* No need for .mode_valid(), the bridges are checked by the core. */
-	.enable_hpd = _drm_bridge_connector_enable_hpd,
-	.disable_hpd = _drm_bridge_connector_disable_hpd,
+	.enable_hpd = drm_bridge_connector_enable_hpd,
+	.disable_hpd = drm_bridge_connector_disable_hpd,
 };
 
 /* -----------------------------------------------------------------------------
diff --git a/include/drm/drm_bridge_connector.h b/include/drm/drm_bridge_connector.h
index 33f6c3bbdb4a..69630815fb09 100644
--- a/include/drm/drm_bridge_connector.h
+++ b/include/drm/drm_bridge_connector.h
@@ -10,8 +10,6 @@ struct drm_connector;
 struct drm_device;
 struct drm_encoder;
 
-void drm_bridge_connector_enable_hpd(struct drm_connector *connector);
-void drm_bridge_connector_disable_hpd(struct drm_connector *connector);
 struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
 						struct drm_encoder *encoder);
 
-- 
2.35.1


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

* [PATCH v3 7/7] drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
@ 2022-11-02 18:07   ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-11-02 18:07 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

Now as all drivers stopped calling drm_bridge_connector_enable_hpd() and
drm_bridge_connector_disable_hpd() it is safe to remove them complelely.
Rename our internal helpers to remove the underscore prefix.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/drm_bridge_connector.c | 33 ++++----------------------
 include/drm/drm_bridge_connector.h     |  2 --
 2 files changed, 4 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
index 0e13bc87a6ac..19ae4a177ac3 100644
--- a/drivers/gpu/drm/drm_bridge_connector.c
+++ b/drivers/gpu/drm/drm_bridge_connector.c
@@ -128,19 +128,7 @@ static void drm_bridge_connector_hpd_cb(void *cb_data,
 	drm_kms_helper_hotplug_event(dev);
 }
 
-/**
- * drm_bridge_connector_enable_hpd - Enable hot-plug detection for the connector
- * @connector: The DRM bridge connector
- *
- * This function enables hot-plug detection for the given bridge connector.
- * This is typically used by display drivers in their resume handler.
- */
-void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
-{
-}
-EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
-
-static void _drm_bridge_connector_enable_hpd(struct drm_connector *connector)
+static void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
 {
 	struct drm_bridge_connector *bridge_connector =
 		to_drm_bridge_connector(connector);
@@ -151,20 +139,7 @@ static void _drm_bridge_connector_enable_hpd(struct drm_connector *connector)
 				      bridge_connector);
 }
 
-/**
- * drm_bridge_connector_disable_hpd - Disable hot-plug detection for the
- * connector
- * @connector: The DRM bridge connector
- *
- * This function disables hot-plug detection for the given bridge connector.
- * This is typically used by display drivers in their suspend handler.
- */
-void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
-{
-}
-EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
-
-static void _drm_bridge_connector_disable_hpd(struct drm_connector *connector)
+static void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
 {
 	struct drm_bridge_connector *bridge_connector =
 		to_drm_bridge_connector(connector);
@@ -313,8 +288,8 @@ static int drm_bridge_connector_get_modes(struct drm_connector *connector)
 static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = {
 	.get_modes = drm_bridge_connector_get_modes,
 	/* No need for .mode_valid(), the bridges are checked by the core. */
-	.enable_hpd = _drm_bridge_connector_enable_hpd,
-	.disable_hpd = _drm_bridge_connector_disable_hpd,
+	.enable_hpd = drm_bridge_connector_enable_hpd,
+	.disable_hpd = drm_bridge_connector_disable_hpd,
 };
 
 /* -----------------------------------------------------------------------------
diff --git a/include/drm/drm_bridge_connector.h b/include/drm/drm_bridge_connector.h
index 33f6c3bbdb4a..69630815fb09 100644
--- a/include/drm/drm_bridge_connector.h
+++ b/include/drm/drm_bridge_connector.h
@@ -10,8 +10,6 @@ struct drm_connector;
 struct drm_device;
 struct drm_encoder;
 
-void drm_bridge_connector_enable_hpd(struct drm_connector *connector);
-void drm_bridge_connector_disable_hpd(struct drm_connector *connector);
 struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
 						struct drm_encoder *encoder);
 
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
  2022-11-02 18:06 ` Dmitry Baryshkov
  (?)
@ 2022-12-28 21:58   ` Dmitry Baryshkov
  -1 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-12-28 21:58 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

On 02/11/2022 20:06, Dmitry Baryshkov wrote:
>  From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
> DRM driver do a proper work of calling
> drm_bridge_connector_en/disable_hpd() in right places. Rather than
> teaching each and every driver how to properly handle
> drm_bridge_connector's HPD, make that automatic.
> 
> Add two additional drm_connector helper funcs: enable_hpd() and
> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
> is the time where the drm_bridge_connector's functions are called by the
> drivers too).

Since we are at the beginning of the development window, gracious ping 
for this patchset.

It would be nice to finally handle the bridge_connector's hpd properly. 
Calling drm_bridge_connector_enable_hpd() from 
drm_bridge_connector_init() is not a proper way to do this. It results 
in calling bridge->funcs->hpd_enable() before the rest of the pipeline 
was set up properly.

> 
> Changes since v2:
>   - Fixed a typo in the commit message of the second patch.
> 
> Changes since v1:
>   - Rebased on top of v6.1-rc1
>   - Removed the drm_bridge_connector_enable_hpd() from
>     drm_bridge_connector_init()
>   - Removed extra underscore prefix from
>     drm_bridge_connector_en/disable_hpd() helpers
> 
> Dmitry Baryshkov (7):
>    drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
>    drm/probe-helper: enable and disable HPD on connectors
>    drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
>    drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
>    drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
>    drm/omap: stop using drm_bridge_connector_en/disable_hpd()
>    drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
> 
>   drivers/gpu/drm/drm_bridge_connector.c   | 27 +++-------------
>   drivers/gpu/drm/drm_probe_helper.c       | 40 ++++++++++++++++++-----
>   drivers/gpu/drm/imx/dcss/dcss-dev.c      |  4 ---
>   drivers/gpu/drm/imx/dcss/dcss-kms.c      |  2 --
>   drivers/gpu/drm/msm/hdmi/hdmi.c          |  2 --
>   drivers/gpu/drm/omapdrm/omap_drv.c       | 41 ------------------------
>   include/drm/drm_bridge_connector.h       |  2 --
>   include/drm/drm_modeset_helper_vtables.h | 22 +++++++++++++
>   8 files changed, 59 insertions(+), 81 deletions(-)
> 

-- 
With best wishes
Dmitry


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2022-12-28 21:58   ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-12-28 21:58 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel

On 02/11/2022 20:06, Dmitry Baryshkov wrote:
>  From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
> DRM driver do a proper work of calling
> drm_bridge_connector_en/disable_hpd() in right places. Rather than
> teaching each and every driver how to properly handle
> drm_bridge_connector's HPD, make that automatic.
> 
> Add two additional drm_connector helper funcs: enable_hpd() and
> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
> is the time where the drm_bridge_connector's functions are called by the
> drivers too).

Since we are at the beginning of the development window, gracious ping 
for this patchset.

It would be nice to finally handle the bridge_connector's hpd properly. 
Calling drm_bridge_connector_enable_hpd() from 
drm_bridge_connector_init() is not a proper way to do this. It results 
in calling bridge->funcs->hpd_enable() before the rest of the pipeline 
was set up properly.

> 
> Changes since v2:
>   - Fixed a typo in the commit message of the second patch.
> 
> Changes since v1:
>   - Rebased on top of v6.1-rc1
>   - Removed the drm_bridge_connector_enable_hpd() from
>     drm_bridge_connector_init()
>   - Removed extra underscore prefix from
>     drm_bridge_connector_en/disable_hpd() helpers
> 
> Dmitry Baryshkov (7):
>    drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
>    drm/probe-helper: enable and disable HPD on connectors
>    drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
>    drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
>    drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
>    drm/omap: stop using drm_bridge_connector_en/disable_hpd()
>    drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
> 
>   drivers/gpu/drm/drm_bridge_connector.c   | 27 +++-------------
>   drivers/gpu/drm/drm_probe_helper.c       | 40 ++++++++++++++++++-----
>   drivers/gpu/drm/imx/dcss/dcss-dev.c      |  4 ---
>   drivers/gpu/drm/imx/dcss/dcss-kms.c      |  2 --
>   drivers/gpu/drm/msm/hdmi/hdmi.c          |  2 --
>   drivers/gpu/drm/omapdrm/omap_drv.c       | 41 ------------------------
>   include/drm/drm_bridge_connector.h       |  2 --
>   include/drm/drm_modeset_helper_vtables.h | 22 +++++++++++++
>   8 files changed, 59 insertions(+), 81 deletions(-)
> 

-- 
With best wishes
Dmitry


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2022-12-28 21:58   ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2022-12-28 21:58 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

On 02/11/2022 20:06, Dmitry Baryshkov wrote:
>  From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
> DRM driver do a proper work of calling
> drm_bridge_connector_en/disable_hpd() in right places. Rather than
> teaching each and every driver how to properly handle
> drm_bridge_connector's HPD, make that automatic.
> 
> Add two additional drm_connector helper funcs: enable_hpd() and
> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
> is the time where the drm_bridge_connector's functions are called by the
> drivers too).

Since we are at the beginning of the development window, gracious ping 
for this patchset.

It would be nice to finally handle the bridge_connector's hpd properly. 
Calling drm_bridge_connector_enable_hpd() from 
drm_bridge_connector_init() is not a proper way to do this. It results 
in calling bridge->funcs->hpd_enable() before the rest of the pipeline 
was set up properly.

> 
> Changes since v2:
>   - Fixed a typo in the commit message of the second patch.
> 
> Changes since v1:
>   - Rebased on top of v6.1-rc1
>   - Removed the drm_bridge_connector_enable_hpd() from
>     drm_bridge_connector_init()
>   - Removed extra underscore prefix from
>     drm_bridge_connector_en/disable_hpd() helpers
> 
> Dmitry Baryshkov (7):
>    drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
>    drm/probe-helper: enable and disable HPD on connectors
>    drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
>    drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
>    drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
>    drm/omap: stop using drm_bridge_connector_en/disable_hpd()
>    drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
> 
>   drivers/gpu/drm/drm_bridge_connector.c   | 27 +++-------------
>   drivers/gpu/drm/drm_probe_helper.c       | 40 ++++++++++++++++++-----
>   drivers/gpu/drm/imx/dcss/dcss-dev.c      |  4 ---
>   drivers/gpu/drm/imx/dcss/dcss-kms.c      |  2 --
>   drivers/gpu/drm/msm/hdmi/hdmi.c          |  2 --
>   drivers/gpu/drm/omapdrm/omap_drv.c       | 41 ------------------------
>   include/drm/drm_bridge_connector.h       |  2 --
>   include/drm/drm_modeset_helper_vtables.h | 22 +++++++++++++
>   8 files changed, 59 insertions(+), 81 deletions(-)
> 

-- 
With best wishes
Dmitry


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
  2022-12-28 21:58   ` Dmitry Baryshkov
  (?)
@ 2023-01-04  7:29     ` Tomi Valkeinen
  -1 siblings, 0 replies; 106+ messages in thread
From: Tomi Valkeinen @ 2023-01-04  7:29 UTC (permalink / raw)
  To: Dmitry Baryshkov, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Laurentiu Palcu,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

On 28/12/2022 23:58, Dmitry Baryshkov wrote:
> On 02/11/2022 20:06, Dmitry Baryshkov wrote:
>>  From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
>> DRM driver do a proper work of calling
>> drm_bridge_connector_en/disable_hpd() in right places. Rather than
>> teaching each and every driver how to properly handle
>> drm_bridge_connector's HPD, make that automatic.
>>
>> Add two additional drm_connector helper funcs: enable_hpd() and
>> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
>> is the time where the drm_bridge_connector's functions are called by the
>> drivers too).
> 
> Since we are at the beginning of the development window, gracious ping 
> for this patchset.
> 
> It would be nice to finally handle the bridge_connector's hpd properly. 
> Calling drm_bridge_connector_enable_hpd() from 
> drm_bridge_connector_init() is not a proper way to do this. It results 
> in calling bridge->funcs->hpd_enable() before the rest of the pipeline 
> was set up properly.

For the series:

Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

I've been using this series in my local branch for quite a while to fix 
the HPD issues. Works for me.

I still think the "fix" aspect should be highlighted more here, as the 
current upstream triggers a WARN for "Hot plug detection already 
enabled" (at least) on OMAP.

  Tomi


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-01-04  7:29     ` Tomi Valkeinen
  0 siblings, 0 replies; 106+ messages in thread
From: Tomi Valkeinen @ 2023-01-04  7:29 UTC (permalink / raw)
  To: Dmitry Baryshkov, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Laurentiu Palcu,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

On 28/12/2022 23:58, Dmitry Baryshkov wrote:
> On 02/11/2022 20:06, Dmitry Baryshkov wrote:
>>  From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
>> DRM driver do a proper work of calling
>> drm_bridge_connector_en/disable_hpd() in right places. Rather than
>> teaching each and every driver how to properly handle
>> drm_bridge_connector's HPD, make that automatic.
>>
>> Add two additional drm_connector helper funcs: enable_hpd() and
>> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
>> is the time where the drm_bridge_connector's functions are called by the
>> drivers too).
> 
> Since we are at the beginning of the development window, gracious ping 
> for this patchset.
> 
> It would be nice to finally handle the bridge_connector's hpd properly. 
> Calling drm_bridge_connector_enable_hpd() from 
> drm_bridge_connector_init() is not a proper way to do this. It results 
> in calling bridge->funcs->hpd_enable() before the rest of the pipeline 
> was set up properly.

For the series:

Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

I've been using this series in my local branch for quite a while to fix 
the HPD issues. Works for me.

I still think the "fix" aspect should be highlighted more here, as the 
current upstream triggers a WARN for "Hot plug detection already 
enabled" (at least) on OMAP.

  Tomi


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-01-04  7:29     ` Tomi Valkeinen
  0 siblings, 0 replies; 106+ messages in thread
From: Tomi Valkeinen @ 2023-01-04  7:29 UTC (permalink / raw)
  To: Dmitry Baryshkov, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Laurentiu Palcu,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel

On 28/12/2022 23:58, Dmitry Baryshkov wrote:
> On 02/11/2022 20:06, Dmitry Baryshkov wrote:
>>  From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
>> DRM driver do a proper work of calling
>> drm_bridge_connector_en/disable_hpd() in right places. Rather than
>> teaching each and every driver how to properly handle
>> drm_bridge_connector's HPD, make that automatic.
>>
>> Add two additional drm_connector helper funcs: enable_hpd() and
>> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
>> is the time where the drm_bridge_connector's functions are called by the
>> drivers too).
> 
> Since we are at the beginning of the development window, gracious ping 
> for this patchset.
> 
> It would be nice to finally handle the bridge_connector's hpd properly. 
> Calling drm_bridge_connector_enable_hpd() from 
> drm_bridge_connector_init() is not a proper way to do this. It results 
> in calling bridge->funcs->hpd_enable() before the rest of the pipeline 
> was set up properly.

For the series:

Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

I've been using this series in my local branch for quite a while to fix 
the HPD issues. Works for me.

I still think the "fix" aspect should be highlighted more here, as the 
current upstream triggers a WARN for "Hot plug detection already 
enabled" (at least) on OMAP.

  Tomi


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
  2023-01-04  7:29     ` Tomi Valkeinen
  (?)
@ 2023-01-04  9:05       ` Neil Armstrong
  -1 siblings, 0 replies; 106+ messages in thread
From: Neil Armstrong @ 2023-01-04  9:05 UTC (permalink / raw)
  To: Tomi Valkeinen, Dmitry Baryshkov, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Laurentiu Palcu, Lucas Stach, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel

On 04/01/2023 08:29, Tomi Valkeinen wrote:
> On 28/12/2022 23:58, Dmitry Baryshkov wrote:
>> On 02/11/2022 20:06, Dmitry Baryshkov wrote:
>>>  From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
>>> DRM driver do a proper work of calling
>>> drm_bridge_connector_en/disable_hpd() in right places. Rather than
>>> teaching each and every driver how to properly handle
>>> drm_bridge_connector's HPD, make that automatic.
>>>
>>> Add two additional drm_connector helper funcs: enable_hpd() and
>>> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
>>> is the time where the drm_bridge_connector's functions are called by the
>>> drivers too).
>>
>> Since we are at the beginning of the development window, gracious ping for this patchset.
>>
>> It would be nice to finally handle the bridge_connector's hpd properly. Calling drm_bridge_connector_enable_hpd() from drm_bridge_connector_init() is not a proper way to do this. It results in calling bridge->funcs->hpd_enable() before the rest of the pipeline was set up properly.
> 
> For the series:
> 
> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> 
> I've been using this series in my local branch for quite a while to fix the HPD issues. Works for me.
> 
> I still think the "fix" aspect should be highlighted more here, as the current upstream triggers a WARN for "Hot plug detection already enabled" (at least) on OMAP.

LGTM then !

Tomi, Dmitry, I can push the whole serie via drm-misc-next or -fixes then, as you wish.

Neil

> 
>   Tomi
> 


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-01-04  9:05       ` Neil Armstrong
  0 siblings, 0 replies; 106+ messages in thread
From: Neil Armstrong @ 2023-01-04  9:05 UTC (permalink / raw)
  To: Tomi Valkeinen, Dmitry Baryshkov, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Laurentiu Palcu, Lucas Stach, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

On 04/01/2023 08:29, Tomi Valkeinen wrote:
> On 28/12/2022 23:58, Dmitry Baryshkov wrote:
>> On 02/11/2022 20:06, Dmitry Baryshkov wrote:
>>>  From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
>>> DRM driver do a proper work of calling
>>> drm_bridge_connector_en/disable_hpd() in right places. Rather than
>>> teaching each and every driver how to properly handle
>>> drm_bridge_connector's HPD, make that automatic.
>>>
>>> Add two additional drm_connector helper funcs: enable_hpd() and
>>> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
>>> is the time where the drm_bridge_connector's functions are called by the
>>> drivers too).
>>
>> Since we are at the beginning of the development window, gracious ping for this patchset.
>>
>> It would be nice to finally handle the bridge_connector's hpd properly. Calling drm_bridge_connector_enable_hpd() from drm_bridge_connector_init() is not a proper way to do this. It results in calling bridge->funcs->hpd_enable() before the rest of the pipeline was set up properly.
> 
> For the series:
> 
> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> 
> I've been using this series in my local branch for quite a while to fix the HPD issues. Works for me.
> 
> I still think the "fix" aspect should be highlighted more here, as the current upstream triggers a WARN for "Hot plug detection already enabled" (at least) on OMAP.

LGTM then !

Tomi, Dmitry, I can push the whole serie via drm-misc-next or -fixes then, as you wish.

Neil

> 
>   Tomi
> 


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-01-04  9:05       ` Neil Armstrong
  0 siblings, 0 replies; 106+ messages in thread
From: Neil Armstrong @ 2023-01-04  9:05 UTC (permalink / raw)
  To: Tomi Valkeinen, Dmitry Baryshkov, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Laurentiu Palcu, Lucas Stach, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

On 04/01/2023 08:29, Tomi Valkeinen wrote:
> On 28/12/2022 23:58, Dmitry Baryshkov wrote:
>> On 02/11/2022 20:06, Dmitry Baryshkov wrote:
>>>  From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
>>> DRM driver do a proper work of calling
>>> drm_bridge_connector_en/disable_hpd() in right places. Rather than
>>> teaching each and every driver how to properly handle
>>> drm_bridge_connector's HPD, make that automatic.
>>>
>>> Add two additional drm_connector helper funcs: enable_hpd() and
>>> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
>>> is the time where the drm_bridge_connector's functions are called by the
>>> drivers too).
>>
>> Since we are at the beginning of the development window, gracious ping for this patchset.
>>
>> It would be nice to finally handle the bridge_connector's hpd properly. Calling drm_bridge_connector_enable_hpd() from drm_bridge_connector_init() is not a proper way to do this. It results in calling bridge->funcs->hpd_enable() before the rest of the pipeline was set up properly.
> 
> For the series:
> 
> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> 
> I've been using this series in my local branch for quite a while to fix the HPD issues. Works for me.
> 
> I still think the "fix" aspect should be highlighted more here, as the current upstream triggers a WARN for "Hot plug detection already enabled" (at least) on OMAP.

LGTM then !

Tomi, Dmitry, I can push the whole serie via drm-misc-next or -fixes then, as you wish.

Neil

> 
>   Tomi
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
  2023-01-04  9:05       ` Neil Armstrong
  (?)
@ 2023-01-05 12:31         ` Dmitry Baryshkov
  -1 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2023-01-05 12:31 UTC (permalink / raw)
  To: neil.armstrong, Tomi Valkeinen, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Laurentiu Palcu,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

On 04/01/2023 11:05, Neil Armstrong wrote:
> On 04/01/2023 08:29, Tomi Valkeinen wrote:
>> On 28/12/2022 23:58, Dmitry Baryshkov wrote:
>>> On 02/11/2022 20:06, Dmitry Baryshkov wrote:
>>>>  From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
>>>> DRM driver do a proper work of calling
>>>> drm_bridge_connector_en/disable_hpd() in right places. Rather than
>>>> teaching each and every driver how to properly handle
>>>> drm_bridge_connector's HPD, make that automatic.
>>>>
>>>> Add two additional drm_connector helper funcs: enable_hpd() and
>>>> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
>>>> is the time where the drm_bridge_connector's functions are called by 
>>>> the
>>>> drivers too).
>>>
>>> Since we are at the beginning of the development window, gracious 
>>> ping for this patchset.
>>>
>>> It would be nice to finally handle the bridge_connector's hpd 
>>> properly. Calling drm_bridge_connector_enable_hpd() from 
>>> drm_bridge_connector_init() is not a proper way to do this. It 
>>> results in calling bridge->funcs->hpd_enable() before the rest of the 
>>> pipeline was set up properly.
>>
>> For the series:
>>
>> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>>
>> I've been using this series in my local branch for quite a while to 
>> fix the HPD issues. Works for me.

Thanks!

>>
>> I still think the "fix" aspect should be highlighted more here, as the 
>> current upstream triggers a WARN for "Hot plug detection already 
>> enabled" (at least) on OMAP.
> 
> LGTM then !
> 
> Tomi, Dmitry, I can push the whole serie via drm-misc-next or -fixes 
> then, as you wish.


I'm fine either way. We have been living with the warning for some time, 
so I don't think there is any urgency to get rid of it immediately.

-- 
With best wishes
Dmitry


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-01-05 12:31         ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2023-01-05 12:31 UTC (permalink / raw)
  To: neil.armstrong, Tomi Valkeinen, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Laurentiu Palcu,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel

On 04/01/2023 11:05, Neil Armstrong wrote:
> On 04/01/2023 08:29, Tomi Valkeinen wrote:
>> On 28/12/2022 23:58, Dmitry Baryshkov wrote:
>>> On 02/11/2022 20:06, Dmitry Baryshkov wrote:
>>>>  From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
>>>> DRM driver do a proper work of calling
>>>> drm_bridge_connector_en/disable_hpd() in right places. Rather than
>>>> teaching each and every driver how to properly handle
>>>> drm_bridge_connector's HPD, make that automatic.
>>>>
>>>> Add two additional drm_connector helper funcs: enable_hpd() and
>>>> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
>>>> is the time where the drm_bridge_connector's functions are called by 
>>>> the
>>>> drivers too).
>>>
>>> Since we are at the beginning of the development window, gracious 
>>> ping for this patchset.
>>>
>>> It would be nice to finally handle the bridge_connector's hpd 
>>> properly. Calling drm_bridge_connector_enable_hpd() from 
>>> drm_bridge_connector_init() is not a proper way to do this. It 
>>> results in calling bridge->funcs->hpd_enable() before the rest of the 
>>> pipeline was set up properly.
>>
>> For the series:
>>
>> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>>
>> I've been using this series in my local branch for quite a while to 
>> fix the HPD issues. Works for me.

Thanks!

>>
>> I still think the "fix" aspect should be highlighted more here, as the 
>> current upstream triggers a WARN for "Hot plug detection already 
>> enabled" (at least) on OMAP.
> 
> LGTM then !
> 
> Tomi, Dmitry, I can push the whole serie via drm-misc-next or -fixes 
> then, as you wish.


I'm fine either way. We have been living with the warning for some time, 
so I don't think there is any urgency to get rid of it immediately.

-- 
With best wishes
Dmitry


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-01-05 12:31         ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2023-01-05 12:31 UTC (permalink / raw)
  To: neil.armstrong, Tomi Valkeinen, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Laurentiu Palcu,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

On 04/01/2023 11:05, Neil Armstrong wrote:
> On 04/01/2023 08:29, Tomi Valkeinen wrote:
>> On 28/12/2022 23:58, Dmitry Baryshkov wrote:
>>> On 02/11/2022 20:06, Dmitry Baryshkov wrote:
>>>>  From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
>>>> DRM driver do a proper work of calling
>>>> drm_bridge_connector_en/disable_hpd() in right places. Rather than
>>>> teaching each and every driver how to properly handle
>>>> drm_bridge_connector's HPD, make that automatic.
>>>>
>>>> Add two additional drm_connector helper funcs: enable_hpd() and
>>>> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
>>>> is the time where the drm_bridge_connector's functions are called by 
>>>> the
>>>> drivers too).
>>>
>>> Since we are at the beginning of the development window, gracious 
>>> ping for this patchset.
>>>
>>> It would be nice to finally handle the bridge_connector's hpd 
>>> properly. Calling drm_bridge_connector_enable_hpd() from 
>>> drm_bridge_connector_init() is not a proper way to do this. It 
>>> results in calling bridge->funcs->hpd_enable() before the rest of the 
>>> pipeline was set up properly.
>>
>> For the series:
>>
>> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>>
>> I've been using this series in my local branch for quite a while to 
>> fix the HPD issues. Works for me.

Thanks!

>>
>> I still think the "fix" aspect should be highlighted more here, as the 
>> current upstream triggers a WARN for "Hot plug detection already 
>> enabled" (at least) on OMAP.
> 
> LGTM then !
> 
> Tomi, Dmitry, I can push the whole serie via drm-misc-next or -fixes 
> then, as you wish.


I'm fine either way. We have been living with the warning for some time, 
so I don't think there is any urgency to get rid of it immediately.

-- 
With best wishes
Dmitry


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
  2023-01-05 12:31         ` Dmitry Baryshkov
  (?)
@ 2023-01-05 12:33           ` Tomi Valkeinen
  -1 siblings, 0 replies; 106+ messages in thread
From: Tomi Valkeinen @ 2023-01-05 12:33 UTC (permalink / raw)
  To: Dmitry Baryshkov, neil.armstrong, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Laurentiu Palcu, Lucas Stach, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

On 05/01/2023 14:31, Dmitry Baryshkov wrote:
> On 04/01/2023 11:05, Neil Armstrong wrote:
>> On 04/01/2023 08:29, Tomi Valkeinen wrote:
>>> On 28/12/2022 23:58, Dmitry Baryshkov wrote:
>>>> On 02/11/2022 20:06, Dmitry Baryshkov wrote:
>>>>>  From all the drivers using drm_bridge_connector only iMX/dcss and 
>>>>> OMAP
>>>>> DRM driver do a proper work of calling
>>>>> drm_bridge_connector_en/disable_hpd() in right places. Rather than
>>>>> teaching each and every driver how to properly handle
>>>>> drm_bridge_connector's HPD, make that automatic.
>>>>>
>>>>> Add two additional drm_connector helper funcs: enable_hpd() and
>>>>> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
>>>>> is the time where the drm_bridge_connector's functions are called 
>>>>> by the
>>>>> drivers too).
>>>>
>>>> Since we are at the beginning of the development window, gracious 
>>>> ping for this patchset.
>>>>
>>>> It would be nice to finally handle the bridge_connector's hpd 
>>>> properly. Calling drm_bridge_connector_enable_hpd() from 
>>>> drm_bridge_connector_init() is not a proper way to do this. It 
>>>> results in calling bridge->funcs->hpd_enable() before the rest of 
>>>> the pipeline was set up properly.
>>>
>>> For the series:
>>>
>>> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>>>
>>> I've been using this series in my local branch for quite a while to 
>>> fix the HPD issues. Works for me.
> 
> Thanks!
> 
>>>
>>> I still think the "fix" aspect should be highlighted more here, as 
>>> the current upstream triggers a WARN for "Hot plug detection already 
>>> enabled" (at least) on OMAP.
>>
>> LGTM then !
>>
>> Tomi, Dmitry, I can push the whole serie via drm-misc-next or -fixes 
>> then, as you wish.
> 
> 
> I'm fine either way. We have been living with the warning for some time, 
> so I don't think there is any urgency to get rid of it immediately.

Yes, drm-misc-next is fine for me too.

  Tomi


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-01-05 12:33           ` Tomi Valkeinen
  0 siblings, 0 replies; 106+ messages in thread
From: Tomi Valkeinen @ 2023-01-05 12:33 UTC (permalink / raw)
  To: Dmitry Baryshkov, neil.armstrong, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Laurentiu Palcu, Lucas Stach, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

On 05/01/2023 14:31, Dmitry Baryshkov wrote:
> On 04/01/2023 11:05, Neil Armstrong wrote:
>> On 04/01/2023 08:29, Tomi Valkeinen wrote:
>>> On 28/12/2022 23:58, Dmitry Baryshkov wrote:
>>>> On 02/11/2022 20:06, Dmitry Baryshkov wrote:
>>>>>  From all the drivers using drm_bridge_connector only iMX/dcss and 
>>>>> OMAP
>>>>> DRM driver do a proper work of calling
>>>>> drm_bridge_connector_en/disable_hpd() in right places. Rather than
>>>>> teaching each and every driver how to properly handle
>>>>> drm_bridge_connector's HPD, make that automatic.
>>>>>
>>>>> Add two additional drm_connector helper funcs: enable_hpd() and
>>>>> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
>>>>> is the time where the drm_bridge_connector's functions are called 
>>>>> by the
>>>>> drivers too).
>>>>
>>>> Since we are at the beginning of the development window, gracious 
>>>> ping for this patchset.
>>>>
>>>> It would be nice to finally handle the bridge_connector's hpd 
>>>> properly. Calling drm_bridge_connector_enable_hpd() from 
>>>> drm_bridge_connector_init() is not a proper way to do this. It 
>>>> results in calling bridge->funcs->hpd_enable() before the rest of 
>>>> the pipeline was set up properly.
>>>
>>> For the series:
>>>
>>> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>>>
>>> I've been using this series in my local branch for quite a while to 
>>> fix the HPD issues. Works for me.
> 
> Thanks!
> 
>>>
>>> I still think the "fix" aspect should be highlighted more here, as 
>>> the current upstream triggers a WARN for "Hot plug detection already 
>>> enabled" (at least) on OMAP.
>>
>> LGTM then !
>>
>> Tomi, Dmitry, I can push the whole serie via drm-misc-next or -fixes 
>> then, as you wish.
> 
> 
> I'm fine either way. We have been living with the warning for some time, 
> so I don't think there is any urgency to get rid of it immediately.

Yes, drm-misc-next is fine for me too.

  Tomi


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-01-05 12:33           ` Tomi Valkeinen
  0 siblings, 0 replies; 106+ messages in thread
From: Tomi Valkeinen @ 2023-01-05 12:33 UTC (permalink / raw)
  To: Dmitry Baryshkov, neil.armstrong, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Laurentiu Palcu, Lucas Stach, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel

On 05/01/2023 14:31, Dmitry Baryshkov wrote:
> On 04/01/2023 11:05, Neil Armstrong wrote:
>> On 04/01/2023 08:29, Tomi Valkeinen wrote:
>>> On 28/12/2022 23:58, Dmitry Baryshkov wrote:
>>>> On 02/11/2022 20:06, Dmitry Baryshkov wrote:
>>>>>  From all the drivers using drm_bridge_connector only iMX/dcss and 
>>>>> OMAP
>>>>> DRM driver do a proper work of calling
>>>>> drm_bridge_connector_en/disable_hpd() in right places. Rather than
>>>>> teaching each and every driver how to properly handle
>>>>> drm_bridge_connector's HPD, make that automatic.
>>>>>
>>>>> Add two additional drm_connector helper funcs: enable_hpd() and
>>>>> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
>>>>> is the time where the drm_bridge_connector's functions are called 
>>>>> by the
>>>>> drivers too).
>>>>
>>>> Since we are at the beginning of the development window, gracious 
>>>> ping for this patchset.
>>>>
>>>> It would be nice to finally handle the bridge_connector's hpd 
>>>> properly. Calling drm_bridge_connector_enable_hpd() from 
>>>> drm_bridge_connector_init() is not a proper way to do this. It 
>>>> results in calling bridge->funcs->hpd_enable() before the rest of 
>>>> the pipeline was set up properly.
>>>
>>> For the series:
>>>
>>> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>>>
>>> I've been using this series in my local branch for quite a while to 
>>> fix the HPD issues. Works for me.
> 
> Thanks!
> 
>>>
>>> I still think the "fix" aspect should be highlighted more here, as 
>>> the current upstream triggers a WARN for "Hot plug detection already 
>>> enabled" (at least) on OMAP.
>>
>> LGTM then !
>>
>> Tomi, Dmitry, I can push the whole serie via drm-misc-next or -fixes 
>> then, as you wish.
> 
> 
> I'm fine either way. We have been living with the warning for some time, 
> so I don't think there is any urgency to get rid of it immediately.

Yes, drm-misc-next is fine for me too.

  Tomi


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

* Re: [PATCH v3 4/7] drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
  2022-11-02 18:07   ` Dmitry Baryshkov
  (?)
@ 2023-01-05 14:09     ` Neil Armstrong
  -1 siblings, 0 replies; 106+ messages in thread
From: Neil Armstrong @ 2023-01-05 14:09 UTC (permalink / raw)
  To: Dmitry Baryshkov, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Laurentiu Palcu,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar, Tomi Valkeinen
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

On 02/11/2022 19:07, Dmitry Baryshkov wrote:
> The functionality of drm_bridge_connector_enable_hpd() and
> drm_bridge_connector_disable_hpd() is provided automatically by the
> drm_kms_poll helpers. Stop calling these functions manually.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>   drivers/gpu/drm/imx/dcss/dcss-dev.c | 4 ----
>   drivers/gpu/drm/imx/dcss/dcss-kms.c | 2 --
>   2 files changed, 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/imx/dcss/dcss-dev.c b/drivers/gpu/drm/imx/dcss/dcss-dev.c
> index 3f5750cc2673..0d8e44f20ec4 100644
> --- a/drivers/gpu/drm/imx/dcss/dcss-dev.c
> +++ b/drivers/gpu/drm/imx/dcss/dcss-dev.c
> @@ -257,8 +257,6 @@ int dcss_dev_suspend(struct device *dev)
>   	struct dcss_kms_dev *kms = container_of(ddev, struct dcss_kms_dev, base);
>   	int ret;
>   
> -	drm_bridge_connector_disable_hpd(kms->connector);
> -
>   	drm_mode_config_helper_suspend(ddev);
>   
>   	if (pm_runtime_suspended(dev))
> @@ -292,8 +290,6 @@ int dcss_dev_resume(struct device *dev)
>   
>   	drm_mode_config_helper_resume(ddev);
>   
> -	drm_bridge_connector_enable_hpd(kms->connector);
> -
>   	return 0;
>   }
>   #endif /* CONFIG_PM_SLEEP */
> diff --git a/drivers/gpu/drm/imx/dcss/dcss-kms.c b/drivers/gpu/drm/imx/dcss/dcss-kms.c
> index b4f82ebca532..16ef8aa6da37 100644
> --- a/drivers/gpu/drm/imx/dcss/dcss-kms.c
> +++ b/drivers/gpu/drm/imx/dcss/dcss-kms.c
> @@ -151,7 +151,6 @@ struct dcss_kms_dev *dcss_kms_attach(struct dcss_dev *dcss)
>   	return kms;
>   
>   cleanup_crtc:
> -	drm_bridge_connector_disable_hpd(kms->connector);
>   	drm_kms_helper_poll_fini(drm);
>   	dcss_crtc_deinit(crtc, drm);
>   
> @@ -167,7 +166,6 @@ void dcss_kms_detach(struct dcss_kms_dev *kms)
>   	struct drm_device *drm = &kms->base;
>   
>   	drm_dev_unregister(drm);
> -	drm_bridge_connector_disable_hpd(kms->connector);
>   	drm_kms_helper_poll_fini(drm);
>   	drm_atomic_helper_shutdown(drm);
>   	drm_crtc_vblank_off(&kms->crtc.base);


I get:
/drivers/gpu/drm/imx/dcss/dcss-dev.c: In function ‘dcss_dev_suspend’:
/drivers/gpu/drm/imx/dcss/dcss-dev.c:256:23: warning: unused variable ‘kms’ [-Wunused-variable]
   256 |  struct dcss_kms_dev *kms = container_of(ddev, struct dcss_kms_dev, base);
       |                       ^~~
/drivers/gpu/drm/imx/dcss/dcss-dev.c: In function ‘dcss_dev_resume’:
/drivers/gpu/drm/imx/dcss/dcss-dev.c:277:23: warning: unused variable ‘kms’ [-Wunused-variable]
   277 |  struct dcss_kms_dev *kms = container_of(ddev, struct dcss_kms_dev, base);
       |                       ^~~

I'll fix while applying,

Neil

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

* Re: [PATCH v3 4/7] drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
@ 2023-01-05 14:09     ` Neil Armstrong
  0 siblings, 0 replies; 106+ messages in thread
From: Neil Armstrong @ 2023-01-05 14:09 UTC (permalink / raw)
  To: Dmitry Baryshkov, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Laurentiu Palcu,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar, Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel

On 02/11/2022 19:07, Dmitry Baryshkov wrote:
> The functionality of drm_bridge_connector_enable_hpd() and
> drm_bridge_connector_disable_hpd() is provided automatically by the
> drm_kms_poll helpers. Stop calling these functions manually.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>   drivers/gpu/drm/imx/dcss/dcss-dev.c | 4 ----
>   drivers/gpu/drm/imx/dcss/dcss-kms.c | 2 --
>   2 files changed, 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/imx/dcss/dcss-dev.c b/drivers/gpu/drm/imx/dcss/dcss-dev.c
> index 3f5750cc2673..0d8e44f20ec4 100644
> --- a/drivers/gpu/drm/imx/dcss/dcss-dev.c
> +++ b/drivers/gpu/drm/imx/dcss/dcss-dev.c
> @@ -257,8 +257,6 @@ int dcss_dev_suspend(struct device *dev)
>   	struct dcss_kms_dev *kms = container_of(ddev, struct dcss_kms_dev, base);
>   	int ret;
>   
> -	drm_bridge_connector_disable_hpd(kms->connector);
> -
>   	drm_mode_config_helper_suspend(ddev);
>   
>   	if (pm_runtime_suspended(dev))
> @@ -292,8 +290,6 @@ int dcss_dev_resume(struct device *dev)
>   
>   	drm_mode_config_helper_resume(ddev);
>   
> -	drm_bridge_connector_enable_hpd(kms->connector);
> -
>   	return 0;
>   }
>   #endif /* CONFIG_PM_SLEEP */
> diff --git a/drivers/gpu/drm/imx/dcss/dcss-kms.c b/drivers/gpu/drm/imx/dcss/dcss-kms.c
> index b4f82ebca532..16ef8aa6da37 100644
> --- a/drivers/gpu/drm/imx/dcss/dcss-kms.c
> +++ b/drivers/gpu/drm/imx/dcss/dcss-kms.c
> @@ -151,7 +151,6 @@ struct dcss_kms_dev *dcss_kms_attach(struct dcss_dev *dcss)
>   	return kms;
>   
>   cleanup_crtc:
> -	drm_bridge_connector_disable_hpd(kms->connector);
>   	drm_kms_helper_poll_fini(drm);
>   	dcss_crtc_deinit(crtc, drm);
>   
> @@ -167,7 +166,6 @@ void dcss_kms_detach(struct dcss_kms_dev *kms)
>   	struct drm_device *drm = &kms->base;
>   
>   	drm_dev_unregister(drm);
> -	drm_bridge_connector_disable_hpd(kms->connector);
>   	drm_kms_helper_poll_fini(drm);
>   	drm_atomic_helper_shutdown(drm);
>   	drm_crtc_vblank_off(&kms->crtc.base);


I get:
/drivers/gpu/drm/imx/dcss/dcss-dev.c: In function ‘dcss_dev_suspend’:
/drivers/gpu/drm/imx/dcss/dcss-dev.c:256:23: warning: unused variable ‘kms’ [-Wunused-variable]
   256 |  struct dcss_kms_dev *kms = container_of(ddev, struct dcss_kms_dev, base);
       |                       ^~~
/drivers/gpu/drm/imx/dcss/dcss-dev.c: In function ‘dcss_dev_resume’:
/drivers/gpu/drm/imx/dcss/dcss-dev.c:277:23: warning: unused variable ‘kms’ [-Wunused-variable]
   277 |  struct dcss_kms_dev *kms = container_of(ddev, struct dcss_kms_dev, base);
       |                       ^~~

I'll fix while applying,

Neil

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

* Re: [PATCH v3 4/7] drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
@ 2023-01-05 14:09     ` Neil Armstrong
  0 siblings, 0 replies; 106+ messages in thread
From: Neil Armstrong @ 2023-01-05 14:09 UTC (permalink / raw)
  To: Dmitry Baryshkov, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Laurentiu Palcu,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar, Tomi Valkeinen
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

On 02/11/2022 19:07, Dmitry Baryshkov wrote:
> The functionality of drm_bridge_connector_enable_hpd() and
> drm_bridge_connector_disable_hpd() is provided automatically by the
> drm_kms_poll helpers. Stop calling these functions manually.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>   drivers/gpu/drm/imx/dcss/dcss-dev.c | 4 ----
>   drivers/gpu/drm/imx/dcss/dcss-kms.c | 2 --
>   2 files changed, 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/imx/dcss/dcss-dev.c b/drivers/gpu/drm/imx/dcss/dcss-dev.c
> index 3f5750cc2673..0d8e44f20ec4 100644
> --- a/drivers/gpu/drm/imx/dcss/dcss-dev.c
> +++ b/drivers/gpu/drm/imx/dcss/dcss-dev.c
> @@ -257,8 +257,6 @@ int dcss_dev_suspend(struct device *dev)
>   	struct dcss_kms_dev *kms = container_of(ddev, struct dcss_kms_dev, base);
>   	int ret;
>   
> -	drm_bridge_connector_disable_hpd(kms->connector);
> -
>   	drm_mode_config_helper_suspend(ddev);
>   
>   	if (pm_runtime_suspended(dev))
> @@ -292,8 +290,6 @@ int dcss_dev_resume(struct device *dev)
>   
>   	drm_mode_config_helper_resume(ddev);
>   
> -	drm_bridge_connector_enable_hpd(kms->connector);
> -
>   	return 0;
>   }
>   #endif /* CONFIG_PM_SLEEP */
> diff --git a/drivers/gpu/drm/imx/dcss/dcss-kms.c b/drivers/gpu/drm/imx/dcss/dcss-kms.c
> index b4f82ebca532..16ef8aa6da37 100644
> --- a/drivers/gpu/drm/imx/dcss/dcss-kms.c
> +++ b/drivers/gpu/drm/imx/dcss/dcss-kms.c
> @@ -151,7 +151,6 @@ struct dcss_kms_dev *dcss_kms_attach(struct dcss_dev *dcss)
>   	return kms;
>   
>   cleanup_crtc:
> -	drm_bridge_connector_disable_hpd(kms->connector);
>   	drm_kms_helper_poll_fini(drm);
>   	dcss_crtc_deinit(crtc, drm);
>   
> @@ -167,7 +166,6 @@ void dcss_kms_detach(struct dcss_kms_dev *kms)
>   	struct drm_device *drm = &kms->base;
>   
>   	drm_dev_unregister(drm);
> -	drm_bridge_connector_disable_hpd(kms->connector);
>   	drm_kms_helper_poll_fini(drm);
>   	drm_atomic_helper_shutdown(drm);
>   	drm_crtc_vblank_off(&kms->crtc.base);


I get:
/drivers/gpu/drm/imx/dcss/dcss-dev.c: In function ‘dcss_dev_suspend’:
/drivers/gpu/drm/imx/dcss/dcss-dev.c:256:23: warning: unused variable ‘kms’ [-Wunused-variable]
   256 |  struct dcss_kms_dev *kms = container_of(ddev, struct dcss_kms_dev, base);
       |                       ^~~
/drivers/gpu/drm/imx/dcss/dcss-dev.c: In function ‘dcss_dev_resume’:
/drivers/gpu/drm/imx/dcss/dcss-dev.c:277:23: warning: unused variable ‘kms’ [-Wunused-variable]
   277 |  struct dcss_kms_dev *kms = container_of(ddev, struct dcss_kms_dev, base);
       |                       ^~~

I'll fix while applying,

Neil

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
  2022-11-02 18:06 ` Dmitry Baryshkov
  (?)
@ 2023-01-05 14:12   ` Neil Armstrong
  -1 siblings, 0 replies; 106+ messages in thread
From: Neil Armstrong @ 2023-01-05 14:12 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen, Dmitry Baryshkov
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

Hi,

On Wed, 02 Nov 2022 21:06:58 +0300, Dmitry Baryshkov wrote:
> From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
> DRM driver do a proper work of calling
> drm_bridge_connector_en/disable_hpd() in right places. Rather than
> teaching each and every driver how to properly handle
> drm_bridge_connector's HPD, make that automatic.
> 
> Add two additional drm_connector helper funcs: enable_hpd() and
> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
> is the time where the drm_bridge_connector's functions are called by the
> drivers too).
> 
> [...]

Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next)

[1/7] drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=78b991ccfa64a438e2d8c2997d22d55621ab277d
[2/7] drm/probe-helper: enable and disable HPD on connectors
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=c8268795c9a9cc7be50f78d4502fad83a2a4f8df
[3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=92d755d8f13b6791c72d4e980c09f054d8175c94
[4/7] drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=60c376e4549b6844af94cf319960ef48080230a8
[5/7] drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=9e954403bc9cc024cf052e9429c0e6db86ffe0f7
[6/7] drm/omap: stop using drm_bridge_connector_en/disable_hpd()
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=c4f5538fa65dd093b71859c4792afd4e13fae5f1
[7/7] drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=4c00ac500d0edd1a6730c4e8293834a694c1b304

-- 
Neil

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-01-05 14:12   ` Neil Armstrong
  0 siblings, 0 replies; 106+ messages in thread
From: Neil Armstrong @ 2023-01-05 14:12 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen, Dmitry Baryshkov
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel

Hi,

On Wed, 02 Nov 2022 21:06:58 +0300, Dmitry Baryshkov wrote:
> From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
> DRM driver do a proper work of calling
> drm_bridge_connector_en/disable_hpd() in right places. Rather than
> teaching each and every driver how to properly handle
> drm_bridge_connector's HPD, make that automatic.
> 
> Add two additional drm_connector helper funcs: enable_hpd() and
> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
> is the time where the drm_bridge_connector's functions are called by the
> drivers too).
> 
> [...]

Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next)

[1/7] drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=78b991ccfa64a438e2d8c2997d22d55621ab277d
[2/7] drm/probe-helper: enable and disable HPD on connectors
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=c8268795c9a9cc7be50f78d4502fad83a2a4f8df
[3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=92d755d8f13b6791c72d4e980c09f054d8175c94
[4/7] drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=60c376e4549b6844af94cf319960ef48080230a8
[5/7] drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=9e954403bc9cc024cf052e9429c0e6db86ffe0f7
[6/7] drm/omap: stop using drm_bridge_connector_en/disable_hpd()
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=c4f5538fa65dd093b71859c4792afd4e13fae5f1
[7/7] drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=4c00ac500d0edd1a6730c4e8293834a694c1b304

-- 
Neil

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-01-05 14:12   ` Neil Armstrong
  0 siblings, 0 replies; 106+ messages in thread
From: Neil Armstrong @ 2023-01-05 14:12 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen, Dmitry Baryshkov
  Cc: dri-devel, linux-arm-kernel, linux-arm-msm, freedreno

Hi,

On Wed, 02 Nov 2022 21:06:58 +0300, Dmitry Baryshkov wrote:
> From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
> DRM driver do a proper work of calling
> drm_bridge_connector_en/disable_hpd() in right places. Rather than
> teaching each and every driver how to properly handle
> drm_bridge_connector's HPD, make that automatic.
> 
> Add two additional drm_connector helper funcs: enable_hpd() and
> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
> is the time where the drm_bridge_connector's functions are called by the
> drivers too).
> 
> [...]

Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next)

[1/7] drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=78b991ccfa64a438e2d8c2997d22d55621ab277d
[2/7] drm/probe-helper: enable and disable HPD on connectors
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=c8268795c9a9cc7be50f78d4502fad83a2a4f8df
[3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=92d755d8f13b6791c72d4e980c09f054d8175c94
[4/7] drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=60c376e4549b6844af94cf319960ef48080230a8
[5/7] drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=9e954403bc9cc024cf052e9429c0e6db86ffe0f7
[6/7] drm/omap: stop using drm_bridge_connector_en/disable_hpd()
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=c4f5538fa65dd093b71859c4792afd4e13fae5f1
[7/7] drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=4c00ac500d0edd1a6730c4e8293834a694c1b304

-- 
Neil

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
  2022-11-02 18:06 ` Dmitry Baryshkov
  (?)
@ 2023-01-09 16:21   ` Laurentiu Palcu
  -1 siblings, 0 replies; 106+ messages in thread
From: Laurentiu Palcu @ 2023-01-09 16:21 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Sean Paul, dri-devel, Thomas Zimmermann, Tomi Valkeinen,
	Shawn Guo, Sascha Hauer, Abhinav Kumar, NXP Linux Team,
	linux-arm-msm, freedreno, Pengutronix Kernel Team,
	linux-arm-kernel

Hi Dmitry,

It looks like there are some issues with this patchset... :/ I just
fetched the drm-tip and, with these patches included, the "Hot plug
detection already enabled" warning is back for i.MX DCSS.

After a short investigation, it seems that we end up calling
drm_bridge_hpd_enable() from both drm_kms_helper_poll_init() and
drm_fbdev_generic_setup(), hence the warning.

There are drivers using the drm_bridge_connector API that also call
drm_kms_helper_poll_init() followed by drm_fbdev_generic_setup(). So,
they might experience the same behavior, unless I'm missing something...
:/

Also, even if drm_fbdev_generic_setup() is not called in the driver
initialization, the warning will still appear the first time the
GETCONNECTOR ioctl is called, because that'll call
drm_helper_probe_single_connector_modes() helper which will eventually
call drm_bridge_hpd_enable().

Any idea?

Cheers,
Laurentiu

On Wed, Nov 02, 2022 at 09:06:58PM +0300, Dmitry Baryshkov wrote:
> From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
> DRM driver do a proper work of calling
> drm_bridge_connector_en/disable_hpd() in right places. Rather than
> teaching each and every driver how to properly handle
> drm_bridge_connector's HPD, make that automatic.
> 
> Add two additional drm_connector helper funcs: enable_hpd() and
> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
> is the time where the drm_bridge_connector's functions are called by the
> drivers too).
> 
> Changes since v2:
>  - Fixed a typo in the commit message of the second patch.
> 
> Changes since v1:
>  - Rebased on top of v6.1-rc1
>  - Removed the drm_bridge_connector_enable_hpd() from
>    drm_bridge_connector_init()
>  - Removed extra underscore prefix from
>    drm_bridge_connector_en/disable_hpd() helpers
> 
> Dmitry Baryshkov (7):
>   drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
>   drm/probe-helper: enable and disable HPD on connectors
>   drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
>   drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
>   drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
>   drm/omap: stop using drm_bridge_connector_en/disable_hpd()
>   drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
> 
>  drivers/gpu/drm/drm_bridge_connector.c   | 27 +++-------------
>  drivers/gpu/drm/drm_probe_helper.c       | 40 ++++++++++++++++++-----
>  drivers/gpu/drm/imx/dcss/dcss-dev.c      |  4 ---
>  drivers/gpu/drm/imx/dcss/dcss-kms.c      |  2 --
>  drivers/gpu/drm/msm/hdmi/hdmi.c          |  2 --
>  drivers/gpu/drm/omapdrm/omap_drv.c       | 41 ------------------------
>  include/drm/drm_bridge_connector.h       |  2 --
>  include/drm/drm_modeset_helper_vtables.h | 22 +++++++++++++
>  8 files changed, 59 insertions(+), 81 deletions(-)
> 
> -- 
> 2.35.1
> 

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-01-09 16:21   ` Laurentiu Palcu
  0 siblings, 0 replies; 106+ messages in thread
From: Laurentiu Palcu @ 2023-01-09 16:21 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Lucas Stach, Philipp Zabel,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar,
	Tomi Valkeinen, dri-devel, linux-arm-kernel, linux-arm-msm,
	freedreno

Hi Dmitry,

It looks like there are some issues with this patchset... :/ I just
fetched the drm-tip and, with these patches included, the "Hot plug
detection already enabled" warning is back for i.MX DCSS.

After a short investigation, it seems that we end up calling
drm_bridge_hpd_enable() from both drm_kms_helper_poll_init() and
drm_fbdev_generic_setup(), hence the warning.

There are drivers using the drm_bridge_connector API that also call
drm_kms_helper_poll_init() followed by drm_fbdev_generic_setup(). So,
they might experience the same behavior, unless I'm missing something...
:/

Also, even if drm_fbdev_generic_setup() is not called in the driver
initialization, the warning will still appear the first time the
GETCONNECTOR ioctl is called, because that'll call
drm_helper_probe_single_connector_modes() helper which will eventually
call drm_bridge_hpd_enable().

Any idea?

Cheers,
Laurentiu

On Wed, Nov 02, 2022 at 09:06:58PM +0300, Dmitry Baryshkov wrote:
> From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
> DRM driver do a proper work of calling
> drm_bridge_connector_en/disable_hpd() in right places. Rather than
> teaching each and every driver how to properly handle
> drm_bridge_connector's HPD, make that automatic.
> 
> Add two additional drm_connector helper funcs: enable_hpd() and
> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
> is the time where the drm_bridge_connector's functions are called by the
> drivers too).
> 
> Changes since v2:
>  - Fixed a typo in the commit message of the second patch.
> 
> Changes since v1:
>  - Rebased on top of v6.1-rc1
>  - Removed the drm_bridge_connector_enable_hpd() from
>    drm_bridge_connector_init()
>  - Removed extra underscore prefix from
>    drm_bridge_connector_en/disable_hpd() helpers
> 
> Dmitry Baryshkov (7):
>   drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
>   drm/probe-helper: enable and disable HPD on connectors
>   drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
>   drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
>   drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
>   drm/omap: stop using drm_bridge_connector_en/disable_hpd()
>   drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
> 
>  drivers/gpu/drm/drm_bridge_connector.c   | 27 +++-------------
>  drivers/gpu/drm/drm_probe_helper.c       | 40 ++++++++++++++++++-----
>  drivers/gpu/drm/imx/dcss/dcss-dev.c      |  4 ---
>  drivers/gpu/drm/imx/dcss/dcss-kms.c      |  2 --
>  drivers/gpu/drm/msm/hdmi/hdmi.c          |  2 --
>  drivers/gpu/drm/omapdrm/omap_drv.c       | 41 ------------------------
>  include/drm/drm_bridge_connector.h       |  2 --
>  include/drm/drm_modeset_helper_vtables.h | 22 +++++++++++++
>  8 files changed, 59 insertions(+), 81 deletions(-)
> 
> -- 
> 2.35.1
> 

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-01-09 16:21   ` Laurentiu Palcu
  0 siblings, 0 replies; 106+ messages in thread
From: Laurentiu Palcu @ 2023-01-09 16:21 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Lucas Stach, Philipp Zabel,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar,
	Tomi Valkeinen, dri-devel, linux-arm-kernel, linux-arm-msm,
	freedreno

Hi Dmitry,

It looks like there are some issues with this patchset... :/ I just
fetched the drm-tip and, with these patches included, the "Hot plug
detection already enabled" warning is back for i.MX DCSS.

After a short investigation, it seems that we end up calling
drm_bridge_hpd_enable() from both drm_kms_helper_poll_init() and
drm_fbdev_generic_setup(), hence the warning.

There are drivers using the drm_bridge_connector API that also call
drm_kms_helper_poll_init() followed by drm_fbdev_generic_setup(). So,
they might experience the same behavior, unless I'm missing something...
:/

Also, even if drm_fbdev_generic_setup() is not called in the driver
initialization, the warning will still appear the first time the
GETCONNECTOR ioctl is called, because that'll call
drm_helper_probe_single_connector_modes() helper which will eventually
call drm_bridge_hpd_enable().

Any idea?

Cheers,
Laurentiu

On Wed, Nov 02, 2022 at 09:06:58PM +0300, Dmitry Baryshkov wrote:
> From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
> DRM driver do a proper work of calling
> drm_bridge_connector_en/disable_hpd() in right places. Rather than
> teaching each and every driver how to properly handle
> drm_bridge_connector's HPD, make that automatic.
> 
> Add two additional drm_connector helper funcs: enable_hpd() and
> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
> is the time where the drm_bridge_connector's functions are called by the
> drivers too).
> 
> Changes since v2:
>  - Fixed a typo in the commit message of the second patch.
> 
> Changes since v1:
>  - Rebased on top of v6.1-rc1
>  - Removed the drm_bridge_connector_enable_hpd() from
>    drm_bridge_connector_init()
>  - Removed extra underscore prefix from
>    drm_bridge_connector_en/disable_hpd() helpers
> 
> Dmitry Baryshkov (7):
>   drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
>   drm/probe-helper: enable and disable HPD on connectors
>   drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
>   drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
>   drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
>   drm/omap: stop using drm_bridge_connector_en/disable_hpd()
>   drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
> 
>  drivers/gpu/drm/drm_bridge_connector.c   | 27 +++-------------
>  drivers/gpu/drm/drm_probe_helper.c       | 40 ++++++++++++++++++-----
>  drivers/gpu/drm/imx/dcss/dcss-dev.c      |  4 ---
>  drivers/gpu/drm/imx/dcss/dcss-kms.c      |  2 --
>  drivers/gpu/drm/msm/hdmi/hdmi.c          |  2 --
>  drivers/gpu/drm/omapdrm/omap_drv.c       | 41 ------------------------
>  include/drm/drm_bridge_connector.h       |  2 --
>  include/drm/drm_modeset_helper_vtables.h | 22 +++++++++++++
>  8 files changed, 59 insertions(+), 81 deletions(-)
> 
> -- 
> 2.35.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
  2023-01-09 16:21   ` Laurentiu Palcu
  (?)
@ 2023-01-09 20:26     ` Dmitry Baryshkov
  -1 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2023-01-09 20:26 UTC (permalink / raw)
  To: Laurentiu Palcu
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Lucas Stach, Philipp Zabel,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar,
	Tomi Valkeinen, dri-devel, linux-arm-kernel, linux-arm-msm,
	freedreno

Hi,

On 09/01/2023 18:21, Laurentiu Palcu wrote:
> Hi Dmitry,
> 
> It looks like there are some issues with this patchset... :/ I just
> fetched the drm-tip and, with these patches included, the "Hot plug
> detection already enabled" warning is back for i.MX DCSS.

Could you please provide a backtrace?

> 
> After a short investigation, it seems that we end up calling
> drm_bridge_hpd_enable() from both drm_kms_helper_poll_init() and
> drm_fbdev_generic_setup(), hence the warning.
> 
> There are drivers using the drm_bridge_connector API that also call
> drm_kms_helper_poll_init() followed by drm_fbdev_generic_setup(). So,
> they might experience the same behavior, unless I'm missing something...
> :/
> 
> Also, even if drm_fbdev_generic_setup() is not called in the driver
> initialization, the warning will still appear the first time the
> GETCONNECTOR ioctl is called, because that'll call
> drm_helper_probe_single_connector_modes() helper which will eventually
> call drm_bridge_hpd_enable().
> 
> Any idea?
> 
> Cheers,
> Laurentiu
> 
> On Wed, Nov 02, 2022 at 09:06:58PM +0300, Dmitry Baryshkov wrote:
>>  From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
>> DRM driver do a proper work of calling
>> drm_bridge_connector_en/disable_hpd() in right places. Rather than
>> teaching each and every driver how to properly handle
>> drm_bridge_connector's HPD, make that automatic.
>>
>> Add two additional drm_connector helper funcs: enable_hpd() and
>> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
>> is the time where the drm_bridge_connector's functions are called by the
>> drivers too).
>>
>> Changes since v2:
>>   - Fixed a typo in the commit message of the second patch.
>>
>> Changes since v1:
>>   - Rebased on top of v6.1-rc1
>>   - Removed the drm_bridge_connector_enable_hpd() from
>>     drm_bridge_connector_init()
>>   - Removed extra underscore prefix from
>>     drm_bridge_connector_en/disable_hpd() helpers
>>
>> Dmitry Baryshkov (7):
>>    drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
>>    drm/probe-helper: enable and disable HPD on connectors
>>    drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
>>    drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
>>    drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
>>    drm/omap: stop using drm_bridge_connector_en/disable_hpd()
>>    drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
>>
>>   drivers/gpu/drm/drm_bridge_connector.c   | 27 +++-------------
>>   drivers/gpu/drm/drm_probe_helper.c       | 40 ++++++++++++++++++-----
>>   drivers/gpu/drm/imx/dcss/dcss-dev.c      |  4 ---
>>   drivers/gpu/drm/imx/dcss/dcss-kms.c      |  2 --
>>   drivers/gpu/drm/msm/hdmi/hdmi.c          |  2 --
>>   drivers/gpu/drm/omapdrm/omap_drv.c       | 41 ------------------------
>>   include/drm/drm_bridge_connector.h       |  2 --
>>   include/drm/drm_modeset_helper_vtables.h | 22 +++++++++++++
>>   8 files changed, 59 insertions(+), 81 deletions(-)
>>
>> -- 
>> 2.35.1
>>

-- 
With best wishes
Dmitry


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-01-09 20:26     ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2023-01-09 20:26 UTC (permalink / raw)
  To: Laurentiu Palcu
  Cc: Sean Paul, dri-devel, Thomas Zimmermann, Tomi Valkeinen,
	Shawn Guo, Sascha Hauer, Abhinav Kumar, NXP Linux Team,
	linux-arm-msm, freedreno, Pengutronix Kernel Team,
	linux-arm-kernel

Hi,

On 09/01/2023 18:21, Laurentiu Palcu wrote:
> Hi Dmitry,
> 
> It looks like there are some issues with this patchset... :/ I just
> fetched the drm-tip and, with these patches included, the "Hot plug
> detection already enabled" warning is back for i.MX DCSS.

Could you please provide a backtrace?

> 
> After a short investigation, it seems that we end up calling
> drm_bridge_hpd_enable() from both drm_kms_helper_poll_init() and
> drm_fbdev_generic_setup(), hence the warning.
> 
> There are drivers using the drm_bridge_connector API that also call
> drm_kms_helper_poll_init() followed by drm_fbdev_generic_setup(). So,
> they might experience the same behavior, unless I'm missing something...
> :/
> 
> Also, even if drm_fbdev_generic_setup() is not called in the driver
> initialization, the warning will still appear the first time the
> GETCONNECTOR ioctl is called, because that'll call
> drm_helper_probe_single_connector_modes() helper which will eventually
> call drm_bridge_hpd_enable().
> 
> Any idea?
> 
> Cheers,
> Laurentiu
> 
> On Wed, Nov 02, 2022 at 09:06:58PM +0300, Dmitry Baryshkov wrote:
>>  From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
>> DRM driver do a proper work of calling
>> drm_bridge_connector_en/disable_hpd() in right places. Rather than
>> teaching each and every driver how to properly handle
>> drm_bridge_connector's HPD, make that automatic.
>>
>> Add two additional drm_connector helper funcs: enable_hpd() and
>> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
>> is the time where the drm_bridge_connector's functions are called by the
>> drivers too).
>>
>> Changes since v2:
>>   - Fixed a typo in the commit message of the second patch.
>>
>> Changes since v1:
>>   - Rebased on top of v6.1-rc1
>>   - Removed the drm_bridge_connector_enable_hpd() from
>>     drm_bridge_connector_init()
>>   - Removed extra underscore prefix from
>>     drm_bridge_connector_en/disable_hpd() helpers
>>
>> Dmitry Baryshkov (7):
>>    drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
>>    drm/probe-helper: enable and disable HPD on connectors
>>    drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
>>    drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
>>    drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
>>    drm/omap: stop using drm_bridge_connector_en/disable_hpd()
>>    drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
>>
>>   drivers/gpu/drm/drm_bridge_connector.c   | 27 +++-------------
>>   drivers/gpu/drm/drm_probe_helper.c       | 40 ++++++++++++++++++-----
>>   drivers/gpu/drm/imx/dcss/dcss-dev.c      |  4 ---
>>   drivers/gpu/drm/imx/dcss/dcss-kms.c      |  2 --
>>   drivers/gpu/drm/msm/hdmi/hdmi.c          |  2 --
>>   drivers/gpu/drm/omapdrm/omap_drv.c       | 41 ------------------------
>>   include/drm/drm_bridge_connector.h       |  2 --
>>   include/drm/drm_modeset_helper_vtables.h | 22 +++++++++++++
>>   8 files changed, 59 insertions(+), 81 deletions(-)
>>
>> -- 
>> 2.35.1
>>

-- 
With best wishes
Dmitry


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-01-09 20:26     ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2023-01-09 20:26 UTC (permalink / raw)
  To: Laurentiu Palcu
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Lucas Stach, Philipp Zabel,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar,
	Tomi Valkeinen, dri-devel, linux-arm-kernel, linux-arm-msm,
	freedreno

Hi,

On 09/01/2023 18:21, Laurentiu Palcu wrote:
> Hi Dmitry,
> 
> It looks like there are some issues with this patchset... :/ I just
> fetched the drm-tip and, with these patches included, the "Hot plug
> detection already enabled" warning is back for i.MX DCSS.

Could you please provide a backtrace?

> 
> After a short investigation, it seems that we end up calling
> drm_bridge_hpd_enable() from both drm_kms_helper_poll_init() and
> drm_fbdev_generic_setup(), hence the warning.
> 
> There are drivers using the drm_bridge_connector API that also call
> drm_kms_helper_poll_init() followed by drm_fbdev_generic_setup(). So,
> they might experience the same behavior, unless I'm missing something...
> :/
> 
> Also, even if drm_fbdev_generic_setup() is not called in the driver
> initialization, the warning will still appear the first time the
> GETCONNECTOR ioctl is called, because that'll call
> drm_helper_probe_single_connector_modes() helper which will eventually
> call drm_bridge_hpd_enable().
> 
> Any idea?
> 
> Cheers,
> Laurentiu
> 
> On Wed, Nov 02, 2022 at 09:06:58PM +0300, Dmitry Baryshkov wrote:
>>  From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
>> DRM driver do a proper work of calling
>> drm_bridge_connector_en/disable_hpd() in right places. Rather than
>> teaching each and every driver how to properly handle
>> drm_bridge_connector's HPD, make that automatic.
>>
>> Add two additional drm_connector helper funcs: enable_hpd() and
>> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
>> is the time where the drm_bridge_connector's functions are called by the
>> drivers too).
>>
>> Changes since v2:
>>   - Fixed a typo in the commit message of the second patch.
>>
>> Changes since v1:
>>   - Rebased on top of v6.1-rc1
>>   - Removed the drm_bridge_connector_enable_hpd() from
>>     drm_bridge_connector_init()
>>   - Removed extra underscore prefix from
>>     drm_bridge_connector_en/disable_hpd() helpers
>>
>> Dmitry Baryshkov (7):
>>    drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
>>    drm/probe-helper: enable and disable HPD on connectors
>>    drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
>>    drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
>>    drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
>>    drm/omap: stop using drm_bridge_connector_en/disable_hpd()
>>    drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
>>
>>   drivers/gpu/drm/drm_bridge_connector.c   | 27 +++-------------
>>   drivers/gpu/drm/drm_probe_helper.c       | 40 ++++++++++++++++++-----
>>   drivers/gpu/drm/imx/dcss/dcss-dev.c      |  4 ---
>>   drivers/gpu/drm/imx/dcss/dcss-kms.c      |  2 --
>>   drivers/gpu/drm/msm/hdmi/hdmi.c          |  2 --
>>   drivers/gpu/drm/omapdrm/omap_drv.c       | 41 ------------------------
>>   include/drm/drm_bridge_connector.h       |  2 --
>>   include/drm/drm_modeset_helper_vtables.h | 22 +++++++++++++
>>   8 files changed, 59 insertions(+), 81 deletions(-)
>>
>> -- 
>> 2.35.1
>>

-- 
With best wishes
Dmitry


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
  2023-01-09 20:26     ` Dmitry Baryshkov
  (?)
@ 2023-01-10  6:57       ` Laurentiu Palcu
  -1 siblings, 0 replies; 106+ messages in thread
From: Laurentiu Palcu @ 2023-01-10  6:57 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Lucas Stach, Philipp Zabel,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar,
	Tomi Valkeinen, dri-devel, linux-arm-kernel, linux-arm-msm,
	freedreno

Hi,

On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
> Hi,
> 
> On 09/01/2023 18:21, Laurentiu Palcu wrote:
> > Hi Dmitry,
> > 
> > It looks like there are some issues with this patchset... :/ I just
> > fetched the drm-tip and, with these patches included, the "Hot plug
> > detection already enabled" warning is back for i.MX DCSS.
> 
> Could you please provide a backtrace?

Sure, see below:

------------[ cut here ]------------
Hot plug detection already enabled
WARNING: CPU: 2 PID: 9 at drivers/gpu/drm/drm_bridge.c:1257 drm_bridge_hpd_enable+0x94/0x9c [drm]
Modules linked in: videobuf2_memops snd_soc_simple_card snd_soc_simple_card_utils fsl_imx8_ddr_perf videobuf2_common snd_soc_imx_spdif adv7511 etnaviv imx8m_ddrc imx_dcss mc cec nwl_dsi gov
CPU: 2 PID: 9 Comm: kworker/u8:0 Not tainted 6.2.0-rc2-15208-g25b283acd578 #6
Hardware name: NXP i.MX8MQ EVK (DT)
Workqueue: events_unbound deferred_probe_work_func
pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : drm_bridge_hpd_enable+0x94/0x9c [drm]
lr : drm_bridge_hpd_enable+0x94/0x9c [drm]
sp : ffff800009ef3740
x29: ffff800009ef3740 x28: ffff000009331f00 x27: 0000000000001000
x26: 0000000000000020 x25: ffff800001148ed8 x24: ffff00000a8fe000
x23: 00000000fffffffd x22: ffff000005086348 x21: ffff800001133ee0
x20: ffff00000550d800 x19: ffff000005086288 x18: 0000000000000006
x17: 0000000000000000 x16: ffff8000096ef008 x15: 97ffff2891004260
x14: 2a1403e194000000 x13: 97ffff2891004260 x12: 2a1403e194000000
x11: 7100385f29400801 x10: 0000000000000aa0 x9 : ffff800008112744
x8 : ffff000000250b00 x7 : 0000000000000003 x6 : 0000000000000011
x5 : 0000000000000000 x4 : ffff0000bd986a48 x3 : 0000000000000001
x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000000250000
Call trace:
 drm_bridge_hpd_enable+0x94/0x9c [drm]
 drm_bridge_connector_enable_hpd+0x2c/0x3c [drm_kms_helper]
 drm_kms_helper_poll_enable+0x94/0x10c [drm_kms_helper]
 drm_helper_probe_single_connector_modes+0x1a8/0x510 [drm_kms_helper]
 drm_client_modeset_probe+0x204/0x1190 [drm]
 __drm_fb_helper_initial_config_and_unlock+0x5c/0x4a4 [drm_kms_helper]
 drm_fb_helper_initial_config+0x54/0x6c [drm_kms_helper]
 drm_fbdev_client_hotplug+0xd0/0x140 [drm_kms_helper]
 drm_fbdev_generic_setup+0x90/0x154 [drm_kms_helper]
 dcss_kms_attach+0x1c8/0x254 [imx_dcss]
 dcss_drv_platform_probe+0x90/0xfc [imx_dcss]
 platform_probe+0x70/0xcc
 really_probe+0xc4/0x2e0
 __driver_probe_device+0x80/0xf0
 driver_probe_device+0xe0/0x164
 __device_attach_driver+0xc0/0x13c
 bus_for_each_drv+0x84/0xe0
 __device_attach+0xa4/0x1a0
 device_initial_probe+0x1c/0x30
 bus_probe_device+0xa4/0xb0
 deferred_probe_work_func+0x90/0xd0
 process_one_work+0x200/0x474
 worker_thread+0x74/0x43c
 kthread+0xfc/0x110
 ret_from_fork+0x10/0x20
---[ end trace 0000000000000000 ]---

Cheers,
Laurentiu

> 
> > 
> > After a short investigation, it seems that we end up calling
> > drm_bridge_hpd_enable() from both drm_kms_helper_poll_init() and
> > drm_fbdev_generic_setup(), hence the warning.
> > 
> > There are drivers using the drm_bridge_connector API that also call
> > drm_kms_helper_poll_init() followed by drm_fbdev_generic_setup(). So,
> > they might experience the same behavior, unless I'm missing something...
> > :/
> > 
> > Also, even if drm_fbdev_generic_setup() is not called in the driver
> > initialization, the warning will still appear the first time the
> > GETCONNECTOR ioctl is called, because that'll call
> > drm_helper_probe_single_connector_modes() helper which will eventually
> > call drm_bridge_hpd_enable().
> > 
> > Any idea?
> > 
> > Cheers,
> > Laurentiu
> > 
> > On Wed, Nov 02, 2022 at 09:06:58PM +0300, Dmitry Baryshkov wrote:
> > >  From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
> > > DRM driver do a proper work of calling
> > > drm_bridge_connector_en/disable_hpd() in right places. Rather than
> > > teaching each and every driver how to properly handle
> > > drm_bridge_connector's HPD, make that automatic.
> > > 
> > > Add two additional drm_connector helper funcs: enable_hpd() and
> > > disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
> > > is the time where the drm_bridge_connector's functions are called by the
> > > drivers too).
> > > 
> > > Changes since v2:
> > >   - Fixed a typo in the commit message of the second patch.
> > > 
> > > Changes since v1:
> > >   - Rebased on top of v6.1-rc1
> > >   - Removed the drm_bridge_connector_enable_hpd() from
> > >     drm_bridge_connector_init()
> > >   - Removed extra underscore prefix from
> > >     drm_bridge_connector_en/disable_hpd() helpers
> > > 
> > > Dmitry Baryshkov (7):
> > >    drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
> > >    drm/probe-helper: enable and disable HPD on connectors
> > >    drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
> > >    drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
> > >    drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
> > >    drm/omap: stop using drm_bridge_connector_en/disable_hpd()
> > >    drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
> > > 
> > >   drivers/gpu/drm/drm_bridge_connector.c   | 27 +++-------------
> > >   drivers/gpu/drm/drm_probe_helper.c       | 40 ++++++++++++++++++-----
> > >   drivers/gpu/drm/imx/dcss/dcss-dev.c      |  4 ---
> > >   drivers/gpu/drm/imx/dcss/dcss-kms.c      |  2 --
> > >   drivers/gpu/drm/msm/hdmi/hdmi.c          |  2 --
> > >   drivers/gpu/drm/omapdrm/omap_drv.c       | 41 ------------------------
> > >   include/drm/drm_bridge_connector.h       |  2 --
> > >   include/drm/drm_modeset_helper_vtables.h | 22 +++++++++++++
> > >   8 files changed, 59 insertions(+), 81 deletions(-)
> > > 
> > > -- 
> > > 2.35.1
> > > 
> 
> -- 
> With best wishes
> Dmitry
> 

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-01-10  6:57       ` Laurentiu Palcu
  0 siblings, 0 replies; 106+ messages in thread
From: Laurentiu Palcu @ 2023-01-10  6:57 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Sean Paul, dri-devel, Thomas Zimmermann, Tomi Valkeinen,
	Shawn Guo, Sascha Hauer, Abhinav Kumar, NXP Linux Team,
	linux-arm-msm, freedreno, Pengutronix Kernel Team,
	linux-arm-kernel

Hi,

On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
> Hi,
> 
> On 09/01/2023 18:21, Laurentiu Palcu wrote:
> > Hi Dmitry,
> > 
> > It looks like there are some issues with this patchset... :/ I just
> > fetched the drm-tip and, with these patches included, the "Hot plug
> > detection already enabled" warning is back for i.MX DCSS.
> 
> Could you please provide a backtrace?

Sure, see below:

------------[ cut here ]------------
Hot plug detection already enabled
WARNING: CPU: 2 PID: 9 at drivers/gpu/drm/drm_bridge.c:1257 drm_bridge_hpd_enable+0x94/0x9c [drm]
Modules linked in: videobuf2_memops snd_soc_simple_card snd_soc_simple_card_utils fsl_imx8_ddr_perf videobuf2_common snd_soc_imx_spdif adv7511 etnaviv imx8m_ddrc imx_dcss mc cec nwl_dsi gov
CPU: 2 PID: 9 Comm: kworker/u8:0 Not tainted 6.2.0-rc2-15208-g25b283acd578 #6
Hardware name: NXP i.MX8MQ EVK (DT)
Workqueue: events_unbound deferred_probe_work_func
pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : drm_bridge_hpd_enable+0x94/0x9c [drm]
lr : drm_bridge_hpd_enable+0x94/0x9c [drm]
sp : ffff800009ef3740
x29: ffff800009ef3740 x28: ffff000009331f00 x27: 0000000000001000
x26: 0000000000000020 x25: ffff800001148ed8 x24: ffff00000a8fe000
x23: 00000000fffffffd x22: ffff000005086348 x21: ffff800001133ee0
x20: ffff00000550d800 x19: ffff000005086288 x18: 0000000000000006
x17: 0000000000000000 x16: ffff8000096ef008 x15: 97ffff2891004260
x14: 2a1403e194000000 x13: 97ffff2891004260 x12: 2a1403e194000000
x11: 7100385f29400801 x10: 0000000000000aa0 x9 : ffff800008112744
x8 : ffff000000250b00 x7 : 0000000000000003 x6 : 0000000000000011
x5 : 0000000000000000 x4 : ffff0000bd986a48 x3 : 0000000000000001
x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000000250000
Call trace:
 drm_bridge_hpd_enable+0x94/0x9c [drm]
 drm_bridge_connector_enable_hpd+0x2c/0x3c [drm_kms_helper]
 drm_kms_helper_poll_enable+0x94/0x10c [drm_kms_helper]
 drm_helper_probe_single_connector_modes+0x1a8/0x510 [drm_kms_helper]
 drm_client_modeset_probe+0x204/0x1190 [drm]
 __drm_fb_helper_initial_config_and_unlock+0x5c/0x4a4 [drm_kms_helper]
 drm_fb_helper_initial_config+0x54/0x6c [drm_kms_helper]
 drm_fbdev_client_hotplug+0xd0/0x140 [drm_kms_helper]
 drm_fbdev_generic_setup+0x90/0x154 [drm_kms_helper]
 dcss_kms_attach+0x1c8/0x254 [imx_dcss]
 dcss_drv_platform_probe+0x90/0xfc [imx_dcss]
 platform_probe+0x70/0xcc
 really_probe+0xc4/0x2e0
 __driver_probe_device+0x80/0xf0
 driver_probe_device+0xe0/0x164
 __device_attach_driver+0xc0/0x13c
 bus_for_each_drv+0x84/0xe0
 __device_attach+0xa4/0x1a0
 device_initial_probe+0x1c/0x30
 bus_probe_device+0xa4/0xb0
 deferred_probe_work_func+0x90/0xd0
 process_one_work+0x200/0x474
 worker_thread+0x74/0x43c
 kthread+0xfc/0x110
 ret_from_fork+0x10/0x20
---[ end trace 0000000000000000 ]---

Cheers,
Laurentiu

> 
> > 
> > After a short investigation, it seems that we end up calling
> > drm_bridge_hpd_enable() from both drm_kms_helper_poll_init() and
> > drm_fbdev_generic_setup(), hence the warning.
> > 
> > There are drivers using the drm_bridge_connector API that also call
> > drm_kms_helper_poll_init() followed by drm_fbdev_generic_setup(). So,
> > they might experience the same behavior, unless I'm missing something...
> > :/
> > 
> > Also, even if drm_fbdev_generic_setup() is not called in the driver
> > initialization, the warning will still appear the first time the
> > GETCONNECTOR ioctl is called, because that'll call
> > drm_helper_probe_single_connector_modes() helper which will eventually
> > call drm_bridge_hpd_enable().
> > 
> > Any idea?
> > 
> > Cheers,
> > Laurentiu
> > 
> > On Wed, Nov 02, 2022 at 09:06:58PM +0300, Dmitry Baryshkov wrote:
> > >  From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
> > > DRM driver do a proper work of calling
> > > drm_bridge_connector_en/disable_hpd() in right places. Rather than
> > > teaching each and every driver how to properly handle
> > > drm_bridge_connector's HPD, make that automatic.
> > > 
> > > Add two additional drm_connector helper funcs: enable_hpd() and
> > > disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
> > > is the time where the drm_bridge_connector's functions are called by the
> > > drivers too).
> > > 
> > > Changes since v2:
> > >   - Fixed a typo in the commit message of the second patch.
> > > 
> > > Changes since v1:
> > >   - Rebased on top of v6.1-rc1
> > >   - Removed the drm_bridge_connector_enable_hpd() from
> > >     drm_bridge_connector_init()
> > >   - Removed extra underscore prefix from
> > >     drm_bridge_connector_en/disable_hpd() helpers
> > > 
> > > Dmitry Baryshkov (7):
> > >    drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
> > >    drm/probe-helper: enable and disable HPD on connectors
> > >    drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
> > >    drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
> > >    drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
> > >    drm/omap: stop using drm_bridge_connector_en/disable_hpd()
> > >    drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
> > > 
> > >   drivers/gpu/drm/drm_bridge_connector.c   | 27 +++-------------
> > >   drivers/gpu/drm/drm_probe_helper.c       | 40 ++++++++++++++++++-----
> > >   drivers/gpu/drm/imx/dcss/dcss-dev.c      |  4 ---
> > >   drivers/gpu/drm/imx/dcss/dcss-kms.c      |  2 --
> > >   drivers/gpu/drm/msm/hdmi/hdmi.c          |  2 --
> > >   drivers/gpu/drm/omapdrm/omap_drv.c       | 41 ------------------------
> > >   include/drm/drm_bridge_connector.h       |  2 --
> > >   include/drm/drm_modeset_helper_vtables.h | 22 +++++++++++++
> > >   8 files changed, 59 insertions(+), 81 deletions(-)
> > > 
> > > -- 
> > > 2.35.1
> > > 
> 
> -- 
> With best wishes
> Dmitry
> 

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-01-10  6:57       ` Laurentiu Palcu
  0 siblings, 0 replies; 106+ messages in thread
From: Laurentiu Palcu @ 2023-01-10  6:57 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Lucas Stach, Philipp Zabel,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar,
	Tomi Valkeinen, dri-devel, linux-arm-kernel, linux-arm-msm,
	freedreno

Hi,

On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
> Hi,
> 
> On 09/01/2023 18:21, Laurentiu Palcu wrote:
> > Hi Dmitry,
> > 
> > It looks like there are some issues with this patchset... :/ I just
> > fetched the drm-tip and, with these patches included, the "Hot plug
> > detection already enabled" warning is back for i.MX DCSS.
> 
> Could you please provide a backtrace?

Sure, see below:

------------[ cut here ]------------
Hot plug detection already enabled
WARNING: CPU: 2 PID: 9 at drivers/gpu/drm/drm_bridge.c:1257 drm_bridge_hpd_enable+0x94/0x9c [drm]
Modules linked in: videobuf2_memops snd_soc_simple_card snd_soc_simple_card_utils fsl_imx8_ddr_perf videobuf2_common snd_soc_imx_spdif adv7511 etnaviv imx8m_ddrc imx_dcss mc cec nwl_dsi gov
CPU: 2 PID: 9 Comm: kworker/u8:0 Not tainted 6.2.0-rc2-15208-g25b283acd578 #6
Hardware name: NXP i.MX8MQ EVK (DT)
Workqueue: events_unbound deferred_probe_work_func
pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : drm_bridge_hpd_enable+0x94/0x9c [drm]
lr : drm_bridge_hpd_enable+0x94/0x9c [drm]
sp : ffff800009ef3740
x29: ffff800009ef3740 x28: ffff000009331f00 x27: 0000000000001000
x26: 0000000000000020 x25: ffff800001148ed8 x24: ffff00000a8fe000
x23: 00000000fffffffd x22: ffff000005086348 x21: ffff800001133ee0
x20: ffff00000550d800 x19: ffff000005086288 x18: 0000000000000006
x17: 0000000000000000 x16: ffff8000096ef008 x15: 97ffff2891004260
x14: 2a1403e194000000 x13: 97ffff2891004260 x12: 2a1403e194000000
x11: 7100385f29400801 x10: 0000000000000aa0 x9 : ffff800008112744
x8 : ffff000000250b00 x7 : 0000000000000003 x6 : 0000000000000011
x5 : 0000000000000000 x4 : ffff0000bd986a48 x3 : 0000000000000001
x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000000250000
Call trace:
 drm_bridge_hpd_enable+0x94/0x9c [drm]
 drm_bridge_connector_enable_hpd+0x2c/0x3c [drm_kms_helper]
 drm_kms_helper_poll_enable+0x94/0x10c [drm_kms_helper]
 drm_helper_probe_single_connector_modes+0x1a8/0x510 [drm_kms_helper]
 drm_client_modeset_probe+0x204/0x1190 [drm]
 __drm_fb_helper_initial_config_and_unlock+0x5c/0x4a4 [drm_kms_helper]
 drm_fb_helper_initial_config+0x54/0x6c [drm_kms_helper]
 drm_fbdev_client_hotplug+0xd0/0x140 [drm_kms_helper]
 drm_fbdev_generic_setup+0x90/0x154 [drm_kms_helper]
 dcss_kms_attach+0x1c8/0x254 [imx_dcss]
 dcss_drv_platform_probe+0x90/0xfc [imx_dcss]
 platform_probe+0x70/0xcc
 really_probe+0xc4/0x2e0
 __driver_probe_device+0x80/0xf0
 driver_probe_device+0xe0/0x164
 __device_attach_driver+0xc0/0x13c
 bus_for_each_drv+0x84/0xe0
 __device_attach+0xa4/0x1a0
 device_initial_probe+0x1c/0x30
 bus_probe_device+0xa4/0xb0
 deferred_probe_work_func+0x90/0xd0
 process_one_work+0x200/0x474
 worker_thread+0x74/0x43c
 kthread+0xfc/0x110
 ret_from_fork+0x10/0x20
---[ end trace 0000000000000000 ]---

Cheers,
Laurentiu

> 
> > 
> > After a short investigation, it seems that we end up calling
> > drm_bridge_hpd_enable() from both drm_kms_helper_poll_init() and
> > drm_fbdev_generic_setup(), hence the warning.
> > 
> > There are drivers using the drm_bridge_connector API that also call
> > drm_kms_helper_poll_init() followed by drm_fbdev_generic_setup(). So,
> > they might experience the same behavior, unless I'm missing something...
> > :/
> > 
> > Also, even if drm_fbdev_generic_setup() is not called in the driver
> > initialization, the warning will still appear the first time the
> > GETCONNECTOR ioctl is called, because that'll call
> > drm_helper_probe_single_connector_modes() helper which will eventually
> > call drm_bridge_hpd_enable().
> > 
> > Any idea?
> > 
> > Cheers,
> > Laurentiu
> > 
> > On Wed, Nov 02, 2022 at 09:06:58PM +0300, Dmitry Baryshkov wrote:
> > >  From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
> > > DRM driver do a proper work of calling
> > > drm_bridge_connector_en/disable_hpd() in right places. Rather than
> > > teaching each and every driver how to properly handle
> > > drm_bridge_connector's HPD, make that automatic.
> > > 
> > > Add two additional drm_connector helper funcs: enable_hpd() and
> > > disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
> > > is the time where the drm_bridge_connector's functions are called by the
> > > drivers too).
> > > 
> > > Changes since v2:
> > >   - Fixed a typo in the commit message of the second patch.
> > > 
> > > Changes since v1:
> > >   - Rebased on top of v6.1-rc1
> > >   - Removed the drm_bridge_connector_enable_hpd() from
> > >     drm_bridge_connector_init()
> > >   - Removed extra underscore prefix from
> > >     drm_bridge_connector_en/disable_hpd() helpers
> > > 
> > > Dmitry Baryshkov (7):
> > >    drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
> > >    drm/probe-helper: enable and disable HPD on connectors
> > >    drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
> > >    drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
> > >    drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
> > >    drm/omap: stop using drm_bridge_connector_en/disable_hpd()
> > >    drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
> > > 
> > >   drivers/gpu/drm/drm_bridge_connector.c   | 27 +++-------------
> > >   drivers/gpu/drm/drm_probe_helper.c       | 40 ++++++++++++++++++-----
> > >   drivers/gpu/drm/imx/dcss/dcss-dev.c      |  4 ---
> > >   drivers/gpu/drm/imx/dcss/dcss-kms.c      |  2 --
> > >   drivers/gpu/drm/msm/hdmi/hdmi.c          |  2 --
> > >   drivers/gpu/drm/omapdrm/omap_drv.c       | 41 ------------------------
> > >   include/drm/drm_bridge_connector.h       |  2 --
> > >   include/drm/drm_modeset_helper_vtables.h | 22 +++++++++++++
> > >   8 files changed, 59 insertions(+), 81 deletions(-)
> > > 
> > > -- 
> > > 2.35.1
> > > 
> 
> -- 
> With best wishes
> Dmitry
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
  2023-01-10  6:57       ` Laurentiu Palcu
  (?)
@ 2023-01-10 10:20         ` Geert Uytterhoeven
  -1 siblings, 0 replies; 106+ messages in thread
From: Geert Uytterhoeven @ 2023-01-10 10:20 UTC (permalink / raw)
  To: Laurentiu Palcu
  Cc: dri-devel, Laurent Pinchart, NXP Linux Team, linux-arm-msm,
	Sascha Hauer, Abhinav Kumar, Sean Paul, Pengutronix Kernel Team,
	linux-arm-kernel, Tomi Valkeinen, freedreno, Linux-Renesas,
	Kieran Bingham, Thomas Zimmermann, Dmitry Baryshkov, Shawn Guo

On Tue, Jan 10, 2023 at 8:07 AM Laurentiu Palcu
<laurentiu.palcu@oss.nxp.com> wrote:
> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
> > On 09/01/2023 18:21, Laurentiu Palcu wrote:
> > > It looks like there are some issues with this patchset... :/ I just
> > > fetched the drm-tip and, with these patches included, the "Hot plug
> > > detection already enabled" warning is back for i.MX DCSS.
> >
> > Could you please provide a backtrace?
>
> Sure, see below:
>
> ------------[ cut here ]------------
> Hot plug detection already enabled
> WARNING: CPU: 2 PID: 9 at drivers/gpu/drm/drm_bridge.c:1257 drm_bridge_hpd_enable+0x94/0x9c [drm]
> Modules linked in: videobuf2_memops snd_soc_simple_card snd_soc_simple_card_utils fsl_imx8_ddr_perf videobuf2_common snd_soc_imx_spdif adv7511 etnaviv imx8m_ddrc imx_dcss mc cec nwl_dsi gov
> CPU: 2 PID: 9 Comm: kworker/u8:0 Not tainted 6.2.0-rc2-15208-g25b283acd578 #6
> Hardware name: NXP i.MX8MQ EVK (DT)
> Workqueue: events_unbound deferred_probe_work_func
> pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> pc : drm_bridge_hpd_enable+0x94/0x9c [drm]
> lr : drm_bridge_hpd_enable+0x94/0x9c [drm]
> sp : ffff800009ef3740
> x29: ffff800009ef3740 x28: ffff000009331f00 x27: 0000000000001000
> x26: 0000000000000020 x25: ffff800001148ed8 x24: ffff00000a8fe000
> x23: 00000000fffffffd x22: ffff000005086348 x21: ffff800001133ee0
> x20: ffff00000550d800 x19: ffff000005086288 x18: 0000000000000006
> x17: 0000000000000000 x16: ffff8000096ef008 x15: 97ffff2891004260
> x14: 2a1403e194000000 x13: 97ffff2891004260 x12: 2a1403e194000000
> x11: 7100385f29400801 x10: 0000000000000aa0 x9 : ffff800008112744
> x8 : ffff000000250b00 x7 : 0000000000000003 x6 : 0000000000000011
> x5 : 0000000000000000 x4 : ffff0000bd986a48 x3 : 0000000000000001
> x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000000250000
> Call trace:
>  drm_bridge_hpd_enable+0x94/0x9c [drm]
>  drm_bridge_connector_enable_hpd+0x2c/0x3c [drm_kms_helper]
>  drm_kms_helper_poll_enable+0x94/0x10c [drm_kms_helper]
>  drm_helper_probe_single_connector_modes+0x1a8/0x510 [drm_kms_helper]
>  drm_client_modeset_probe+0x204/0x1190 [drm]
>  __drm_fb_helper_initial_config_and_unlock+0x5c/0x4a4 [drm_kms_helper]
>  drm_fb_helper_initial_config+0x54/0x6c [drm_kms_helper]
>  drm_fbdev_client_hotplug+0xd0/0x140 [drm_kms_helper]
>  drm_fbdev_generic_setup+0x90/0x154 [drm_kms_helper]
>  dcss_kms_attach+0x1c8/0x254 [imx_dcss]
>  dcss_drv_platform_probe+0x90/0xfc [imx_dcss]
>  platform_probe+0x70/0xcc
>  really_probe+0xc4/0x2e0
>  __driver_probe_device+0x80/0xf0
>  driver_probe_device+0xe0/0x164
>  __device_attach_driver+0xc0/0x13c
>  bus_for_each_drv+0x84/0xe0
>  __device_attach+0xa4/0x1a0
>  device_initial_probe+0x1c/0x30
>  bus_probe_device+0xa4/0xb0
>  deferred_probe_work_func+0x90/0xd0
>  process_one_work+0x200/0x474
>  worker_thread+0x74/0x43c
>  kthread+0xfc/0x110
>  ret_from_fork+0x10/0x20
> ---[ end trace 0000000000000000 ]---

I get a similar trace on R-Car Gen2 (Koelsch with R-Car M2-W) and
Gen3 (Salvator-XS with R-Car H3 ES2.0), and bisected it to commit
92d755d8f13b6791 ("drm/bridge_connector: rely on drm_kms_helper_poll_*
for HPD enablement") in drm-misc/for-linux-next.

As I do not have any displays connected, I do not know what is the
full impact.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-01-10 10:20         ` Geert Uytterhoeven
  0 siblings, 0 replies; 106+ messages in thread
From: Geert Uytterhoeven @ 2023-01-10 10:20 UTC (permalink / raw)
  To: Laurentiu Palcu
  Cc: Dmitry Baryshkov, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen, dri-devel, linux-arm-kernel,
	linux-arm-msm, freedreno, Laurent Pinchart, Kieran Bingham,
	Linux-Renesas

On Tue, Jan 10, 2023 at 8:07 AM Laurentiu Palcu
<laurentiu.palcu@oss.nxp.com> wrote:
> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
> > On 09/01/2023 18:21, Laurentiu Palcu wrote:
> > > It looks like there are some issues with this patchset... :/ I just
> > > fetched the drm-tip and, with these patches included, the "Hot plug
> > > detection already enabled" warning is back for i.MX DCSS.
> >
> > Could you please provide a backtrace?
>
> Sure, see below:
>
> ------------[ cut here ]------------
> Hot plug detection already enabled
> WARNING: CPU: 2 PID: 9 at drivers/gpu/drm/drm_bridge.c:1257 drm_bridge_hpd_enable+0x94/0x9c [drm]
> Modules linked in: videobuf2_memops snd_soc_simple_card snd_soc_simple_card_utils fsl_imx8_ddr_perf videobuf2_common snd_soc_imx_spdif adv7511 etnaviv imx8m_ddrc imx_dcss mc cec nwl_dsi gov
> CPU: 2 PID: 9 Comm: kworker/u8:0 Not tainted 6.2.0-rc2-15208-g25b283acd578 #6
> Hardware name: NXP i.MX8MQ EVK (DT)
> Workqueue: events_unbound deferred_probe_work_func
> pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> pc : drm_bridge_hpd_enable+0x94/0x9c [drm]
> lr : drm_bridge_hpd_enable+0x94/0x9c [drm]
> sp : ffff800009ef3740
> x29: ffff800009ef3740 x28: ffff000009331f00 x27: 0000000000001000
> x26: 0000000000000020 x25: ffff800001148ed8 x24: ffff00000a8fe000
> x23: 00000000fffffffd x22: ffff000005086348 x21: ffff800001133ee0
> x20: ffff00000550d800 x19: ffff000005086288 x18: 0000000000000006
> x17: 0000000000000000 x16: ffff8000096ef008 x15: 97ffff2891004260
> x14: 2a1403e194000000 x13: 97ffff2891004260 x12: 2a1403e194000000
> x11: 7100385f29400801 x10: 0000000000000aa0 x9 : ffff800008112744
> x8 : ffff000000250b00 x7 : 0000000000000003 x6 : 0000000000000011
> x5 : 0000000000000000 x4 : ffff0000bd986a48 x3 : 0000000000000001
> x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000000250000
> Call trace:
>  drm_bridge_hpd_enable+0x94/0x9c [drm]
>  drm_bridge_connector_enable_hpd+0x2c/0x3c [drm_kms_helper]
>  drm_kms_helper_poll_enable+0x94/0x10c [drm_kms_helper]
>  drm_helper_probe_single_connector_modes+0x1a8/0x510 [drm_kms_helper]
>  drm_client_modeset_probe+0x204/0x1190 [drm]
>  __drm_fb_helper_initial_config_and_unlock+0x5c/0x4a4 [drm_kms_helper]
>  drm_fb_helper_initial_config+0x54/0x6c [drm_kms_helper]
>  drm_fbdev_client_hotplug+0xd0/0x140 [drm_kms_helper]
>  drm_fbdev_generic_setup+0x90/0x154 [drm_kms_helper]
>  dcss_kms_attach+0x1c8/0x254 [imx_dcss]
>  dcss_drv_platform_probe+0x90/0xfc [imx_dcss]
>  platform_probe+0x70/0xcc
>  really_probe+0xc4/0x2e0
>  __driver_probe_device+0x80/0xf0
>  driver_probe_device+0xe0/0x164
>  __device_attach_driver+0xc0/0x13c
>  bus_for_each_drv+0x84/0xe0
>  __device_attach+0xa4/0x1a0
>  device_initial_probe+0x1c/0x30
>  bus_probe_device+0xa4/0xb0
>  deferred_probe_work_func+0x90/0xd0
>  process_one_work+0x200/0x474
>  worker_thread+0x74/0x43c
>  kthread+0xfc/0x110
>  ret_from_fork+0x10/0x20
> ---[ end trace 0000000000000000 ]---

I get a similar trace on R-Car Gen2 (Koelsch with R-Car M2-W) and
Gen3 (Salvator-XS with R-Car H3 ES2.0), and bisected it to commit
92d755d8f13b6791 ("drm/bridge_connector: rely on drm_kms_helper_poll_*
for HPD enablement") in drm-misc/for-linux-next.

As I do not have any displays connected, I do not know what is the
full impact.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-01-10 10:20         ` Geert Uytterhoeven
  0 siblings, 0 replies; 106+ messages in thread
From: Geert Uytterhoeven @ 2023-01-10 10:20 UTC (permalink / raw)
  To: Laurentiu Palcu
  Cc: Dmitry Baryshkov, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen, dri-devel, linux-arm-kernel,
	linux-arm-msm, freedreno, Laurent Pinchart, Kieran Bingham,
	Linux-Renesas

On Tue, Jan 10, 2023 at 8:07 AM Laurentiu Palcu
<laurentiu.palcu@oss.nxp.com> wrote:
> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
> > On 09/01/2023 18:21, Laurentiu Palcu wrote:
> > > It looks like there are some issues with this patchset... :/ I just
> > > fetched the drm-tip and, with these patches included, the "Hot plug
> > > detection already enabled" warning is back for i.MX DCSS.
> >
> > Could you please provide a backtrace?
>
> Sure, see below:
>
> ------------[ cut here ]------------
> Hot plug detection already enabled
> WARNING: CPU: 2 PID: 9 at drivers/gpu/drm/drm_bridge.c:1257 drm_bridge_hpd_enable+0x94/0x9c [drm]
> Modules linked in: videobuf2_memops snd_soc_simple_card snd_soc_simple_card_utils fsl_imx8_ddr_perf videobuf2_common snd_soc_imx_spdif adv7511 etnaviv imx8m_ddrc imx_dcss mc cec nwl_dsi gov
> CPU: 2 PID: 9 Comm: kworker/u8:0 Not tainted 6.2.0-rc2-15208-g25b283acd578 #6
> Hardware name: NXP i.MX8MQ EVK (DT)
> Workqueue: events_unbound deferred_probe_work_func
> pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> pc : drm_bridge_hpd_enable+0x94/0x9c [drm]
> lr : drm_bridge_hpd_enable+0x94/0x9c [drm]
> sp : ffff800009ef3740
> x29: ffff800009ef3740 x28: ffff000009331f00 x27: 0000000000001000
> x26: 0000000000000020 x25: ffff800001148ed8 x24: ffff00000a8fe000
> x23: 00000000fffffffd x22: ffff000005086348 x21: ffff800001133ee0
> x20: ffff00000550d800 x19: ffff000005086288 x18: 0000000000000006
> x17: 0000000000000000 x16: ffff8000096ef008 x15: 97ffff2891004260
> x14: 2a1403e194000000 x13: 97ffff2891004260 x12: 2a1403e194000000
> x11: 7100385f29400801 x10: 0000000000000aa0 x9 : ffff800008112744
> x8 : ffff000000250b00 x7 : 0000000000000003 x6 : 0000000000000011
> x5 : 0000000000000000 x4 : ffff0000bd986a48 x3 : 0000000000000001
> x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000000250000
> Call trace:
>  drm_bridge_hpd_enable+0x94/0x9c [drm]
>  drm_bridge_connector_enable_hpd+0x2c/0x3c [drm_kms_helper]
>  drm_kms_helper_poll_enable+0x94/0x10c [drm_kms_helper]
>  drm_helper_probe_single_connector_modes+0x1a8/0x510 [drm_kms_helper]
>  drm_client_modeset_probe+0x204/0x1190 [drm]
>  __drm_fb_helper_initial_config_and_unlock+0x5c/0x4a4 [drm_kms_helper]
>  drm_fb_helper_initial_config+0x54/0x6c [drm_kms_helper]
>  drm_fbdev_client_hotplug+0xd0/0x140 [drm_kms_helper]
>  drm_fbdev_generic_setup+0x90/0x154 [drm_kms_helper]
>  dcss_kms_attach+0x1c8/0x254 [imx_dcss]
>  dcss_drv_platform_probe+0x90/0xfc [imx_dcss]
>  platform_probe+0x70/0xcc
>  really_probe+0xc4/0x2e0
>  __driver_probe_device+0x80/0xf0
>  driver_probe_device+0xe0/0x164
>  __device_attach_driver+0xc0/0x13c
>  bus_for_each_drv+0x84/0xe0
>  __device_attach+0xa4/0x1a0
>  device_initial_probe+0x1c/0x30
>  bus_probe_device+0xa4/0xb0
>  deferred_probe_work_func+0x90/0xd0
>  process_one_work+0x200/0x474
>  worker_thread+0x74/0x43c
>  kthread+0xfc/0x110
>  ret_from_fork+0x10/0x20
> ---[ end trace 0000000000000000 ]---

I get a similar trace on R-Car Gen2 (Koelsch with R-Car M2-W) and
Gen3 (Salvator-XS with R-Car H3 ES2.0), and bisected it to commit
92d755d8f13b6791 ("drm/bridge_connector: rely on drm_kms_helper_poll_*
for HPD enablement") in drm-misc/for-linux-next.

As I do not have any displays connected, I do not know what is the
full impact.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
  2023-01-10  6:57       ` Laurentiu Palcu
  (?)
@ 2023-01-10 16:29         ` Dmitry Baryshkov
  -1 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2023-01-10 16:29 UTC (permalink / raw)
  To: Laurentiu Palcu
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Lucas Stach, Philipp Zabel,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar,
	Tomi Valkeinen, dri-devel, linux-arm-kernel, linux-arm-msm,
	freedreno

On 10/01/2023 08:57, Laurentiu Palcu wrote:
> Hi,
> 
> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
>> Hi,
>>
>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
>>> Hi Dmitry,
>>>
>>> It looks like there are some issues with this patchset... :/ I just
>>> fetched the drm-tip and, with these patches included, the "Hot plug
>>> detection already enabled" warning is back for i.MX DCSS.
>>
>> Could you please provide a backtrace?
> 
> Sure, see below:

I wondered, why didn't I see this on msm, my main target nowadays. The 
msm driver is calling msm_kms_helper_poll_init() after initializing 
fbdev, so all previous kms_helper_poll_enable() calls return early.

I think I have the fix ready. Let me test it locally before posting.

> 
> ------------[ cut here ]------------
> Hot plug detection already enabled
> WARNING: CPU: 2 PID: 9 at drivers/gpu/drm/drm_bridge.c:1257 drm_bridge_hpd_enable+0x94/0x9c [drm]
> Modules linked in: videobuf2_memops snd_soc_simple_card snd_soc_simple_card_utils fsl_imx8_ddr_perf videobuf2_common snd_soc_imx_spdif adv7511 etnaviv imx8m_ddrc imx_dcss mc cec nwl_dsi gov
> CPU: 2 PID: 9 Comm: kworker/u8:0 Not tainted 6.2.0-rc2-15208-g25b283acd578 #6
> Hardware name: NXP i.MX8MQ EVK (DT)
> Workqueue: events_unbound deferred_probe_work_func
> pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> pc : drm_bridge_hpd_enable+0x94/0x9c [drm]
> lr : drm_bridge_hpd_enable+0x94/0x9c [drm]
> sp : ffff800009ef3740
> x29: ffff800009ef3740 x28: ffff000009331f00 x27: 0000000000001000
> x26: 0000000000000020 x25: ffff800001148ed8 x24: ffff00000a8fe000
> x23: 00000000fffffffd x22: ffff000005086348 x21: ffff800001133ee0
> x20: ffff00000550d800 x19: ffff000005086288 x18: 0000000000000006
> x17: 0000000000000000 x16: ffff8000096ef008 x15: 97ffff2891004260
> x14: 2a1403e194000000 x13: 97ffff2891004260 x12: 2a1403e194000000
> x11: 7100385f29400801 x10: 0000000000000aa0 x9 : ffff800008112744
> x8 : ffff000000250b00 x7 : 0000000000000003 x6 : 0000000000000011
> x5 : 0000000000000000 x4 : ffff0000bd986a48 x3 : 0000000000000001
> x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000000250000
> Call trace:
>   drm_bridge_hpd_enable+0x94/0x9c [drm]
>   drm_bridge_connector_enable_hpd+0x2c/0x3c [drm_kms_helper]
>   drm_kms_helper_poll_enable+0x94/0x10c [drm_kms_helper]
>   drm_helper_probe_single_connector_modes+0x1a8/0x510 [drm_kms_helper]
>   drm_client_modeset_probe+0x204/0x1190 [drm]
>   __drm_fb_helper_initial_config_and_unlock+0x5c/0x4a4 [drm_kms_helper]
>   drm_fb_helper_initial_config+0x54/0x6c [drm_kms_helper]
>   drm_fbdev_client_hotplug+0xd0/0x140 [drm_kms_helper]
>   drm_fbdev_generic_setup+0x90/0x154 [drm_kms_helper]
>   dcss_kms_attach+0x1c8/0x254 [imx_dcss]
>   dcss_drv_platform_probe+0x90/0xfc [imx_dcss]
>   platform_probe+0x70/0xcc
>   really_probe+0xc4/0x2e0
>   __driver_probe_device+0x80/0xf0
>   driver_probe_device+0xe0/0x164
>   __device_attach_driver+0xc0/0x13c
>   bus_for_each_drv+0x84/0xe0
>   __device_attach+0xa4/0x1a0
>   device_initial_probe+0x1c/0x30
>   bus_probe_device+0xa4/0xb0
>   deferred_probe_work_func+0x90/0xd0
>   process_one_work+0x200/0x474
>   worker_thread+0x74/0x43c
>   kthread+0xfc/0x110
>   ret_from_fork+0x10/0x20
> ---[ end trace 0000000000000000 ]---
> 
> Cheers,
> Laurentiu
> 
>>
>>>
>>> After a short investigation, it seems that we end up calling
>>> drm_bridge_hpd_enable() from both drm_kms_helper_poll_init() and
>>> drm_fbdev_generic_setup(), hence the warning.
>>>
>>> There are drivers using the drm_bridge_connector API that also call
>>> drm_kms_helper_poll_init() followed by drm_fbdev_generic_setup(). So,
>>> they might experience the same behavior, unless I'm missing something...
>>> :/
>>>
>>> Also, even if drm_fbdev_generic_setup() is not called in the driver
>>> initialization, the warning will still appear the first time the
>>> GETCONNECTOR ioctl is called, because that'll call
>>> drm_helper_probe_single_connector_modes() helper which will eventually
>>> call drm_bridge_hpd_enable().
>>>
>>> Any idea?
>>>
>>> Cheers,
>>> Laurentiu
>>>
>>> On Wed, Nov 02, 2022 at 09:06:58PM +0300, Dmitry Baryshkov wrote:
>>>>   From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
>>>> DRM driver do a proper work of calling
>>>> drm_bridge_connector_en/disable_hpd() in right places. Rather than
>>>> teaching each and every driver how to properly handle
>>>> drm_bridge_connector's HPD, make that automatic.
>>>>
>>>> Add two additional drm_connector helper funcs: enable_hpd() and
>>>> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
>>>> is the time where the drm_bridge_connector's functions are called by the
>>>> drivers too).
>>>>
>>>> Changes since v2:
>>>>    - Fixed a typo in the commit message of the second patch.
>>>>
>>>> Changes since v1:
>>>>    - Rebased on top of v6.1-rc1
>>>>    - Removed the drm_bridge_connector_enable_hpd() from
>>>>      drm_bridge_connector_init()
>>>>    - Removed extra underscore prefix from
>>>>      drm_bridge_connector_en/disable_hpd() helpers
>>>>
>>>> Dmitry Baryshkov (7):
>>>>     drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
>>>>     drm/probe-helper: enable and disable HPD on connectors
>>>>     drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
>>>>     drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
>>>>     drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
>>>>     drm/omap: stop using drm_bridge_connector_en/disable_hpd()
>>>>     drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
>>>>
>>>>    drivers/gpu/drm/drm_bridge_connector.c   | 27 +++-------------
>>>>    drivers/gpu/drm/drm_probe_helper.c       | 40 ++++++++++++++++++-----
>>>>    drivers/gpu/drm/imx/dcss/dcss-dev.c      |  4 ---
>>>>    drivers/gpu/drm/imx/dcss/dcss-kms.c      |  2 --
>>>>    drivers/gpu/drm/msm/hdmi/hdmi.c          |  2 --
>>>>    drivers/gpu/drm/omapdrm/omap_drv.c       | 41 ------------------------
>>>>    include/drm/drm_bridge_connector.h       |  2 --
>>>>    include/drm/drm_modeset_helper_vtables.h | 22 +++++++++++++
>>>>    8 files changed, 59 insertions(+), 81 deletions(-)
>>>>
>>>> -- 
>>>> 2.35.1
>>>>
>>
>> -- 
>> With best wishes
>> Dmitry
>>

-- 
With best wishes
Dmitry


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-01-10 16:29         ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2023-01-10 16:29 UTC (permalink / raw)
  To: Laurentiu Palcu
  Cc: Sean Paul, dri-devel, Thomas Zimmermann, Tomi Valkeinen,
	Shawn Guo, Sascha Hauer, Abhinav Kumar, NXP Linux Team,
	linux-arm-msm, freedreno, Pengutronix Kernel Team,
	linux-arm-kernel

On 10/01/2023 08:57, Laurentiu Palcu wrote:
> Hi,
> 
> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
>> Hi,
>>
>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
>>> Hi Dmitry,
>>>
>>> It looks like there are some issues with this patchset... :/ I just
>>> fetched the drm-tip and, with these patches included, the "Hot plug
>>> detection already enabled" warning is back for i.MX DCSS.
>>
>> Could you please provide a backtrace?
> 
> Sure, see below:

I wondered, why didn't I see this on msm, my main target nowadays. The 
msm driver is calling msm_kms_helper_poll_init() after initializing 
fbdev, so all previous kms_helper_poll_enable() calls return early.

I think I have the fix ready. Let me test it locally before posting.

> 
> ------------[ cut here ]------------
> Hot plug detection already enabled
> WARNING: CPU: 2 PID: 9 at drivers/gpu/drm/drm_bridge.c:1257 drm_bridge_hpd_enable+0x94/0x9c [drm]
> Modules linked in: videobuf2_memops snd_soc_simple_card snd_soc_simple_card_utils fsl_imx8_ddr_perf videobuf2_common snd_soc_imx_spdif adv7511 etnaviv imx8m_ddrc imx_dcss mc cec nwl_dsi gov
> CPU: 2 PID: 9 Comm: kworker/u8:0 Not tainted 6.2.0-rc2-15208-g25b283acd578 #6
> Hardware name: NXP i.MX8MQ EVK (DT)
> Workqueue: events_unbound deferred_probe_work_func
> pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> pc : drm_bridge_hpd_enable+0x94/0x9c [drm]
> lr : drm_bridge_hpd_enable+0x94/0x9c [drm]
> sp : ffff800009ef3740
> x29: ffff800009ef3740 x28: ffff000009331f00 x27: 0000000000001000
> x26: 0000000000000020 x25: ffff800001148ed8 x24: ffff00000a8fe000
> x23: 00000000fffffffd x22: ffff000005086348 x21: ffff800001133ee0
> x20: ffff00000550d800 x19: ffff000005086288 x18: 0000000000000006
> x17: 0000000000000000 x16: ffff8000096ef008 x15: 97ffff2891004260
> x14: 2a1403e194000000 x13: 97ffff2891004260 x12: 2a1403e194000000
> x11: 7100385f29400801 x10: 0000000000000aa0 x9 : ffff800008112744
> x8 : ffff000000250b00 x7 : 0000000000000003 x6 : 0000000000000011
> x5 : 0000000000000000 x4 : ffff0000bd986a48 x3 : 0000000000000001
> x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000000250000
> Call trace:
>   drm_bridge_hpd_enable+0x94/0x9c [drm]
>   drm_bridge_connector_enable_hpd+0x2c/0x3c [drm_kms_helper]
>   drm_kms_helper_poll_enable+0x94/0x10c [drm_kms_helper]
>   drm_helper_probe_single_connector_modes+0x1a8/0x510 [drm_kms_helper]
>   drm_client_modeset_probe+0x204/0x1190 [drm]
>   __drm_fb_helper_initial_config_and_unlock+0x5c/0x4a4 [drm_kms_helper]
>   drm_fb_helper_initial_config+0x54/0x6c [drm_kms_helper]
>   drm_fbdev_client_hotplug+0xd0/0x140 [drm_kms_helper]
>   drm_fbdev_generic_setup+0x90/0x154 [drm_kms_helper]
>   dcss_kms_attach+0x1c8/0x254 [imx_dcss]
>   dcss_drv_platform_probe+0x90/0xfc [imx_dcss]
>   platform_probe+0x70/0xcc
>   really_probe+0xc4/0x2e0
>   __driver_probe_device+0x80/0xf0
>   driver_probe_device+0xe0/0x164
>   __device_attach_driver+0xc0/0x13c
>   bus_for_each_drv+0x84/0xe0
>   __device_attach+0xa4/0x1a0
>   device_initial_probe+0x1c/0x30
>   bus_probe_device+0xa4/0xb0
>   deferred_probe_work_func+0x90/0xd0
>   process_one_work+0x200/0x474
>   worker_thread+0x74/0x43c
>   kthread+0xfc/0x110
>   ret_from_fork+0x10/0x20
> ---[ end trace 0000000000000000 ]---
> 
> Cheers,
> Laurentiu
> 
>>
>>>
>>> After a short investigation, it seems that we end up calling
>>> drm_bridge_hpd_enable() from both drm_kms_helper_poll_init() and
>>> drm_fbdev_generic_setup(), hence the warning.
>>>
>>> There are drivers using the drm_bridge_connector API that also call
>>> drm_kms_helper_poll_init() followed by drm_fbdev_generic_setup(). So,
>>> they might experience the same behavior, unless I'm missing something...
>>> :/
>>>
>>> Also, even if drm_fbdev_generic_setup() is not called in the driver
>>> initialization, the warning will still appear the first time the
>>> GETCONNECTOR ioctl is called, because that'll call
>>> drm_helper_probe_single_connector_modes() helper which will eventually
>>> call drm_bridge_hpd_enable().
>>>
>>> Any idea?
>>>
>>> Cheers,
>>> Laurentiu
>>>
>>> On Wed, Nov 02, 2022 at 09:06:58PM +0300, Dmitry Baryshkov wrote:
>>>>   From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
>>>> DRM driver do a proper work of calling
>>>> drm_bridge_connector_en/disable_hpd() in right places. Rather than
>>>> teaching each and every driver how to properly handle
>>>> drm_bridge_connector's HPD, make that automatic.
>>>>
>>>> Add two additional drm_connector helper funcs: enable_hpd() and
>>>> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
>>>> is the time where the drm_bridge_connector's functions are called by the
>>>> drivers too).
>>>>
>>>> Changes since v2:
>>>>    - Fixed a typo in the commit message of the second patch.
>>>>
>>>> Changes since v1:
>>>>    - Rebased on top of v6.1-rc1
>>>>    - Removed the drm_bridge_connector_enable_hpd() from
>>>>      drm_bridge_connector_init()
>>>>    - Removed extra underscore prefix from
>>>>      drm_bridge_connector_en/disable_hpd() helpers
>>>>
>>>> Dmitry Baryshkov (7):
>>>>     drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
>>>>     drm/probe-helper: enable and disable HPD on connectors
>>>>     drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
>>>>     drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
>>>>     drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
>>>>     drm/omap: stop using drm_bridge_connector_en/disable_hpd()
>>>>     drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
>>>>
>>>>    drivers/gpu/drm/drm_bridge_connector.c   | 27 +++-------------
>>>>    drivers/gpu/drm/drm_probe_helper.c       | 40 ++++++++++++++++++-----
>>>>    drivers/gpu/drm/imx/dcss/dcss-dev.c      |  4 ---
>>>>    drivers/gpu/drm/imx/dcss/dcss-kms.c      |  2 --
>>>>    drivers/gpu/drm/msm/hdmi/hdmi.c          |  2 --
>>>>    drivers/gpu/drm/omapdrm/omap_drv.c       | 41 ------------------------
>>>>    include/drm/drm_bridge_connector.h       |  2 --
>>>>    include/drm/drm_modeset_helper_vtables.h | 22 +++++++++++++
>>>>    8 files changed, 59 insertions(+), 81 deletions(-)
>>>>
>>>> -- 
>>>> 2.35.1
>>>>
>>
>> -- 
>> With best wishes
>> Dmitry
>>

-- 
With best wishes
Dmitry


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-01-10 16:29         ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2023-01-10 16:29 UTC (permalink / raw)
  To: Laurentiu Palcu
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Lucas Stach, Philipp Zabel,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar,
	Tomi Valkeinen, dri-devel, linux-arm-kernel, linux-arm-msm,
	freedreno

On 10/01/2023 08:57, Laurentiu Palcu wrote:
> Hi,
> 
> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
>> Hi,
>>
>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
>>> Hi Dmitry,
>>>
>>> It looks like there are some issues with this patchset... :/ I just
>>> fetched the drm-tip and, with these patches included, the "Hot plug
>>> detection already enabled" warning is back for i.MX DCSS.
>>
>> Could you please provide a backtrace?
> 
> Sure, see below:

I wondered, why didn't I see this on msm, my main target nowadays. The 
msm driver is calling msm_kms_helper_poll_init() after initializing 
fbdev, so all previous kms_helper_poll_enable() calls return early.

I think I have the fix ready. Let me test it locally before posting.

> 
> ------------[ cut here ]------------
> Hot plug detection already enabled
> WARNING: CPU: 2 PID: 9 at drivers/gpu/drm/drm_bridge.c:1257 drm_bridge_hpd_enable+0x94/0x9c [drm]
> Modules linked in: videobuf2_memops snd_soc_simple_card snd_soc_simple_card_utils fsl_imx8_ddr_perf videobuf2_common snd_soc_imx_spdif adv7511 etnaviv imx8m_ddrc imx_dcss mc cec nwl_dsi gov
> CPU: 2 PID: 9 Comm: kworker/u8:0 Not tainted 6.2.0-rc2-15208-g25b283acd578 #6
> Hardware name: NXP i.MX8MQ EVK (DT)
> Workqueue: events_unbound deferred_probe_work_func
> pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> pc : drm_bridge_hpd_enable+0x94/0x9c [drm]
> lr : drm_bridge_hpd_enable+0x94/0x9c [drm]
> sp : ffff800009ef3740
> x29: ffff800009ef3740 x28: ffff000009331f00 x27: 0000000000001000
> x26: 0000000000000020 x25: ffff800001148ed8 x24: ffff00000a8fe000
> x23: 00000000fffffffd x22: ffff000005086348 x21: ffff800001133ee0
> x20: ffff00000550d800 x19: ffff000005086288 x18: 0000000000000006
> x17: 0000000000000000 x16: ffff8000096ef008 x15: 97ffff2891004260
> x14: 2a1403e194000000 x13: 97ffff2891004260 x12: 2a1403e194000000
> x11: 7100385f29400801 x10: 0000000000000aa0 x9 : ffff800008112744
> x8 : ffff000000250b00 x7 : 0000000000000003 x6 : 0000000000000011
> x5 : 0000000000000000 x4 : ffff0000bd986a48 x3 : 0000000000000001
> x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000000250000
> Call trace:
>   drm_bridge_hpd_enable+0x94/0x9c [drm]
>   drm_bridge_connector_enable_hpd+0x2c/0x3c [drm_kms_helper]
>   drm_kms_helper_poll_enable+0x94/0x10c [drm_kms_helper]
>   drm_helper_probe_single_connector_modes+0x1a8/0x510 [drm_kms_helper]
>   drm_client_modeset_probe+0x204/0x1190 [drm]
>   __drm_fb_helper_initial_config_and_unlock+0x5c/0x4a4 [drm_kms_helper]
>   drm_fb_helper_initial_config+0x54/0x6c [drm_kms_helper]
>   drm_fbdev_client_hotplug+0xd0/0x140 [drm_kms_helper]
>   drm_fbdev_generic_setup+0x90/0x154 [drm_kms_helper]
>   dcss_kms_attach+0x1c8/0x254 [imx_dcss]
>   dcss_drv_platform_probe+0x90/0xfc [imx_dcss]
>   platform_probe+0x70/0xcc
>   really_probe+0xc4/0x2e0
>   __driver_probe_device+0x80/0xf0
>   driver_probe_device+0xe0/0x164
>   __device_attach_driver+0xc0/0x13c
>   bus_for_each_drv+0x84/0xe0
>   __device_attach+0xa4/0x1a0
>   device_initial_probe+0x1c/0x30
>   bus_probe_device+0xa4/0xb0
>   deferred_probe_work_func+0x90/0xd0
>   process_one_work+0x200/0x474
>   worker_thread+0x74/0x43c
>   kthread+0xfc/0x110
>   ret_from_fork+0x10/0x20
> ---[ end trace 0000000000000000 ]---
> 
> Cheers,
> Laurentiu
> 
>>
>>>
>>> After a short investigation, it seems that we end up calling
>>> drm_bridge_hpd_enable() from both drm_kms_helper_poll_init() and
>>> drm_fbdev_generic_setup(), hence the warning.
>>>
>>> There are drivers using the drm_bridge_connector API that also call
>>> drm_kms_helper_poll_init() followed by drm_fbdev_generic_setup(). So,
>>> they might experience the same behavior, unless I'm missing something...
>>> :/
>>>
>>> Also, even if drm_fbdev_generic_setup() is not called in the driver
>>> initialization, the warning will still appear the first time the
>>> GETCONNECTOR ioctl is called, because that'll call
>>> drm_helper_probe_single_connector_modes() helper which will eventually
>>> call drm_bridge_hpd_enable().
>>>
>>> Any idea?
>>>
>>> Cheers,
>>> Laurentiu
>>>
>>> On Wed, Nov 02, 2022 at 09:06:58PM +0300, Dmitry Baryshkov wrote:
>>>>   From all the drivers using drm_bridge_connector only iMX/dcss and OMAP
>>>> DRM driver do a proper work of calling
>>>> drm_bridge_connector_en/disable_hpd() in right places. Rather than
>>>> teaching each and every driver how to properly handle
>>>> drm_bridge_connector's HPD, make that automatic.
>>>>
>>>> Add two additional drm_connector helper funcs: enable_hpd() and
>>>> disable_hpd(). Make drm_kms_helper_poll_* functions call them (as this
>>>> is the time where the drm_bridge_connector's functions are called by the
>>>> drivers too).
>>>>
>>>> Changes since v2:
>>>>    - Fixed a typo in the commit message of the second patch.
>>>>
>>>> Changes since v1:
>>>>    - Rebased on top of v6.1-rc1
>>>>    - Removed the drm_bridge_connector_enable_hpd() from
>>>>      drm_bridge_connector_init()
>>>>    - Removed extra underscore prefix from
>>>>      drm_bridge_connector_en/disable_hpd() helpers
>>>>
>>>> Dmitry Baryshkov (7):
>>>>     drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
>>>>     drm/probe-helper: enable and disable HPD on connectors
>>>>     drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
>>>>     drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd()
>>>>     drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
>>>>     drm/omap: stop using drm_bridge_connector_en/disable_hpd()
>>>>     drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()
>>>>
>>>>    drivers/gpu/drm/drm_bridge_connector.c   | 27 +++-------------
>>>>    drivers/gpu/drm/drm_probe_helper.c       | 40 ++++++++++++++++++-----
>>>>    drivers/gpu/drm/imx/dcss/dcss-dev.c      |  4 ---
>>>>    drivers/gpu/drm/imx/dcss/dcss-kms.c      |  2 --
>>>>    drivers/gpu/drm/msm/hdmi/hdmi.c          |  2 --
>>>>    drivers/gpu/drm/omapdrm/omap_drv.c       | 41 ------------------------
>>>>    include/drm/drm_bridge_connector.h       |  2 --
>>>>    include/drm/drm_modeset_helper_vtables.h | 22 +++++++++++++
>>>>    8 files changed, 59 insertions(+), 81 deletions(-)
>>>>
>>>> -- 
>>>> 2.35.1
>>>>
>>
>> -- 
>> With best wishes
>> Dmitry
>>

-- 
With best wishes
Dmitry


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [v3,3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
       [not found]   ` <CGME20230111124140eucas1p21242c8b4cb0fc8a994d66827ca76a3ee@eucas1p2.samsung.com>
  2023-01-11 12:41       ` Marek Szyprowski
  (?)
@ 2023-01-11 12:41       ` Marek Szyprowski
  0 siblings, 0 replies; 106+ messages in thread
From: Marek Szyprowski @ 2023-01-11 12:41 UTC (permalink / raw)
  To: Dmitry Baryshkov, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Laurentiu Palcu,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar, Tomi Valkeinen,
	Neil Armstrong
  Cc: linux-arm-msm, freedreno, dri-devel, linux-arm-kernel, linux-amlogic

On 02.11.2022 19:07, Dmitry Baryshkov wrote:
> Use drm_connector's helpers enable_hpd and disable_hpd to enable and
> disable HPD automatically by the means of drm_kms_helper_poll_*
> functions. As the drm_bridge_connector_enable_hpd() and
> drm_bridge_connector_disable_hpd() functions are now unused, replace
> them with stubs to ease driver migration.
>
> Enabling the HPD from drm_bridge_connector_init() can happen too early,
> before the driver is prepared to handle HPD events. As the
> drm_bridge_connector_enable_hpd() is empty anyway, drop this call
> anyway.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

This patch, merged to recent linux-next as commit 92d755d8f13b 
("drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD 
enablement"), triggers the following warning on all my Amlogic Meson 
based boards:

------------[ cut here ]------------
Hot plug detection already enabled
WARNING: CPU: 2 PID: 285 at drivers/gpu/drm/drm_bridge.c:1257 
drm_bridge_hpd_enable+0x90/0xa0
Modules linked in: snd_soc_meson_axg_frddr snd_soc_meson_axg_fifo 
dwmac_generic panfrost(+) reset_meson_audio_arb(+) drm_shmem_helper 
meson_dw_hdmi(+) dw_hdmi rc_odroid drm_display_helper meson_ir(+) 
gpu_sched meson_rng rng_core meson_gxbb_wdt crct10dif_ce dwmac_meson8b 
stmmac_platform snd_soc_meson_axg_sound_card snd_soc_meson_card_utils 
mdio_mux_meson_g12a stmmac meson_drm pwm_meson pcs_xpcs meson_canvas 
snd_soc_meson_axg_tdm_interface rtc_meson_vrtc 
snd_soc_meson_axg_tdm_formatter nvmem_meson_efuse display_connector
CPU: 2 PID: 285 Comm: systemd-udevd Not tainted 6.1.0-rc6+ #13236
Hardware name: Hardkernel ODROID-C4 (DT)
pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : drm_bridge_hpd_enable+0x90/0xa0
lr : drm_bridge_hpd_enable+0x90/0xa0
...
Call trace:
  drm_bridge_hpd_enable+0x90/0xa0
  _drm_bridge_connector_enable_hpd+0x24/0x34
  drm_kms_helper_poll_enable.part.0+0x50/0xd0
  drm_helper_probe_single_connector_modes+0x400/0x530
  drm_client_modeset_probe+0x1ec/0xba0
  __drm_fb_helper_initial_config_and_unlock+0x4c/0x630
  drm_fb_helper_initial_config+0x50/0x60
  drm_fbdev_client_hotplug+0xc4/0x150
  drm_fbdev_generic_setup+0x88/0x150
  meson_drv_bind_master+0x3d4/0x4a0 [meson_drm]
  meson_drv_bind+0x14/0x20 [meson_drm]
  try_to_bring_up_aggregate_device+0x164/0x1d0
  __component_add+0xa8/0x174
  component_add+0x14/0x20
  meson_dw_hdmi_probe+0x1c/0x30 [meson_dw_hdmi]
  platform_probe+0x68/0xe0
  really_probe+0xbc/0x2e0
  __driver_probe_device+0x78/0xe0
  driver_probe_device+0x3c/0x160
  __driver_attach+0x88/0x1a0
  bus_for_each_dev+0x70/0xd0
  driver_attach+0x24/0x30
  bus_add_driver+0x154/0x204
  driver_register+0x78/0x130
  __platform_driver_register+0x28/0x34
  meson_dw_hdmi_platform_driver_init+0x24/0x1000 [meson_dw_hdmi]
  do_one_initcall+0x74/0x400
  do_init_module+0x48/0x1d4
  load_module+0x1818/0x1de0
  __do_sys_finit_module+0xc0/0x114
  __arm64_sys_finit_module+0x20/0x30
  invoke_syscall+0x48/0x114
  el0_svc_common.constprop.0+0x60/0x11c
  do_el0_svc_compat+0x1c/0x40
  el0_svc_compat+0x48/0xc0
  el0t_32_sync_handler+0x90/0x140
  el0t_32_sync+0x190/0x194
irq event stamp: 17422
hardirqs last  enabled at (17421): [<ffff800009196058>] 
__schedule+0x998/0xa14
hardirqs last disabled at (17422): [<ffff80000918e4a4>] el1_dbg+0x24/0x90
softirqs last  enabled at (17404): [<ffff80000801046c>] _stext+0x46c/0x5d8
softirqs last disabled at (17383): [<ffff8000080166d0>] 
____do_softirq+0x10/0x20
---[ end trace 0000000000000000 ]---

I looks that this change requires some additional changes/fixes in the 
drivers/gpu/drm/meson/meson_dw_hdmi.c


>   drivers/gpu/drm/drm_bridge_connector.c | 18 +++++++++++++-----
>   1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
> index 1c7d936523df..0e13bc87a6ac 100644
> --- a/drivers/gpu/drm/drm_bridge_connector.c
> +++ b/drivers/gpu/drm/drm_bridge_connector.c
> @@ -136,6 +136,11 @@ static void drm_bridge_connector_hpd_cb(void *cb_data,
>    * This is typically used by display drivers in their resume handler.
>    */
>   void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
> +{
> +}
> +EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
> +
> +static void _drm_bridge_connector_enable_hpd(struct drm_connector *connector)
>   {
>   	struct drm_bridge_connector *bridge_connector =
>   		to_drm_bridge_connector(connector);
> @@ -145,7 +150,6 @@ void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
>   		drm_bridge_hpd_enable(hpd, drm_bridge_connector_hpd_cb,
>   				      bridge_connector);
>   }
> -EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
>   
>   /**
>    * drm_bridge_connector_disable_hpd - Disable hot-plug detection for the
> @@ -156,6 +160,11 @@ EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
>    * This is typically used by display drivers in their suspend handler.
>    */
>   void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
> +{
> +}
> +EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
> +
> +static void _drm_bridge_connector_disable_hpd(struct drm_connector *connector)
>   {
>   	struct drm_bridge_connector *bridge_connector =
>   		to_drm_bridge_connector(connector);
> @@ -164,7 +173,6 @@ void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
>   	if (hpd)
>   		drm_bridge_hpd_disable(hpd);
>   }
> -EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
>   
>   /* -----------------------------------------------------------------------------
>    * Bridge Connector Functions
> @@ -305,6 +313,8 @@ static int drm_bridge_connector_get_modes(struct drm_connector *connector)
>   static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = {
>   	.get_modes = drm_bridge_connector_get_modes,
>   	/* No need for .mode_valid(), the bridges are checked by the core. */
> +	.enable_hpd = _drm_bridge_connector_enable_hpd,
> +	.disable_hpd = _drm_bridge_connector_disable_hpd,
>   };
>   
>   /* -----------------------------------------------------------------------------
> @@ -387,10 +397,8 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
>   				    connector_type, ddc);
>   	drm_connector_helper_add(connector, &drm_bridge_connector_helper_funcs);
>   
> -	if (bridge_connector->bridge_hpd) {
> +	if (bridge_connector->bridge_hpd)
>   		connector->polled = DRM_CONNECTOR_POLL_HPD;
> -		drm_bridge_connector_enable_hpd(connector);
> -	}
>   	else if (bridge_connector->bridge_detect)
>   		connector->polled = DRM_CONNECTOR_POLL_CONNECT
>   				  | DRM_CONNECTOR_POLL_DISCONNECT;

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


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

* Re: [v3,3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
@ 2023-01-11 12:41       ` Marek Szyprowski
  0 siblings, 0 replies; 106+ messages in thread
From: Marek Szyprowski @ 2023-01-11 12:41 UTC (permalink / raw)
  To: Dmitry Baryshkov, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Laurentiu Palcu,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar, Tomi Valkeinen,
	Neil Armstrong
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel, linux-amlogic

On 02.11.2022 19:07, Dmitry Baryshkov wrote:
> Use drm_connector's helpers enable_hpd and disable_hpd to enable and
> disable HPD automatically by the means of drm_kms_helper_poll_*
> functions. As the drm_bridge_connector_enable_hpd() and
> drm_bridge_connector_disable_hpd() functions are now unused, replace
> them with stubs to ease driver migration.
>
> Enabling the HPD from drm_bridge_connector_init() can happen too early,
> before the driver is prepared to handle HPD events. As the
> drm_bridge_connector_enable_hpd() is empty anyway, drop this call
> anyway.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

This patch, merged to recent linux-next as commit 92d755d8f13b 
("drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD 
enablement"), triggers the following warning on all my Amlogic Meson 
based boards:

------------[ cut here ]------------
Hot plug detection already enabled
WARNING: CPU: 2 PID: 285 at drivers/gpu/drm/drm_bridge.c:1257 
drm_bridge_hpd_enable+0x90/0xa0
Modules linked in: snd_soc_meson_axg_frddr snd_soc_meson_axg_fifo 
dwmac_generic panfrost(+) reset_meson_audio_arb(+) drm_shmem_helper 
meson_dw_hdmi(+) dw_hdmi rc_odroid drm_display_helper meson_ir(+) 
gpu_sched meson_rng rng_core meson_gxbb_wdt crct10dif_ce dwmac_meson8b 
stmmac_platform snd_soc_meson_axg_sound_card snd_soc_meson_card_utils 
mdio_mux_meson_g12a stmmac meson_drm pwm_meson pcs_xpcs meson_canvas 
snd_soc_meson_axg_tdm_interface rtc_meson_vrtc 
snd_soc_meson_axg_tdm_formatter nvmem_meson_efuse display_connector
CPU: 2 PID: 285 Comm: systemd-udevd Not tainted 6.1.0-rc6+ #13236
Hardware name: Hardkernel ODROID-C4 (DT)
pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : drm_bridge_hpd_enable+0x90/0xa0
lr : drm_bridge_hpd_enable+0x90/0xa0
...
Call trace:
  drm_bridge_hpd_enable+0x90/0xa0
  _drm_bridge_connector_enable_hpd+0x24/0x34
  drm_kms_helper_poll_enable.part.0+0x50/0xd0
  drm_helper_probe_single_connector_modes+0x400/0x530
  drm_client_modeset_probe+0x1ec/0xba0
  __drm_fb_helper_initial_config_and_unlock+0x4c/0x630
  drm_fb_helper_initial_config+0x50/0x60
  drm_fbdev_client_hotplug+0xc4/0x150
  drm_fbdev_generic_setup+0x88/0x150
  meson_drv_bind_master+0x3d4/0x4a0 [meson_drm]
  meson_drv_bind+0x14/0x20 [meson_drm]
  try_to_bring_up_aggregate_device+0x164/0x1d0
  __component_add+0xa8/0x174
  component_add+0x14/0x20
  meson_dw_hdmi_probe+0x1c/0x30 [meson_dw_hdmi]
  platform_probe+0x68/0xe0
  really_probe+0xbc/0x2e0
  __driver_probe_device+0x78/0xe0
  driver_probe_device+0x3c/0x160
  __driver_attach+0x88/0x1a0
  bus_for_each_dev+0x70/0xd0
  driver_attach+0x24/0x30
  bus_add_driver+0x154/0x204
  driver_register+0x78/0x130
  __platform_driver_register+0x28/0x34
  meson_dw_hdmi_platform_driver_init+0x24/0x1000 [meson_dw_hdmi]
  do_one_initcall+0x74/0x400
  do_init_module+0x48/0x1d4
  load_module+0x1818/0x1de0
  __do_sys_finit_module+0xc0/0x114
  __arm64_sys_finit_module+0x20/0x30
  invoke_syscall+0x48/0x114
  el0_svc_common.constprop.0+0x60/0x11c
  do_el0_svc_compat+0x1c/0x40
  el0_svc_compat+0x48/0xc0
  el0t_32_sync_handler+0x90/0x140
  el0t_32_sync+0x190/0x194
irq event stamp: 17422
hardirqs last  enabled at (17421): [<ffff800009196058>] 
__schedule+0x998/0xa14
hardirqs last disabled at (17422): [<ffff80000918e4a4>] el1_dbg+0x24/0x90
softirqs last  enabled at (17404): [<ffff80000801046c>] _stext+0x46c/0x5d8
softirqs last disabled at (17383): [<ffff8000080166d0>] 
____do_softirq+0x10/0x20
---[ end trace 0000000000000000 ]---

I looks that this change requires some additional changes/fixes in the 
drivers/gpu/drm/meson/meson_dw_hdmi.c


>   drivers/gpu/drm/drm_bridge_connector.c | 18 +++++++++++++-----
>   1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
> index 1c7d936523df..0e13bc87a6ac 100644
> --- a/drivers/gpu/drm/drm_bridge_connector.c
> +++ b/drivers/gpu/drm/drm_bridge_connector.c
> @@ -136,6 +136,11 @@ static void drm_bridge_connector_hpd_cb(void *cb_data,
>    * This is typically used by display drivers in their resume handler.
>    */
>   void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
> +{
> +}
> +EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
> +
> +static void _drm_bridge_connector_enable_hpd(struct drm_connector *connector)
>   {
>   	struct drm_bridge_connector *bridge_connector =
>   		to_drm_bridge_connector(connector);
> @@ -145,7 +150,6 @@ void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
>   		drm_bridge_hpd_enable(hpd, drm_bridge_connector_hpd_cb,
>   				      bridge_connector);
>   }
> -EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
>   
>   /**
>    * drm_bridge_connector_disable_hpd - Disable hot-plug detection for the
> @@ -156,6 +160,11 @@ EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
>    * This is typically used by display drivers in their suspend handler.
>    */
>   void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
> +{
> +}
> +EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
> +
> +static void _drm_bridge_connector_disable_hpd(struct drm_connector *connector)
>   {
>   	struct drm_bridge_connector *bridge_connector =
>   		to_drm_bridge_connector(connector);
> @@ -164,7 +173,6 @@ void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
>   	if (hpd)
>   		drm_bridge_hpd_disable(hpd);
>   }
> -EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
>   
>   /* -----------------------------------------------------------------------------
>    * Bridge Connector Functions
> @@ -305,6 +313,8 @@ static int drm_bridge_connector_get_modes(struct drm_connector *connector)
>   static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = {
>   	.get_modes = drm_bridge_connector_get_modes,
>   	/* No need for .mode_valid(), the bridges are checked by the core. */
> +	.enable_hpd = _drm_bridge_connector_enable_hpd,
> +	.disable_hpd = _drm_bridge_connector_disable_hpd,
>   };
>   
>   /* -----------------------------------------------------------------------------
> @@ -387,10 +397,8 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
>   				    connector_type, ddc);
>   	drm_connector_helper_add(connector, &drm_bridge_connector_helper_funcs);
>   
> -	if (bridge_connector->bridge_hpd) {
> +	if (bridge_connector->bridge_hpd)
>   		connector->polled = DRM_CONNECTOR_POLL_HPD;
> -		drm_bridge_connector_enable_hpd(connector);
> -	}
>   	else if (bridge_connector->bridge_detect)
>   		connector->polled = DRM_CONNECTOR_POLL_CONNECT
>   				  | DRM_CONNECTOR_POLL_DISCONNECT;

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


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

* Re: [v3,3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
@ 2023-01-11 12:41       ` Marek Szyprowski
  0 siblings, 0 replies; 106+ messages in thread
From: Marek Szyprowski @ 2023-01-11 12:41 UTC (permalink / raw)
  To: Dmitry Baryshkov, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Laurentiu Palcu,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar, Tomi Valkeinen,
	Neil Armstrong
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel, linux-amlogic

On 02.11.2022 19:07, Dmitry Baryshkov wrote:
> Use drm_connector's helpers enable_hpd and disable_hpd to enable and
> disable HPD automatically by the means of drm_kms_helper_poll_*
> functions. As the drm_bridge_connector_enable_hpd() and
> drm_bridge_connector_disable_hpd() functions are now unused, replace
> them with stubs to ease driver migration.
>
> Enabling the HPD from drm_bridge_connector_init() can happen too early,
> before the driver is prepared to handle HPD events. As the
> drm_bridge_connector_enable_hpd() is empty anyway, drop this call
> anyway.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

This patch, merged to recent linux-next as commit 92d755d8f13b 
("drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD 
enablement"), triggers the following warning on all my Amlogic Meson 
based boards:

------------[ cut here ]------------
Hot plug detection already enabled
WARNING: CPU: 2 PID: 285 at drivers/gpu/drm/drm_bridge.c:1257 
drm_bridge_hpd_enable+0x90/0xa0
Modules linked in: snd_soc_meson_axg_frddr snd_soc_meson_axg_fifo 
dwmac_generic panfrost(+) reset_meson_audio_arb(+) drm_shmem_helper 
meson_dw_hdmi(+) dw_hdmi rc_odroid drm_display_helper meson_ir(+) 
gpu_sched meson_rng rng_core meson_gxbb_wdt crct10dif_ce dwmac_meson8b 
stmmac_platform snd_soc_meson_axg_sound_card snd_soc_meson_card_utils 
mdio_mux_meson_g12a stmmac meson_drm pwm_meson pcs_xpcs meson_canvas 
snd_soc_meson_axg_tdm_interface rtc_meson_vrtc 
snd_soc_meson_axg_tdm_formatter nvmem_meson_efuse display_connector
CPU: 2 PID: 285 Comm: systemd-udevd Not tainted 6.1.0-rc6+ #13236
Hardware name: Hardkernel ODROID-C4 (DT)
pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : drm_bridge_hpd_enable+0x90/0xa0
lr : drm_bridge_hpd_enable+0x90/0xa0
...
Call trace:
  drm_bridge_hpd_enable+0x90/0xa0
  _drm_bridge_connector_enable_hpd+0x24/0x34
  drm_kms_helper_poll_enable.part.0+0x50/0xd0
  drm_helper_probe_single_connector_modes+0x400/0x530
  drm_client_modeset_probe+0x1ec/0xba0
  __drm_fb_helper_initial_config_and_unlock+0x4c/0x630
  drm_fb_helper_initial_config+0x50/0x60
  drm_fbdev_client_hotplug+0xc4/0x150
  drm_fbdev_generic_setup+0x88/0x150
  meson_drv_bind_master+0x3d4/0x4a0 [meson_drm]
  meson_drv_bind+0x14/0x20 [meson_drm]
  try_to_bring_up_aggregate_device+0x164/0x1d0
  __component_add+0xa8/0x174
  component_add+0x14/0x20
  meson_dw_hdmi_probe+0x1c/0x30 [meson_dw_hdmi]
  platform_probe+0x68/0xe0
  really_probe+0xbc/0x2e0
  __driver_probe_device+0x78/0xe0
  driver_probe_device+0x3c/0x160
  __driver_attach+0x88/0x1a0
  bus_for_each_dev+0x70/0xd0
  driver_attach+0x24/0x30
  bus_add_driver+0x154/0x204
  driver_register+0x78/0x130
  __platform_driver_register+0x28/0x34
  meson_dw_hdmi_platform_driver_init+0x24/0x1000 [meson_dw_hdmi]
  do_one_initcall+0x74/0x400
  do_init_module+0x48/0x1d4
  load_module+0x1818/0x1de0
  __do_sys_finit_module+0xc0/0x114
  __arm64_sys_finit_module+0x20/0x30
  invoke_syscall+0x48/0x114
  el0_svc_common.constprop.0+0x60/0x11c
  do_el0_svc_compat+0x1c/0x40
  el0_svc_compat+0x48/0xc0
  el0t_32_sync_handler+0x90/0x140
  el0t_32_sync+0x190/0x194
irq event stamp: 17422
hardirqs last  enabled at (17421): [<ffff800009196058>] 
__schedule+0x998/0xa14
hardirqs last disabled at (17422): [<ffff80000918e4a4>] el1_dbg+0x24/0x90
softirqs last  enabled at (17404): [<ffff80000801046c>] _stext+0x46c/0x5d8
softirqs last disabled at (17383): [<ffff8000080166d0>] 
____do_softirq+0x10/0x20
---[ end trace 0000000000000000 ]---

I looks that this change requires some additional changes/fixes in the 
drivers/gpu/drm/meson/meson_dw_hdmi.c


>   drivers/gpu/drm/drm_bridge_connector.c | 18 +++++++++++++-----
>   1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
> index 1c7d936523df..0e13bc87a6ac 100644
> --- a/drivers/gpu/drm/drm_bridge_connector.c
> +++ b/drivers/gpu/drm/drm_bridge_connector.c
> @@ -136,6 +136,11 @@ static void drm_bridge_connector_hpd_cb(void *cb_data,
>    * This is typically used by display drivers in their resume handler.
>    */
>   void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
> +{
> +}
> +EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
> +
> +static void _drm_bridge_connector_enable_hpd(struct drm_connector *connector)
>   {
>   	struct drm_bridge_connector *bridge_connector =
>   		to_drm_bridge_connector(connector);
> @@ -145,7 +150,6 @@ void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
>   		drm_bridge_hpd_enable(hpd, drm_bridge_connector_hpd_cb,
>   				      bridge_connector);
>   }
> -EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
>   
>   /**
>    * drm_bridge_connector_disable_hpd - Disable hot-plug detection for the
> @@ -156,6 +160,11 @@ EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
>    * This is typically used by display drivers in their suspend handler.
>    */
>   void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
> +{
> +}
> +EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
> +
> +static void _drm_bridge_connector_disable_hpd(struct drm_connector *connector)
>   {
>   	struct drm_bridge_connector *bridge_connector =
>   		to_drm_bridge_connector(connector);
> @@ -164,7 +173,6 @@ void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
>   	if (hpd)
>   		drm_bridge_hpd_disable(hpd);
>   }
> -EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
>   
>   /* -----------------------------------------------------------------------------
>    * Bridge Connector Functions
> @@ -305,6 +313,8 @@ static int drm_bridge_connector_get_modes(struct drm_connector *connector)
>   static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = {
>   	.get_modes = drm_bridge_connector_get_modes,
>   	/* No need for .mode_valid(), the bridges are checked by the core. */
> +	.enable_hpd = _drm_bridge_connector_enable_hpd,
> +	.disable_hpd = _drm_bridge_connector_disable_hpd,
>   };
>   
>   /* -----------------------------------------------------------------------------
> @@ -387,10 +397,8 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
>   				    connector_type, ddc);
>   	drm_connector_helper_add(connector, &drm_bridge_connector_helper_funcs);
>   
> -	if (bridge_connector->bridge_hpd) {
> +	if (bridge_connector->bridge_hpd)
>   		connector->polled = DRM_CONNECTOR_POLL_HPD;
> -		drm_bridge_connector_enable_hpd(connector);
> -	}
>   	else if (bridge_connector->bridge_detect)
>   		connector->polled = DRM_CONNECTOR_POLL_CONNECT
>   				  | DRM_CONNECTOR_POLL_DISCONNECT;

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [v3,3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
@ 2023-01-11 12:41       ` Marek Szyprowski
  0 siblings, 0 replies; 106+ messages in thread
From: Marek Szyprowski @ 2023-01-11 12:41 UTC (permalink / raw)
  To: Dmitry Baryshkov, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Laurentiu Palcu,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar, Tomi Valkeinen,
	Neil Armstrong
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel, linux-amlogic

On 02.11.2022 19:07, Dmitry Baryshkov wrote:
> Use drm_connector's helpers enable_hpd and disable_hpd to enable and
> disable HPD automatically by the means of drm_kms_helper_poll_*
> functions. As the drm_bridge_connector_enable_hpd() and
> drm_bridge_connector_disable_hpd() functions are now unused, replace
> them with stubs to ease driver migration.
>
> Enabling the HPD from drm_bridge_connector_init() can happen too early,
> before the driver is prepared to handle HPD events. As the
> drm_bridge_connector_enable_hpd() is empty anyway, drop this call
> anyway.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

This patch, merged to recent linux-next as commit 92d755d8f13b 
("drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD 
enablement"), triggers the following warning on all my Amlogic Meson 
based boards:

------------[ cut here ]------------
Hot plug detection already enabled
WARNING: CPU: 2 PID: 285 at drivers/gpu/drm/drm_bridge.c:1257 
drm_bridge_hpd_enable+0x90/0xa0
Modules linked in: snd_soc_meson_axg_frddr snd_soc_meson_axg_fifo 
dwmac_generic panfrost(+) reset_meson_audio_arb(+) drm_shmem_helper 
meson_dw_hdmi(+) dw_hdmi rc_odroid drm_display_helper meson_ir(+) 
gpu_sched meson_rng rng_core meson_gxbb_wdt crct10dif_ce dwmac_meson8b 
stmmac_platform snd_soc_meson_axg_sound_card snd_soc_meson_card_utils 
mdio_mux_meson_g12a stmmac meson_drm pwm_meson pcs_xpcs meson_canvas 
snd_soc_meson_axg_tdm_interface rtc_meson_vrtc 
snd_soc_meson_axg_tdm_formatter nvmem_meson_efuse display_connector
CPU: 2 PID: 285 Comm: systemd-udevd Not tainted 6.1.0-rc6+ #13236
Hardware name: Hardkernel ODROID-C4 (DT)
pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : drm_bridge_hpd_enable+0x90/0xa0
lr : drm_bridge_hpd_enable+0x90/0xa0
...
Call trace:
  drm_bridge_hpd_enable+0x90/0xa0
  _drm_bridge_connector_enable_hpd+0x24/0x34
  drm_kms_helper_poll_enable.part.0+0x50/0xd0
  drm_helper_probe_single_connector_modes+0x400/0x530
  drm_client_modeset_probe+0x1ec/0xba0
  __drm_fb_helper_initial_config_and_unlock+0x4c/0x630
  drm_fb_helper_initial_config+0x50/0x60
  drm_fbdev_client_hotplug+0xc4/0x150
  drm_fbdev_generic_setup+0x88/0x150
  meson_drv_bind_master+0x3d4/0x4a0 [meson_drm]
  meson_drv_bind+0x14/0x20 [meson_drm]
  try_to_bring_up_aggregate_device+0x164/0x1d0
  __component_add+0xa8/0x174
  component_add+0x14/0x20
  meson_dw_hdmi_probe+0x1c/0x30 [meson_dw_hdmi]
  platform_probe+0x68/0xe0
  really_probe+0xbc/0x2e0
  __driver_probe_device+0x78/0xe0
  driver_probe_device+0x3c/0x160
  __driver_attach+0x88/0x1a0
  bus_for_each_dev+0x70/0xd0
  driver_attach+0x24/0x30
  bus_add_driver+0x154/0x204
  driver_register+0x78/0x130
  __platform_driver_register+0x28/0x34
  meson_dw_hdmi_platform_driver_init+0x24/0x1000 [meson_dw_hdmi]
  do_one_initcall+0x74/0x400
  do_init_module+0x48/0x1d4
  load_module+0x1818/0x1de0
  __do_sys_finit_module+0xc0/0x114
  __arm64_sys_finit_module+0x20/0x30
  invoke_syscall+0x48/0x114
  el0_svc_common.constprop.0+0x60/0x11c
  do_el0_svc_compat+0x1c/0x40
  el0_svc_compat+0x48/0xc0
  el0t_32_sync_handler+0x90/0x140
  el0t_32_sync+0x190/0x194
irq event stamp: 17422
hardirqs last  enabled at (17421): [<ffff800009196058>] 
__schedule+0x998/0xa14
hardirqs last disabled at (17422): [<ffff80000918e4a4>] el1_dbg+0x24/0x90
softirqs last  enabled at (17404): [<ffff80000801046c>] _stext+0x46c/0x5d8
softirqs last disabled at (17383): [<ffff8000080166d0>] 
____do_softirq+0x10/0x20
---[ end trace 0000000000000000 ]---

I looks that this change requires some additional changes/fixes in the 
drivers/gpu/drm/meson/meson_dw_hdmi.c


>   drivers/gpu/drm/drm_bridge_connector.c | 18 +++++++++++++-----
>   1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
> index 1c7d936523df..0e13bc87a6ac 100644
> --- a/drivers/gpu/drm/drm_bridge_connector.c
> +++ b/drivers/gpu/drm/drm_bridge_connector.c
> @@ -136,6 +136,11 @@ static void drm_bridge_connector_hpd_cb(void *cb_data,
>    * This is typically used by display drivers in their resume handler.
>    */
>   void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
> +{
> +}
> +EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
> +
> +static void _drm_bridge_connector_enable_hpd(struct drm_connector *connector)
>   {
>   	struct drm_bridge_connector *bridge_connector =
>   		to_drm_bridge_connector(connector);
> @@ -145,7 +150,6 @@ void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
>   		drm_bridge_hpd_enable(hpd, drm_bridge_connector_hpd_cb,
>   				      bridge_connector);
>   }
> -EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
>   
>   /**
>    * drm_bridge_connector_disable_hpd - Disable hot-plug detection for the
> @@ -156,6 +160,11 @@ EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
>    * This is typically used by display drivers in their suspend handler.
>    */
>   void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
> +{
> +}
> +EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
> +
> +static void _drm_bridge_connector_disable_hpd(struct drm_connector *connector)
>   {
>   	struct drm_bridge_connector *bridge_connector =
>   		to_drm_bridge_connector(connector);
> @@ -164,7 +173,6 @@ void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
>   	if (hpd)
>   		drm_bridge_hpd_disable(hpd);
>   }
> -EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
>   
>   /* -----------------------------------------------------------------------------
>    * Bridge Connector Functions
> @@ -305,6 +313,8 @@ static int drm_bridge_connector_get_modes(struct drm_connector *connector)
>   static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = {
>   	.get_modes = drm_bridge_connector_get_modes,
>   	/* No need for .mode_valid(), the bridges are checked by the core. */
> +	.enable_hpd = _drm_bridge_connector_enable_hpd,
> +	.disable_hpd = _drm_bridge_connector_disable_hpd,
>   };
>   
>   /* -----------------------------------------------------------------------------
> @@ -387,10 +397,8 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
>   				    connector_type, ddc);
>   	drm_connector_helper_add(connector, &drm_bridge_connector_helper_funcs);
>   
> -	if (bridge_connector->bridge_hpd) {
> +	if (bridge_connector->bridge_hpd)
>   		connector->polled = DRM_CONNECTOR_POLL_HPD;
> -		drm_bridge_connector_enable_hpd(connector);
> -	}
>   	else if (bridge_connector->bridge_detect)
>   		connector->polled = DRM_CONNECTOR_POLL_CONNECT
>   				  | DRM_CONNECTOR_POLL_DISCONNECT;

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [v3, 3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
  2023-01-11 12:41       ` Marek Szyprowski
  (?)
  (?)
@ 2023-01-12  9:35         ` Neil Armstrong
  -1 siblings, 0 replies; 106+ messages in thread
From: Neil Armstrong @ 2023-01-12  9:35 UTC (permalink / raw)
  To: Marek Szyprowski, Dmitry Baryshkov, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Laurentiu Palcu, Lucas Stach, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar,
	Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, dri-devel, linux-arm-kernel, linux-amlogic

On 11/01/2023 13:41, Marek Szyprowski wrote:
> On 02.11.2022 19:07, Dmitry Baryshkov wrote:
>> Use drm_connector's helpers enable_hpd and disable_hpd to enable and
>> disable HPD automatically by the means of drm_kms_helper_poll_*
>> functions. As the drm_bridge_connector_enable_hpd() and
>> drm_bridge_connector_disable_hpd() functions are now unused, replace
>> them with stubs to ease driver migration.
>>
>> Enabling the HPD from drm_bridge_connector_init() can happen too early,
>> before the driver is prepared to handle HPD events. As the
>> drm_bridge_connector_enable_hpd() is empty anyway, drop this call
>> anyway.
>>
>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>> ---
> 
> This patch, merged to recent linux-next as commit 92d755d8f13b
> ("drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD
> enablement"), triggers the following warning on all my Amlogic Meson
> based boards:
> 
> ------------[ cut here ]------------
> Hot plug detection already enabled
> WARNING: CPU: 2 PID: 285 at drivers/gpu/drm/drm_bridge.c:1257
> drm_bridge_hpd_enable+0x90/0xa0
> Modules linked in: snd_soc_meson_axg_frddr snd_soc_meson_axg_fifo
> dwmac_generic panfrost(+) reset_meson_audio_arb(+) drm_shmem_helper
> meson_dw_hdmi(+) dw_hdmi rc_odroid drm_display_helper meson_ir(+)
> gpu_sched meson_rng rng_core meson_gxbb_wdt crct10dif_ce dwmac_meson8b
> stmmac_platform snd_soc_meson_axg_sound_card snd_soc_meson_card_utils
> mdio_mux_meson_g12a stmmac meson_drm pwm_meson pcs_xpcs meson_canvas
> snd_soc_meson_axg_tdm_interface rtc_meson_vrtc
> snd_soc_meson_axg_tdm_formatter nvmem_meson_efuse display_connector
> CPU: 2 PID: 285 Comm: systemd-udevd Not tainted 6.1.0-rc6+ #13236
> Hardware name: Hardkernel ODROID-C4 (DT)
> pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> pc : drm_bridge_hpd_enable+0x90/0xa0
> lr : drm_bridge_hpd_enable+0x90/0xa0
> ...
> Call trace:
>    drm_bridge_hpd_enable+0x90/0xa0
>    _drm_bridge_connector_enable_hpd+0x24/0x34

Weird because _drm_bridge_connector_enable_hpd() has been removed with
4c00ac500d0e ("drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()")


>    drm_kms_helper_poll_enable.part.0+0x50/0xd0

It seems drm_kms_helper_poll_enable is called again by
drm_helper_probe_single_connector_modes() because poll_running isn't set.

Can you try with this change:
===============><===========================================
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index 7973f2589ced..5d60d4fd868f 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -245,7 +245,7 @@ void drm_kms_helper_poll_enable(struct drm_device *dev)
  	struct drm_connector_list_iter conn_iter;
  	unsigned long delay = DRM_OUTPUT_POLL_PERIOD;

-	if (!dev->mode_config.poll_enabled || !drm_kms_helper_poll)
+	if (!dev->mode_config.poll_init || !drm_kms_helper_poll || dev->mode_config.poll_enabled)
  		return;

  	drm_connector_list_iter_begin(dev, &conn_iter);
@@ -279,6 +279,8 @@ void drm_kms_helper_poll_enable(struct drm_device *dev)

  	if (poll)
  		schedule_delayed_work(&dev->mode_config.output_poll_work, delay);
+
+	dev->mode_config.poll_enabled = true;
  }
  EXPORT_SYMBOL(drm_kms_helper_poll_enable);

@@ -561,7 +563,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
  		 * disable itself again.
  		 */
  		dev->mode_config.delayed_event = true;
-		if (dev->mode_config.poll_enabled)
+		if (dev->mode_config.poll_init)
  			schedule_delayed_work(&dev->mode_config.output_poll_work,
  					      0);
  	}
@@ -703,7 +705,7 @@ static void output_poll_execute(struct work_struct *work)
  	bool repoll = false, changed;
  	u64 old_epoch_counter;

-	if (!dev->mode_config.poll_enabled)
+	if (!dev->mode_config.poll_init)
  		return;

  	/* Pick up any changes detected by the probe functions. */
@@ -813,11 +815,11 @@ static void drm_kms_helper_poll_disable_fini(struct drm_device *dev, bool fini)
  	struct drm_connector *connector;
  	struct drm_connector_list_iter conn_iter;

-	if (!dev->mode_config.poll_enabled)
+	if (!dev->mode_config.poll_init || !dev->mode_config.poll_enabled)
  		return;

  	if (fini)
-		dev->mode_config.poll_enabled = false;
+		dev->mode_config.poll_init = false;

  	drm_connector_list_iter_begin(dev, &conn_iter);
  	drm_for_each_connector_iter(connector, &conn_iter) {
@@ -830,6 +832,8 @@ static void drm_kms_helper_poll_disable_fini(struct drm_device *dev, bool fini)
  	drm_connector_list_iter_end(&conn_iter);

  	cancel_delayed_work_sync(&dev->mode_config.output_poll_work);
+
+	dev->mode_config.poll_enabled = false;
  }

  /**
@@ -874,7 +878,7 @@ EXPORT_SYMBOL(drm_kms_helper_poll_disable);
  void drm_kms_helper_poll_init(struct drm_device *dev)
  {
  	INIT_DELAYED_WORK(&dev->mode_config.output_poll_work, output_poll_execute);
-	dev->mode_config.poll_enabled = true;
+	dev->mode_config.poll_init = true;

  	drm_kms_helper_poll_enable(dev);
  }
@@ -1003,7 +1007,7 @@ bool drm_helper_hpd_irq_event(struct drm_device *dev)
  	struct drm_connector_list_iter conn_iter;
  	int changed = 0;

-	if (!dev->mode_config.poll_enabled)
+	if (!dev->mode_config.poll_init)
  		return false;

  	mutex_lock(&dev->mode_config.mutex);
diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
index e5b053001d22..86c5f66f1a6c 100644
--- a/include/drm/drm_mode_config.h
+++ b/include/drm/drm_mode_config.h
@@ -345,6 +345,7 @@ struct drm_mode_config_funcs {
   * @max_width: maximum fb pixel width on this device
   * @max_height: maximum fb pixel height on this device
   * @funcs: core driver provided mode setting functions
+ * @poll_init: track polling initialization for this device
   * @poll_enabled: track polling support for this device
   * @poll_running: track polling status for this device
   * @delayed_event: track delayed poll uevent deliver for this device
@@ -543,6 +544,7 @@ struct drm_mode_config {
  	const struct drm_mode_config_funcs *funcs;

  	/* output poll support */
+	bool poll_init;
  	bool poll_enabled;
  	bool poll_running;
  	bool delayed_event;
===============><===========================================

Neil

>    drm_helper_probe_single_connector_modes+0x400/0x530
>    drm_client_modeset_probe+0x1ec/0xba0
>    __drm_fb_helper_initial_config_and_unlock+0x4c/0x630
>    drm_fb_helper_initial_config+0x50/0x60
>    drm_fbdev_client_hotplug+0xc4/0x150
>    drm_fbdev_generic_setup+0x88/0x150
>    meson_drv_bind_master+0x3d4/0x4a0 [meson_drm]
>    meson_drv_bind+0x14/0x20 [meson_drm]
>    try_to_bring_up_aggregate_device+0x164/0x1d0
>    __component_add+0xa8/0x174
>    component_add+0x14/0x20
>    meson_dw_hdmi_probe+0x1c/0x30 [meson_dw_hdmi]
>    platform_probe+0x68/0xe0
>    really_probe+0xbc/0x2e0
>    __driver_probe_device+0x78/0xe0
>    driver_probe_device+0x3c/0x160
>    __driver_attach+0x88/0x1a0
>    bus_for_each_dev+0x70/0xd0
>    driver_attach+0x24/0x30
>    bus_add_driver+0x154/0x204
>    driver_register+0x78/0x130
>    __platform_driver_register+0x28/0x34
>    meson_dw_hdmi_platform_driver_init+0x24/0x1000 [meson_dw_hdmi]
>    do_one_initcall+0x74/0x400
>    do_init_module+0x48/0x1d4
>    load_module+0x1818/0x1de0
>    __do_sys_finit_module+0xc0/0x114
>    __arm64_sys_finit_module+0x20/0x30
>    invoke_syscall+0x48/0x114
>    el0_svc_common.constprop.0+0x60/0x11c
>    do_el0_svc_compat+0x1c/0x40
>    el0_svc_compat+0x48/0xc0
>    el0t_32_sync_handler+0x90/0x140
>    el0t_32_sync+0x190/0x194
> irq event stamp: 17422
> hardirqs last  enabled at (17421): [<ffff800009196058>]
> __schedule+0x998/0xa14
> hardirqs last disabled at (17422): [<ffff80000918e4a4>] el1_dbg+0x24/0x90
> softirqs last  enabled at (17404): [<ffff80000801046c>] _stext+0x46c/0x5d8
> softirqs last disabled at (17383): [<ffff8000080166d0>]
> ____do_softirq+0x10/0x20
> ---[ end trace 0000000000000000 ]---
> 
> I looks that this change requires some additional changes/fixes in the
> drivers/gpu/drm/meson/meson_dw_hdmi.c
> 
> 
>>    drivers/gpu/drm/drm_bridge_connector.c | 18 +++++++++++++-----
>>    1 file changed, 13 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
>> index 1c7d936523df..0e13bc87a6ac 100644
>> --- a/drivers/gpu/drm/drm_bridge_connector.c
>> +++ b/drivers/gpu/drm/drm_bridge_connector.c
>> @@ -136,6 +136,11 @@ static void drm_bridge_connector_hpd_cb(void *cb_data,
>>     * This is typically used by display drivers in their resume handler.
>>     */
>>    void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
>> +{
>> +}
>> +EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
>> +
>> +static void _drm_bridge_connector_enable_hpd(struct drm_connector *connector)
>>    {
>>    	struct drm_bridge_connector *bridge_connector =
>>    		to_drm_bridge_connector(connector);
>> @@ -145,7 +150,6 @@ void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
>>    		drm_bridge_hpd_enable(hpd, drm_bridge_connector_hpd_cb,
>>    				      bridge_connector);
>>    }
>> -EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
>>    
>>    /**
>>     * drm_bridge_connector_disable_hpd - Disable hot-plug detection for the
>> @@ -156,6 +160,11 @@ EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
>>     * This is typically used by display drivers in their suspend handler.
>>     */
>>    void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
>> +{
>> +}
>> +EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
>> +
>> +static void _drm_bridge_connector_disable_hpd(struct drm_connector *connector)
>>    {
>>    	struct drm_bridge_connector *bridge_connector =
>>    		to_drm_bridge_connector(connector);
>> @@ -164,7 +173,6 @@ void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
>>    	if (hpd)
>>    		drm_bridge_hpd_disable(hpd);
>>    }
>> -EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
>>    
>>    /* -----------------------------------------------------------------------------
>>     * Bridge Connector Functions
>> @@ -305,6 +313,8 @@ static int drm_bridge_connector_get_modes(struct drm_connector *connector)
>>    static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = {
>>    	.get_modes = drm_bridge_connector_get_modes,
>>    	/* No need for .mode_valid(), the bridges are checked by the core. */
>> +	.enable_hpd = _drm_bridge_connector_enable_hpd,
>> +	.disable_hpd = _drm_bridge_connector_disable_hpd,
>>    };
>>    
>>    /* -----------------------------------------------------------------------------
>> @@ -387,10 +397,8 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
>>    				    connector_type, ddc);
>>    	drm_connector_helper_add(connector, &drm_bridge_connector_helper_funcs);
>>    
>> -	if (bridge_connector->bridge_hpd) {
>> +	if (bridge_connector->bridge_hpd)
>>    		connector->polled = DRM_CONNECTOR_POLL_HPD;
>> -		drm_bridge_connector_enable_hpd(connector);
>> -	}
>>    	else if (bridge_connector->bridge_detect)
>>    		connector->polled = DRM_CONNECTOR_POLL_CONNECT
>>    				  | DRM_CONNECTOR_POLL_DISCONNECT;
> 
> Best regards


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

* Re: [v3,3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
@ 2023-01-12  9:35         ` Neil Armstrong
  0 siblings, 0 replies; 106+ messages in thread
From: Neil Armstrong @ 2023-01-12  9:35 UTC (permalink / raw)
  To: Marek Szyprowski, Dmitry Baryshkov, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Laurentiu Palcu, Lucas Stach, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar,
	Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel, linux-amlogic

On 11/01/2023 13:41, Marek Szyprowski wrote:
> On 02.11.2022 19:07, Dmitry Baryshkov wrote:
>> Use drm_connector's helpers enable_hpd and disable_hpd to enable and
>> disable HPD automatically by the means of drm_kms_helper_poll_*
>> functions. As the drm_bridge_connector_enable_hpd() and
>> drm_bridge_connector_disable_hpd() functions are now unused, replace
>> them with stubs to ease driver migration.
>>
>> Enabling the HPD from drm_bridge_connector_init() can happen too early,
>> before the driver is prepared to handle HPD events. As the
>> drm_bridge_connector_enable_hpd() is empty anyway, drop this call
>> anyway.
>>
>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>> ---
> 
> This patch, merged to recent linux-next as commit 92d755d8f13b
> ("drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD
> enablement"), triggers the following warning on all my Amlogic Meson
> based boards:
> 
> ------------[ cut here ]------------
> Hot plug detection already enabled
> WARNING: CPU: 2 PID: 285 at drivers/gpu/drm/drm_bridge.c:1257
> drm_bridge_hpd_enable+0x90/0xa0
> Modules linked in: snd_soc_meson_axg_frddr snd_soc_meson_axg_fifo
> dwmac_generic panfrost(+) reset_meson_audio_arb(+) drm_shmem_helper
> meson_dw_hdmi(+) dw_hdmi rc_odroid drm_display_helper meson_ir(+)
> gpu_sched meson_rng rng_core meson_gxbb_wdt crct10dif_ce dwmac_meson8b
> stmmac_platform snd_soc_meson_axg_sound_card snd_soc_meson_card_utils
> mdio_mux_meson_g12a stmmac meson_drm pwm_meson pcs_xpcs meson_canvas
> snd_soc_meson_axg_tdm_interface rtc_meson_vrtc
> snd_soc_meson_axg_tdm_formatter nvmem_meson_efuse display_connector
> CPU: 2 PID: 285 Comm: systemd-udevd Not tainted 6.1.0-rc6+ #13236
> Hardware name: Hardkernel ODROID-C4 (DT)
> pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> pc : drm_bridge_hpd_enable+0x90/0xa0
> lr : drm_bridge_hpd_enable+0x90/0xa0
> ...
> Call trace:
>    drm_bridge_hpd_enable+0x90/0xa0
>    _drm_bridge_connector_enable_hpd+0x24/0x34

Weird because _drm_bridge_connector_enable_hpd() has been removed with
4c00ac500d0e ("drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()")


>    drm_kms_helper_poll_enable.part.0+0x50/0xd0

It seems drm_kms_helper_poll_enable is called again by
drm_helper_probe_single_connector_modes() because poll_running isn't set.

Can you try with this change:
===============><===========================================
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index 7973f2589ced..5d60d4fd868f 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -245,7 +245,7 @@ void drm_kms_helper_poll_enable(struct drm_device *dev)
  	struct drm_connector_list_iter conn_iter;
  	unsigned long delay = DRM_OUTPUT_POLL_PERIOD;

-	if (!dev->mode_config.poll_enabled || !drm_kms_helper_poll)
+	if (!dev->mode_config.poll_init || !drm_kms_helper_poll || dev->mode_config.poll_enabled)
  		return;

  	drm_connector_list_iter_begin(dev, &conn_iter);
@@ -279,6 +279,8 @@ void drm_kms_helper_poll_enable(struct drm_device *dev)

  	if (poll)
  		schedule_delayed_work(&dev->mode_config.output_poll_work, delay);
+
+	dev->mode_config.poll_enabled = true;
  }
  EXPORT_SYMBOL(drm_kms_helper_poll_enable);

@@ -561,7 +563,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
  		 * disable itself again.
  		 */
  		dev->mode_config.delayed_event = true;
-		if (dev->mode_config.poll_enabled)
+		if (dev->mode_config.poll_init)
  			schedule_delayed_work(&dev->mode_config.output_poll_work,
  					      0);
  	}
@@ -703,7 +705,7 @@ static void output_poll_execute(struct work_struct *work)
  	bool repoll = false, changed;
  	u64 old_epoch_counter;

-	if (!dev->mode_config.poll_enabled)
+	if (!dev->mode_config.poll_init)
  		return;

  	/* Pick up any changes detected by the probe functions. */
@@ -813,11 +815,11 @@ static void drm_kms_helper_poll_disable_fini(struct drm_device *dev, bool fini)
  	struct drm_connector *connector;
  	struct drm_connector_list_iter conn_iter;

-	if (!dev->mode_config.poll_enabled)
+	if (!dev->mode_config.poll_init || !dev->mode_config.poll_enabled)
  		return;

  	if (fini)
-		dev->mode_config.poll_enabled = false;
+		dev->mode_config.poll_init = false;

  	drm_connector_list_iter_begin(dev, &conn_iter);
  	drm_for_each_connector_iter(connector, &conn_iter) {
@@ -830,6 +832,8 @@ static void drm_kms_helper_poll_disable_fini(struct drm_device *dev, bool fini)
  	drm_connector_list_iter_end(&conn_iter);

  	cancel_delayed_work_sync(&dev->mode_config.output_poll_work);
+
+	dev->mode_config.poll_enabled = false;
  }

  /**
@@ -874,7 +878,7 @@ EXPORT_SYMBOL(drm_kms_helper_poll_disable);
  void drm_kms_helper_poll_init(struct drm_device *dev)
  {
  	INIT_DELAYED_WORK(&dev->mode_config.output_poll_work, output_poll_execute);
-	dev->mode_config.poll_enabled = true;
+	dev->mode_config.poll_init = true;

  	drm_kms_helper_poll_enable(dev);
  }
@@ -1003,7 +1007,7 @@ bool drm_helper_hpd_irq_event(struct drm_device *dev)
  	struct drm_connector_list_iter conn_iter;
  	int changed = 0;

-	if (!dev->mode_config.poll_enabled)
+	if (!dev->mode_config.poll_init)
  		return false;

  	mutex_lock(&dev->mode_config.mutex);
diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
index e5b053001d22..86c5f66f1a6c 100644
--- a/include/drm/drm_mode_config.h
+++ b/include/drm/drm_mode_config.h
@@ -345,6 +345,7 @@ struct drm_mode_config_funcs {
   * @max_width: maximum fb pixel width on this device
   * @max_height: maximum fb pixel height on this device
   * @funcs: core driver provided mode setting functions
+ * @poll_init: track polling initialization for this device
   * @poll_enabled: track polling support for this device
   * @poll_running: track polling status for this device
   * @delayed_event: track delayed poll uevent deliver for this device
@@ -543,6 +544,7 @@ struct drm_mode_config {
  	const struct drm_mode_config_funcs *funcs;

  	/* output poll support */
+	bool poll_init;
  	bool poll_enabled;
  	bool poll_running;
  	bool delayed_event;
===============><===========================================

Neil

>    drm_helper_probe_single_connector_modes+0x400/0x530
>    drm_client_modeset_probe+0x1ec/0xba0
>    __drm_fb_helper_initial_config_and_unlock+0x4c/0x630
>    drm_fb_helper_initial_config+0x50/0x60
>    drm_fbdev_client_hotplug+0xc4/0x150
>    drm_fbdev_generic_setup+0x88/0x150
>    meson_drv_bind_master+0x3d4/0x4a0 [meson_drm]
>    meson_drv_bind+0x14/0x20 [meson_drm]
>    try_to_bring_up_aggregate_device+0x164/0x1d0
>    __component_add+0xa8/0x174
>    component_add+0x14/0x20
>    meson_dw_hdmi_probe+0x1c/0x30 [meson_dw_hdmi]
>    platform_probe+0x68/0xe0
>    really_probe+0xbc/0x2e0
>    __driver_probe_device+0x78/0xe0
>    driver_probe_device+0x3c/0x160
>    __driver_attach+0x88/0x1a0
>    bus_for_each_dev+0x70/0xd0
>    driver_attach+0x24/0x30
>    bus_add_driver+0x154/0x204
>    driver_register+0x78/0x130
>    __platform_driver_register+0x28/0x34
>    meson_dw_hdmi_platform_driver_init+0x24/0x1000 [meson_dw_hdmi]
>    do_one_initcall+0x74/0x400
>    do_init_module+0x48/0x1d4
>    load_module+0x1818/0x1de0
>    __do_sys_finit_module+0xc0/0x114
>    __arm64_sys_finit_module+0x20/0x30
>    invoke_syscall+0x48/0x114
>    el0_svc_common.constprop.0+0x60/0x11c
>    do_el0_svc_compat+0x1c/0x40
>    el0_svc_compat+0x48/0xc0
>    el0t_32_sync_handler+0x90/0x140
>    el0t_32_sync+0x190/0x194
> irq event stamp: 17422
> hardirqs last  enabled at (17421): [<ffff800009196058>]
> __schedule+0x998/0xa14
> hardirqs last disabled at (17422): [<ffff80000918e4a4>] el1_dbg+0x24/0x90
> softirqs last  enabled at (17404): [<ffff80000801046c>] _stext+0x46c/0x5d8
> softirqs last disabled at (17383): [<ffff8000080166d0>]
> ____do_softirq+0x10/0x20
> ---[ end trace 0000000000000000 ]---
> 
> I looks that this change requires some additional changes/fixes in the
> drivers/gpu/drm/meson/meson_dw_hdmi.c
> 
> 
>>    drivers/gpu/drm/drm_bridge_connector.c | 18 +++++++++++++-----
>>    1 file changed, 13 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
>> index 1c7d936523df..0e13bc87a6ac 100644
>> --- a/drivers/gpu/drm/drm_bridge_connector.c
>> +++ b/drivers/gpu/drm/drm_bridge_connector.c
>> @@ -136,6 +136,11 @@ static void drm_bridge_connector_hpd_cb(void *cb_data,
>>     * This is typically used by display drivers in their resume handler.
>>     */
>>    void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
>> +{
>> +}
>> +EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
>> +
>> +static void _drm_bridge_connector_enable_hpd(struct drm_connector *connector)
>>    {
>>    	struct drm_bridge_connector *bridge_connector =
>>    		to_drm_bridge_connector(connector);
>> @@ -145,7 +150,6 @@ void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
>>    		drm_bridge_hpd_enable(hpd, drm_bridge_connector_hpd_cb,
>>    				      bridge_connector);
>>    }
>> -EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
>>    
>>    /**
>>     * drm_bridge_connector_disable_hpd - Disable hot-plug detection for the
>> @@ -156,6 +160,11 @@ EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
>>     * This is typically used by display drivers in their suspend handler.
>>     */
>>    void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
>> +{
>> +}
>> +EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
>> +
>> +static void _drm_bridge_connector_disable_hpd(struct drm_connector *connector)
>>    {
>>    	struct drm_bridge_connector *bridge_connector =
>>    		to_drm_bridge_connector(connector);
>> @@ -164,7 +173,6 @@ void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
>>    	if (hpd)
>>    		drm_bridge_hpd_disable(hpd);
>>    }
>> -EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
>>    
>>    /* -----------------------------------------------------------------------------
>>     * Bridge Connector Functions
>> @@ -305,6 +313,8 @@ static int drm_bridge_connector_get_modes(struct drm_connector *connector)
>>    static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = {
>>    	.get_modes = drm_bridge_connector_get_modes,
>>    	/* No need for .mode_valid(), the bridges are checked by the core. */
>> +	.enable_hpd = _drm_bridge_connector_enable_hpd,
>> +	.disable_hpd = _drm_bridge_connector_disable_hpd,
>>    };
>>    
>>    /* -----------------------------------------------------------------------------
>> @@ -387,10 +397,8 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
>>    				    connector_type, ddc);
>>    	drm_connector_helper_add(connector, &drm_bridge_connector_helper_funcs);
>>    
>> -	if (bridge_connector->bridge_hpd) {
>> +	if (bridge_connector->bridge_hpd)
>>    		connector->polled = DRM_CONNECTOR_POLL_HPD;
>> -		drm_bridge_connector_enable_hpd(connector);
>> -	}
>>    	else if (bridge_connector->bridge_detect)
>>    		connector->polled = DRM_CONNECTOR_POLL_CONNECT
>>    				  | DRM_CONNECTOR_POLL_DISCONNECT;
> 
> Best regards


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [v3,3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
@ 2023-01-12  9:35         ` Neil Armstrong
  0 siblings, 0 replies; 106+ messages in thread
From: Neil Armstrong @ 2023-01-12  9:35 UTC (permalink / raw)
  To: Marek Szyprowski, Dmitry Baryshkov, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Laurentiu Palcu, Lucas Stach, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar,
	Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel, linux-amlogic

On 11/01/2023 13:41, Marek Szyprowski wrote:
> On 02.11.2022 19:07, Dmitry Baryshkov wrote:
>> Use drm_connector's helpers enable_hpd and disable_hpd to enable and
>> disable HPD automatically by the means of drm_kms_helper_poll_*
>> functions. As the drm_bridge_connector_enable_hpd() and
>> drm_bridge_connector_disable_hpd() functions are now unused, replace
>> them with stubs to ease driver migration.
>>
>> Enabling the HPD from drm_bridge_connector_init() can happen too early,
>> before the driver is prepared to handle HPD events. As the
>> drm_bridge_connector_enable_hpd() is empty anyway, drop this call
>> anyway.
>>
>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>> ---
> 
> This patch, merged to recent linux-next as commit 92d755d8f13b
> ("drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD
> enablement"), triggers the following warning on all my Amlogic Meson
> based boards:
> 
> ------------[ cut here ]------------
> Hot plug detection already enabled
> WARNING: CPU: 2 PID: 285 at drivers/gpu/drm/drm_bridge.c:1257
> drm_bridge_hpd_enable+0x90/0xa0
> Modules linked in: snd_soc_meson_axg_frddr snd_soc_meson_axg_fifo
> dwmac_generic panfrost(+) reset_meson_audio_arb(+) drm_shmem_helper
> meson_dw_hdmi(+) dw_hdmi rc_odroid drm_display_helper meson_ir(+)
> gpu_sched meson_rng rng_core meson_gxbb_wdt crct10dif_ce dwmac_meson8b
> stmmac_platform snd_soc_meson_axg_sound_card snd_soc_meson_card_utils
> mdio_mux_meson_g12a stmmac meson_drm pwm_meson pcs_xpcs meson_canvas
> snd_soc_meson_axg_tdm_interface rtc_meson_vrtc
> snd_soc_meson_axg_tdm_formatter nvmem_meson_efuse display_connector
> CPU: 2 PID: 285 Comm: systemd-udevd Not tainted 6.1.0-rc6+ #13236
> Hardware name: Hardkernel ODROID-C4 (DT)
> pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> pc : drm_bridge_hpd_enable+0x90/0xa0
> lr : drm_bridge_hpd_enable+0x90/0xa0
> ...
> Call trace:
>    drm_bridge_hpd_enable+0x90/0xa0
>    _drm_bridge_connector_enable_hpd+0x24/0x34

Weird because _drm_bridge_connector_enable_hpd() has been removed with
4c00ac500d0e ("drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()")


>    drm_kms_helper_poll_enable.part.0+0x50/0xd0

It seems drm_kms_helper_poll_enable is called again by
drm_helper_probe_single_connector_modes() because poll_running isn't set.

Can you try with this change:
===============><===========================================
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index 7973f2589ced..5d60d4fd868f 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -245,7 +245,7 @@ void drm_kms_helper_poll_enable(struct drm_device *dev)
  	struct drm_connector_list_iter conn_iter;
  	unsigned long delay = DRM_OUTPUT_POLL_PERIOD;

-	if (!dev->mode_config.poll_enabled || !drm_kms_helper_poll)
+	if (!dev->mode_config.poll_init || !drm_kms_helper_poll || dev->mode_config.poll_enabled)
  		return;

  	drm_connector_list_iter_begin(dev, &conn_iter);
@@ -279,6 +279,8 @@ void drm_kms_helper_poll_enable(struct drm_device *dev)

  	if (poll)
  		schedule_delayed_work(&dev->mode_config.output_poll_work, delay);
+
+	dev->mode_config.poll_enabled = true;
  }
  EXPORT_SYMBOL(drm_kms_helper_poll_enable);

@@ -561,7 +563,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
  		 * disable itself again.
  		 */
  		dev->mode_config.delayed_event = true;
-		if (dev->mode_config.poll_enabled)
+		if (dev->mode_config.poll_init)
  			schedule_delayed_work(&dev->mode_config.output_poll_work,
  					      0);
  	}
@@ -703,7 +705,7 @@ static void output_poll_execute(struct work_struct *work)
  	bool repoll = false, changed;
  	u64 old_epoch_counter;

-	if (!dev->mode_config.poll_enabled)
+	if (!dev->mode_config.poll_init)
  		return;

  	/* Pick up any changes detected by the probe functions. */
@@ -813,11 +815,11 @@ static void drm_kms_helper_poll_disable_fini(struct drm_device *dev, bool fini)
  	struct drm_connector *connector;
  	struct drm_connector_list_iter conn_iter;

-	if (!dev->mode_config.poll_enabled)
+	if (!dev->mode_config.poll_init || !dev->mode_config.poll_enabled)
  		return;

  	if (fini)
-		dev->mode_config.poll_enabled = false;
+		dev->mode_config.poll_init = false;

  	drm_connector_list_iter_begin(dev, &conn_iter);
  	drm_for_each_connector_iter(connector, &conn_iter) {
@@ -830,6 +832,8 @@ static void drm_kms_helper_poll_disable_fini(struct drm_device *dev, bool fini)
  	drm_connector_list_iter_end(&conn_iter);

  	cancel_delayed_work_sync(&dev->mode_config.output_poll_work);
+
+	dev->mode_config.poll_enabled = false;
  }

  /**
@@ -874,7 +878,7 @@ EXPORT_SYMBOL(drm_kms_helper_poll_disable);
  void drm_kms_helper_poll_init(struct drm_device *dev)
  {
  	INIT_DELAYED_WORK(&dev->mode_config.output_poll_work, output_poll_execute);
-	dev->mode_config.poll_enabled = true;
+	dev->mode_config.poll_init = true;

  	drm_kms_helper_poll_enable(dev);
  }
@@ -1003,7 +1007,7 @@ bool drm_helper_hpd_irq_event(struct drm_device *dev)
  	struct drm_connector_list_iter conn_iter;
  	int changed = 0;

-	if (!dev->mode_config.poll_enabled)
+	if (!dev->mode_config.poll_init)
  		return false;

  	mutex_lock(&dev->mode_config.mutex);
diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
index e5b053001d22..86c5f66f1a6c 100644
--- a/include/drm/drm_mode_config.h
+++ b/include/drm/drm_mode_config.h
@@ -345,6 +345,7 @@ struct drm_mode_config_funcs {
   * @max_width: maximum fb pixel width on this device
   * @max_height: maximum fb pixel height on this device
   * @funcs: core driver provided mode setting functions
+ * @poll_init: track polling initialization for this device
   * @poll_enabled: track polling support for this device
   * @poll_running: track polling status for this device
   * @delayed_event: track delayed poll uevent deliver for this device
@@ -543,6 +544,7 @@ struct drm_mode_config {
  	const struct drm_mode_config_funcs *funcs;

  	/* output poll support */
+	bool poll_init;
  	bool poll_enabled;
  	bool poll_running;
  	bool delayed_event;
===============><===========================================

Neil

>    drm_helper_probe_single_connector_modes+0x400/0x530
>    drm_client_modeset_probe+0x1ec/0xba0
>    __drm_fb_helper_initial_config_and_unlock+0x4c/0x630
>    drm_fb_helper_initial_config+0x50/0x60
>    drm_fbdev_client_hotplug+0xc4/0x150
>    drm_fbdev_generic_setup+0x88/0x150
>    meson_drv_bind_master+0x3d4/0x4a0 [meson_drm]
>    meson_drv_bind+0x14/0x20 [meson_drm]
>    try_to_bring_up_aggregate_device+0x164/0x1d0
>    __component_add+0xa8/0x174
>    component_add+0x14/0x20
>    meson_dw_hdmi_probe+0x1c/0x30 [meson_dw_hdmi]
>    platform_probe+0x68/0xe0
>    really_probe+0xbc/0x2e0
>    __driver_probe_device+0x78/0xe0
>    driver_probe_device+0x3c/0x160
>    __driver_attach+0x88/0x1a0
>    bus_for_each_dev+0x70/0xd0
>    driver_attach+0x24/0x30
>    bus_add_driver+0x154/0x204
>    driver_register+0x78/0x130
>    __platform_driver_register+0x28/0x34
>    meson_dw_hdmi_platform_driver_init+0x24/0x1000 [meson_dw_hdmi]
>    do_one_initcall+0x74/0x400
>    do_init_module+0x48/0x1d4
>    load_module+0x1818/0x1de0
>    __do_sys_finit_module+0xc0/0x114
>    __arm64_sys_finit_module+0x20/0x30
>    invoke_syscall+0x48/0x114
>    el0_svc_common.constprop.0+0x60/0x11c
>    do_el0_svc_compat+0x1c/0x40
>    el0_svc_compat+0x48/0xc0
>    el0t_32_sync_handler+0x90/0x140
>    el0t_32_sync+0x190/0x194
> irq event stamp: 17422
> hardirqs last  enabled at (17421): [<ffff800009196058>]
> __schedule+0x998/0xa14
> hardirqs last disabled at (17422): [<ffff80000918e4a4>] el1_dbg+0x24/0x90
> softirqs last  enabled at (17404): [<ffff80000801046c>] _stext+0x46c/0x5d8
> softirqs last disabled at (17383): [<ffff8000080166d0>]
> ____do_softirq+0x10/0x20
> ---[ end trace 0000000000000000 ]---
> 
> I looks that this change requires some additional changes/fixes in the
> drivers/gpu/drm/meson/meson_dw_hdmi.c
> 
> 
>>    drivers/gpu/drm/drm_bridge_connector.c | 18 +++++++++++++-----
>>    1 file changed, 13 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
>> index 1c7d936523df..0e13bc87a6ac 100644
>> --- a/drivers/gpu/drm/drm_bridge_connector.c
>> +++ b/drivers/gpu/drm/drm_bridge_connector.c
>> @@ -136,6 +136,11 @@ static void drm_bridge_connector_hpd_cb(void *cb_data,
>>     * This is typically used by display drivers in their resume handler.
>>     */
>>    void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
>> +{
>> +}
>> +EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
>> +
>> +static void _drm_bridge_connector_enable_hpd(struct drm_connector *connector)
>>    {
>>    	struct drm_bridge_connector *bridge_connector =
>>    		to_drm_bridge_connector(connector);
>> @@ -145,7 +150,6 @@ void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
>>    		drm_bridge_hpd_enable(hpd, drm_bridge_connector_hpd_cb,
>>    				      bridge_connector);
>>    }
>> -EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
>>    
>>    /**
>>     * drm_bridge_connector_disable_hpd - Disable hot-plug detection for the
>> @@ -156,6 +160,11 @@ EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
>>     * This is typically used by display drivers in their suspend handler.
>>     */
>>    void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
>> +{
>> +}
>> +EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
>> +
>> +static void _drm_bridge_connector_disable_hpd(struct drm_connector *connector)
>>    {
>>    	struct drm_bridge_connector *bridge_connector =
>>    		to_drm_bridge_connector(connector);
>> @@ -164,7 +173,6 @@ void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
>>    	if (hpd)
>>    		drm_bridge_hpd_disable(hpd);
>>    }
>> -EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
>>    
>>    /* -----------------------------------------------------------------------------
>>     * Bridge Connector Functions
>> @@ -305,6 +313,8 @@ static int drm_bridge_connector_get_modes(struct drm_connector *connector)
>>    static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = {
>>    	.get_modes = drm_bridge_connector_get_modes,
>>    	/* No need for .mode_valid(), the bridges are checked by the core. */
>> +	.enable_hpd = _drm_bridge_connector_enable_hpd,
>> +	.disable_hpd = _drm_bridge_connector_disable_hpd,
>>    };
>>    
>>    /* -----------------------------------------------------------------------------
>> @@ -387,10 +397,8 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
>>    				    connector_type, ddc);
>>    	drm_connector_helper_add(connector, &drm_bridge_connector_helper_funcs);
>>    
>> -	if (bridge_connector->bridge_hpd) {
>> +	if (bridge_connector->bridge_hpd)
>>    		connector->polled = DRM_CONNECTOR_POLL_HPD;
>> -		drm_bridge_connector_enable_hpd(connector);
>> -	}
>>    	else if (bridge_connector->bridge_detect)
>>    		connector->polled = DRM_CONNECTOR_POLL_CONNECT
>>    				  | DRM_CONNECTOR_POLL_DISCONNECT;
> 
> Best regards


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [v3,3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
@ 2023-01-12  9:35         ` Neil Armstrong
  0 siblings, 0 replies; 106+ messages in thread
From: Neil Armstrong @ 2023-01-12  9:35 UTC (permalink / raw)
  To: Marek Szyprowski, Dmitry Baryshkov, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Laurentiu Palcu, Lucas Stach, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar,
	Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel, linux-amlogic

On 11/01/2023 13:41, Marek Szyprowski wrote:
> On 02.11.2022 19:07, Dmitry Baryshkov wrote:
>> Use drm_connector's helpers enable_hpd and disable_hpd to enable and
>> disable HPD automatically by the means of drm_kms_helper_poll_*
>> functions. As the drm_bridge_connector_enable_hpd() and
>> drm_bridge_connector_disable_hpd() functions are now unused, replace
>> them with stubs to ease driver migration.
>>
>> Enabling the HPD from drm_bridge_connector_init() can happen too early,
>> before the driver is prepared to handle HPD events. As the
>> drm_bridge_connector_enable_hpd() is empty anyway, drop this call
>> anyway.
>>
>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>> ---
> 
> This patch, merged to recent linux-next as commit 92d755d8f13b
> ("drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD
> enablement"), triggers the following warning on all my Amlogic Meson
> based boards:
> 
> ------------[ cut here ]------------
> Hot plug detection already enabled
> WARNING: CPU: 2 PID: 285 at drivers/gpu/drm/drm_bridge.c:1257
> drm_bridge_hpd_enable+0x90/0xa0
> Modules linked in: snd_soc_meson_axg_frddr snd_soc_meson_axg_fifo
> dwmac_generic panfrost(+) reset_meson_audio_arb(+) drm_shmem_helper
> meson_dw_hdmi(+) dw_hdmi rc_odroid drm_display_helper meson_ir(+)
> gpu_sched meson_rng rng_core meson_gxbb_wdt crct10dif_ce dwmac_meson8b
> stmmac_platform snd_soc_meson_axg_sound_card snd_soc_meson_card_utils
> mdio_mux_meson_g12a stmmac meson_drm pwm_meson pcs_xpcs meson_canvas
> snd_soc_meson_axg_tdm_interface rtc_meson_vrtc
> snd_soc_meson_axg_tdm_formatter nvmem_meson_efuse display_connector
> CPU: 2 PID: 285 Comm: systemd-udevd Not tainted 6.1.0-rc6+ #13236
> Hardware name: Hardkernel ODROID-C4 (DT)
> pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> pc : drm_bridge_hpd_enable+0x90/0xa0
> lr : drm_bridge_hpd_enable+0x90/0xa0
> ...
> Call trace:
>    drm_bridge_hpd_enable+0x90/0xa0
>    _drm_bridge_connector_enable_hpd+0x24/0x34

Weird because _drm_bridge_connector_enable_hpd() has been removed with
4c00ac500d0e ("drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd()")


>    drm_kms_helper_poll_enable.part.0+0x50/0xd0

It seems drm_kms_helper_poll_enable is called again by
drm_helper_probe_single_connector_modes() because poll_running isn't set.

Can you try with this change:
===============><===========================================
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index 7973f2589ced..5d60d4fd868f 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -245,7 +245,7 @@ void drm_kms_helper_poll_enable(struct drm_device *dev)
  	struct drm_connector_list_iter conn_iter;
  	unsigned long delay = DRM_OUTPUT_POLL_PERIOD;

-	if (!dev->mode_config.poll_enabled || !drm_kms_helper_poll)
+	if (!dev->mode_config.poll_init || !drm_kms_helper_poll || dev->mode_config.poll_enabled)
  		return;

  	drm_connector_list_iter_begin(dev, &conn_iter);
@@ -279,6 +279,8 @@ void drm_kms_helper_poll_enable(struct drm_device *dev)

  	if (poll)
  		schedule_delayed_work(&dev->mode_config.output_poll_work, delay);
+
+	dev->mode_config.poll_enabled = true;
  }
  EXPORT_SYMBOL(drm_kms_helper_poll_enable);

@@ -561,7 +563,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
  		 * disable itself again.
  		 */
  		dev->mode_config.delayed_event = true;
-		if (dev->mode_config.poll_enabled)
+		if (dev->mode_config.poll_init)
  			schedule_delayed_work(&dev->mode_config.output_poll_work,
  					      0);
  	}
@@ -703,7 +705,7 @@ static void output_poll_execute(struct work_struct *work)
  	bool repoll = false, changed;
  	u64 old_epoch_counter;

-	if (!dev->mode_config.poll_enabled)
+	if (!dev->mode_config.poll_init)
  		return;

  	/* Pick up any changes detected by the probe functions. */
@@ -813,11 +815,11 @@ static void drm_kms_helper_poll_disable_fini(struct drm_device *dev, bool fini)
  	struct drm_connector *connector;
  	struct drm_connector_list_iter conn_iter;

-	if (!dev->mode_config.poll_enabled)
+	if (!dev->mode_config.poll_init || !dev->mode_config.poll_enabled)
  		return;

  	if (fini)
-		dev->mode_config.poll_enabled = false;
+		dev->mode_config.poll_init = false;

  	drm_connector_list_iter_begin(dev, &conn_iter);
  	drm_for_each_connector_iter(connector, &conn_iter) {
@@ -830,6 +832,8 @@ static void drm_kms_helper_poll_disable_fini(struct drm_device *dev, bool fini)
  	drm_connector_list_iter_end(&conn_iter);

  	cancel_delayed_work_sync(&dev->mode_config.output_poll_work);
+
+	dev->mode_config.poll_enabled = false;
  }

  /**
@@ -874,7 +878,7 @@ EXPORT_SYMBOL(drm_kms_helper_poll_disable);
  void drm_kms_helper_poll_init(struct drm_device *dev)
  {
  	INIT_DELAYED_WORK(&dev->mode_config.output_poll_work, output_poll_execute);
-	dev->mode_config.poll_enabled = true;
+	dev->mode_config.poll_init = true;

  	drm_kms_helper_poll_enable(dev);
  }
@@ -1003,7 +1007,7 @@ bool drm_helper_hpd_irq_event(struct drm_device *dev)
  	struct drm_connector_list_iter conn_iter;
  	int changed = 0;

-	if (!dev->mode_config.poll_enabled)
+	if (!dev->mode_config.poll_init)
  		return false;

  	mutex_lock(&dev->mode_config.mutex);
diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
index e5b053001d22..86c5f66f1a6c 100644
--- a/include/drm/drm_mode_config.h
+++ b/include/drm/drm_mode_config.h
@@ -345,6 +345,7 @@ struct drm_mode_config_funcs {
   * @max_width: maximum fb pixel width on this device
   * @max_height: maximum fb pixel height on this device
   * @funcs: core driver provided mode setting functions
+ * @poll_init: track polling initialization for this device
   * @poll_enabled: track polling support for this device
   * @poll_running: track polling status for this device
   * @delayed_event: track delayed poll uevent deliver for this device
@@ -543,6 +544,7 @@ struct drm_mode_config {
  	const struct drm_mode_config_funcs *funcs;

  	/* output poll support */
+	bool poll_init;
  	bool poll_enabled;
  	bool poll_running;
  	bool delayed_event;
===============><===========================================

Neil

>    drm_helper_probe_single_connector_modes+0x400/0x530
>    drm_client_modeset_probe+0x1ec/0xba0
>    __drm_fb_helper_initial_config_and_unlock+0x4c/0x630
>    drm_fb_helper_initial_config+0x50/0x60
>    drm_fbdev_client_hotplug+0xc4/0x150
>    drm_fbdev_generic_setup+0x88/0x150
>    meson_drv_bind_master+0x3d4/0x4a0 [meson_drm]
>    meson_drv_bind+0x14/0x20 [meson_drm]
>    try_to_bring_up_aggregate_device+0x164/0x1d0
>    __component_add+0xa8/0x174
>    component_add+0x14/0x20
>    meson_dw_hdmi_probe+0x1c/0x30 [meson_dw_hdmi]
>    platform_probe+0x68/0xe0
>    really_probe+0xbc/0x2e0
>    __driver_probe_device+0x78/0xe0
>    driver_probe_device+0x3c/0x160
>    __driver_attach+0x88/0x1a0
>    bus_for_each_dev+0x70/0xd0
>    driver_attach+0x24/0x30
>    bus_add_driver+0x154/0x204
>    driver_register+0x78/0x130
>    __platform_driver_register+0x28/0x34
>    meson_dw_hdmi_platform_driver_init+0x24/0x1000 [meson_dw_hdmi]
>    do_one_initcall+0x74/0x400
>    do_init_module+0x48/0x1d4
>    load_module+0x1818/0x1de0
>    __do_sys_finit_module+0xc0/0x114
>    __arm64_sys_finit_module+0x20/0x30
>    invoke_syscall+0x48/0x114
>    el0_svc_common.constprop.0+0x60/0x11c
>    do_el0_svc_compat+0x1c/0x40
>    el0_svc_compat+0x48/0xc0
>    el0t_32_sync_handler+0x90/0x140
>    el0t_32_sync+0x190/0x194
> irq event stamp: 17422
> hardirqs last  enabled at (17421): [<ffff800009196058>]
> __schedule+0x998/0xa14
> hardirqs last disabled at (17422): [<ffff80000918e4a4>] el1_dbg+0x24/0x90
> softirqs last  enabled at (17404): [<ffff80000801046c>] _stext+0x46c/0x5d8
> softirqs last disabled at (17383): [<ffff8000080166d0>]
> ____do_softirq+0x10/0x20
> ---[ end trace 0000000000000000 ]---
> 
> I looks that this change requires some additional changes/fixes in the
> drivers/gpu/drm/meson/meson_dw_hdmi.c
> 
> 
>>    drivers/gpu/drm/drm_bridge_connector.c | 18 +++++++++++++-----
>>    1 file changed, 13 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
>> index 1c7d936523df..0e13bc87a6ac 100644
>> --- a/drivers/gpu/drm/drm_bridge_connector.c
>> +++ b/drivers/gpu/drm/drm_bridge_connector.c
>> @@ -136,6 +136,11 @@ static void drm_bridge_connector_hpd_cb(void *cb_data,
>>     * This is typically used by display drivers in their resume handler.
>>     */
>>    void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
>> +{
>> +}
>> +EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
>> +
>> +static void _drm_bridge_connector_enable_hpd(struct drm_connector *connector)
>>    {
>>    	struct drm_bridge_connector *bridge_connector =
>>    		to_drm_bridge_connector(connector);
>> @@ -145,7 +150,6 @@ void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
>>    		drm_bridge_hpd_enable(hpd, drm_bridge_connector_hpd_cb,
>>    				      bridge_connector);
>>    }
>> -EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
>>    
>>    /**
>>     * drm_bridge_connector_disable_hpd - Disable hot-plug detection for the
>> @@ -156,6 +160,11 @@ EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd);
>>     * This is typically used by display drivers in their suspend handler.
>>     */
>>    void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
>> +{
>> +}
>> +EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
>> +
>> +static void _drm_bridge_connector_disable_hpd(struct drm_connector *connector)
>>    {
>>    	struct drm_bridge_connector *bridge_connector =
>>    		to_drm_bridge_connector(connector);
>> @@ -164,7 +173,6 @@ void drm_bridge_connector_disable_hpd(struct drm_connector *connector)
>>    	if (hpd)
>>    		drm_bridge_hpd_disable(hpd);
>>    }
>> -EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd);
>>    
>>    /* -----------------------------------------------------------------------------
>>     * Bridge Connector Functions
>> @@ -305,6 +313,8 @@ static int drm_bridge_connector_get_modes(struct drm_connector *connector)
>>    static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = {
>>    	.get_modes = drm_bridge_connector_get_modes,
>>    	/* No need for .mode_valid(), the bridges are checked by the core. */
>> +	.enable_hpd = _drm_bridge_connector_enable_hpd,
>> +	.disable_hpd = _drm_bridge_connector_disable_hpd,
>>    };
>>    
>>    /* -----------------------------------------------------------------------------
>> @@ -387,10 +397,8 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
>>    				    connector_type, ddc);
>>    	drm_connector_helper_add(connector, &drm_bridge_connector_helper_funcs);
>>    
>> -	if (bridge_connector->bridge_hpd) {
>> +	if (bridge_connector->bridge_hpd)
>>    		connector->polled = DRM_CONNECTOR_POLL_HPD;
>> -		drm_bridge_connector_enable_hpd(connector);
>> -	}
>>    	else if (bridge_connector->bridge_detect)
>>    		connector->polled = DRM_CONNECTOR_POLL_CONNECT
>>    				  | DRM_CONNECTOR_POLL_DISCONNECT;
> 
> Best regards


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

* Re: [v3, 3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
  2023-01-12  9:35         ` Neil Armstrong
  (?)
  (?)
@ 2023-01-12  9:36           ` Dmitry Baryshkov
  -1 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2023-01-12  9:36 UTC (permalink / raw)
  To: neil.armstrong, Marek Szyprowski, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Laurentiu Palcu, Lucas Stach, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar,
	Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, dri-devel, linux-arm-kernel, linux-amlogic

On 12/01/2023 11:35, Neil Armstrong wrote:
> On 11/01/2023 13:41, Marek Szyprowski wrote:
>> On 02.11.2022 19:07, Dmitry Baryshkov wrote:
>>> Use drm_connector's helpers enable_hpd and disable_hpd to enable and
>>> disable HPD automatically by the means of drm_kms_helper_poll_*
>>> functions. As the drm_bridge_connector_enable_hpd() and
>>> drm_bridge_connector_disable_hpd() functions are now unused, replace
>>> them with stubs to ease driver migration.
>>>
>>> Enabling the HPD from drm_bridge_connector_init() can happen too early,
>>> before the driver is prepared to handle HPD events. As the
>>> drm_bridge_connector_enable_hpd() is empty anyway, drop this call
>>> anyway.
>>>
>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> ---
>>
>> This patch, merged to recent linux-next as commit 92d755d8f13b
>> ("drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD
>> enablement"), triggers the following warning on all my Amlogic Meson
>> based boards:
>>
>> ------------[ cut here ]------------
>> Hot plug detection already enabled
>> WARNING: CPU: 2 PID: 285 at drivers/gpu/drm/drm_bridge.c:1257
>> drm_bridge_hpd_enable+0x90/0xa0
>> Modules linked in: snd_soc_meson_axg_frddr snd_soc_meson_axg_fifo
>> dwmac_generic panfrost(+) reset_meson_audio_arb(+) drm_shmem_helper
>> meson_dw_hdmi(+) dw_hdmi rc_odroid drm_display_helper meson_ir(+)
>> gpu_sched meson_rng rng_core meson_gxbb_wdt crct10dif_ce dwmac_meson8b
>> stmmac_platform snd_soc_meson_axg_sound_card snd_soc_meson_card_utils
>> mdio_mux_meson_g12a stmmac meson_drm pwm_meson pcs_xpcs meson_canvas
>> snd_soc_meson_axg_tdm_interface rtc_meson_vrtc
>> snd_soc_meson_axg_tdm_formatter nvmem_meson_efuse display_connector
>> CPU: 2 PID: 285 Comm: systemd-udevd Not tainted 6.1.0-rc6+ #13236
>> Hardware name: Hardkernel ODROID-C4 (DT)
>> pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
>> pc : drm_bridge_hpd_enable+0x90/0xa0
>> lr : drm_bridge_hpd_enable+0x90/0xa0
>> ...
>> Call trace:
>>    drm_bridge_hpd_enable+0x90/0xa0
>>    _drm_bridge_connector_enable_hpd+0x24/0x34
> 
> Weird because _drm_bridge_connector_enable_hpd() has been removed with
> 4c00ac500d0e ("drm/bridge_connector: drop 
> drm_bridge_connector_en/disable_hpd()")
> 
> 
>>    drm_kms_helper_poll_enable.part.0+0x50/0xd0
> 
> It seems drm_kms_helper_poll_enable is called again by
> drm_helper_probe_single_connector_modes() because poll_running isn't set.

Yes, I'm currently reworking poll_running handling. I hope to post a 
patch today.

-- 
With best wishes
Dmitry


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

* Re: [v3,3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
@ 2023-01-12  9:36           ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2023-01-12  9:36 UTC (permalink / raw)
  To: neil.armstrong, Marek Szyprowski, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Laurentiu Palcu, Lucas Stach, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar,
	Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel, linux-amlogic

On 12/01/2023 11:35, Neil Armstrong wrote:
> On 11/01/2023 13:41, Marek Szyprowski wrote:
>> On 02.11.2022 19:07, Dmitry Baryshkov wrote:
>>> Use drm_connector's helpers enable_hpd and disable_hpd to enable and
>>> disable HPD automatically by the means of drm_kms_helper_poll_*
>>> functions. As the drm_bridge_connector_enable_hpd() and
>>> drm_bridge_connector_disable_hpd() functions are now unused, replace
>>> them with stubs to ease driver migration.
>>>
>>> Enabling the HPD from drm_bridge_connector_init() can happen too early,
>>> before the driver is prepared to handle HPD events. As the
>>> drm_bridge_connector_enable_hpd() is empty anyway, drop this call
>>> anyway.
>>>
>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> ---
>>
>> This patch, merged to recent linux-next as commit 92d755d8f13b
>> ("drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD
>> enablement"), triggers the following warning on all my Amlogic Meson
>> based boards:
>>
>> ------------[ cut here ]------------
>> Hot plug detection already enabled
>> WARNING: CPU: 2 PID: 285 at drivers/gpu/drm/drm_bridge.c:1257
>> drm_bridge_hpd_enable+0x90/0xa0
>> Modules linked in: snd_soc_meson_axg_frddr snd_soc_meson_axg_fifo
>> dwmac_generic panfrost(+) reset_meson_audio_arb(+) drm_shmem_helper
>> meson_dw_hdmi(+) dw_hdmi rc_odroid drm_display_helper meson_ir(+)
>> gpu_sched meson_rng rng_core meson_gxbb_wdt crct10dif_ce dwmac_meson8b
>> stmmac_platform snd_soc_meson_axg_sound_card snd_soc_meson_card_utils
>> mdio_mux_meson_g12a stmmac meson_drm pwm_meson pcs_xpcs meson_canvas
>> snd_soc_meson_axg_tdm_interface rtc_meson_vrtc
>> snd_soc_meson_axg_tdm_formatter nvmem_meson_efuse display_connector
>> CPU: 2 PID: 285 Comm: systemd-udevd Not tainted 6.1.0-rc6+ #13236
>> Hardware name: Hardkernel ODROID-C4 (DT)
>> pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
>> pc : drm_bridge_hpd_enable+0x90/0xa0
>> lr : drm_bridge_hpd_enable+0x90/0xa0
>> ...
>> Call trace:
>>    drm_bridge_hpd_enable+0x90/0xa0
>>    _drm_bridge_connector_enable_hpd+0x24/0x34
> 
> Weird because _drm_bridge_connector_enable_hpd() has been removed with
> 4c00ac500d0e ("drm/bridge_connector: drop 
> drm_bridge_connector_en/disable_hpd()")
> 
> 
>>    drm_kms_helper_poll_enable.part.0+0x50/0xd0
> 
> It seems drm_kms_helper_poll_enable is called again by
> drm_helper_probe_single_connector_modes() because poll_running isn't set.

Yes, I'm currently reworking poll_running handling. I hope to post a 
patch today.

-- 
With best wishes
Dmitry


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [v3,3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
@ 2023-01-12  9:36           ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2023-01-12  9:36 UTC (permalink / raw)
  To: neil.armstrong, Marek Szyprowski, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Laurentiu Palcu, Lucas Stach, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar,
	Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel, linux-amlogic

On 12/01/2023 11:35, Neil Armstrong wrote:
> On 11/01/2023 13:41, Marek Szyprowski wrote:
>> On 02.11.2022 19:07, Dmitry Baryshkov wrote:
>>> Use drm_connector's helpers enable_hpd and disable_hpd to enable and
>>> disable HPD automatically by the means of drm_kms_helper_poll_*
>>> functions. As the drm_bridge_connector_enable_hpd() and
>>> drm_bridge_connector_disable_hpd() functions are now unused, replace
>>> them with stubs to ease driver migration.
>>>
>>> Enabling the HPD from drm_bridge_connector_init() can happen too early,
>>> before the driver is prepared to handle HPD events. As the
>>> drm_bridge_connector_enable_hpd() is empty anyway, drop this call
>>> anyway.
>>>
>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> ---
>>
>> This patch, merged to recent linux-next as commit 92d755d8f13b
>> ("drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD
>> enablement"), triggers the following warning on all my Amlogic Meson
>> based boards:
>>
>> ------------[ cut here ]------------
>> Hot plug detection already enabled
>> WARNING: CPU: 2 PID: 285 at drivers/gpu/drm/drm_bridge.c:1257
>> drm_bridge_hpd_enable+0x90/0xa0
>> Modules linked in: snd_soc_meson_axg_frddr snd_soc_meson_axg_fifo
>> dwmac_generic panfrost(+) reset_meson_audio_arb(+) drm_shmem_helper
>> meson_dw_hdmi(+) dw_hdmi rc_odroid drm_display_helper meson_ir(+)
>> gpu_sched meson_rng rng_core meson_gxbb_wdt crct10dif_ce dwmac_meson8b
>> stmmac_platform snd_soc_meson_axg_sound_card snd_soc_meson_card_utils
>> mdio_mux_meson_g12a stmmac meson_drm pwm_meson pcs_xpcs meson_canvas
>> snd_soc_meson_axg_tdm_interface rtc_meson_vrtc
>> snd_soc_meson_axg_tdm_formatter nvmem_meson_efuse display_connector
>> CPU: 2 PID: 285 Comm: systemd-udevd Not tainted 6.1.0-rc6+ #13236
>> Hardware name: Hardkernel ODROID-C4 (DT)
>> pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
>> pc : drm_bridge_hpd_enable+0x90/0xa0
>> lr : drm_bridge_hpd_enable+0x90/0xa0
>> ...
>> Call trace:
>>    drm_bridge_hpd_enable+0x90/0xa0
>>    _drm_bridge_connector_enable_hpd+0x24/0x34
> 
> Weird because _drm_bridge_connector_enable_hpd() has been removed with
> 4c00ac500d0e ("drm/bridge_connector: drop 
> drm_bridge_connector_en/disable_hpd()")
> 
> 
>>    drm_kms_helper_poll_enable.part.0+0x50/0xd0
> 
> It seems drm_kms_helper_poll_enable is called again by
> drm_helper_probe_single_connector_modes() because poll_running isn't set.

Yes, I'm currently reworking poll_running handling. I hope to post a 
patch today.

-- 
With best wishes
Dmitry


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [v3,3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
@ 2023-01-12  9:36           ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2023-01-12  9:36 UTC (permalink / raw)
  To: neil.armstrong, Marek Szyprowski, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Laurentiu Palcu, Lucas Stach, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar,
	Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel, linux-amlogic

On 12/01/2023 11:35, Neil Armstrong wrote:
> On 11/01/2023 13:41, Marek Szyprowski wrote:
>> On 02.11.2022 19:07, Dmitry Baryshkov wrote:
>>> Use drm_connector's helpers enable_hpd and disable_hpd to enable and
>>> disable HPD automatically by the means of drm_kms_helper_poll_*
>>> functions. As the drm_bridge_connector_enable_hpd() and
>>> drm_bridge_connector_disable_hpd() functions are now unused, replace
>>> them with stubs to ease driver migration.
>>>
>>> Enabling the HPD from drm_bridge_connector_init() can happen too early,
>>> before the driver is prepared to handle HPD events. As the
>>> drm_bridge_connector_enable_hpd() is empty anyway, drop this call
>>> anyway.
>>>
>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> ---
>>
>> This patch, merged to recent linux-next as commit 92d755d8f13b
>> ("drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD
>> enablement"), triggers the following warning on all my Amlogic Meson
>> based boards:
>>
>> ------------[ cut here ]------------
>> Hot plug detection already enabled
>> WARNING: CPU: 2 PID: 285 at drivers/gpu/drm/drm_bridge.c:1257
>> drm_bridge_hpd_enable+0x90/0xa0
>> Modules linked in: snd_soc_meson_axg_frddr snd_soc_meson_axg_fifo
>> dwmac_generic panfrost(+) reset_meson_audio_arb(+) drm_shmem_helper
>> meson_dw_hdmi(+) dw_hdmi rc_odroid drm_display_helper meson_ir(+)
>> gpu_sched meson_rng rng_core meson_gxbb_wdt crct10dif_ce dwmac_meson8b
>> stmmac_platform snd_soc_meson_axg_sound_card snd_soc_meson_card_utils
>> mdio_mux_meson_g12a stmmac meson_drm pwm_meson pcs_xpcs meson_canvas
>> snd_soc_meson_axg_tdm_interface rtc_meson_vrtc
>> snd_soc_meson_axg_tdm_formatter nvmem_meson_efuse display_connector
>> CPU: 2 PID: 285 Comm: systemd-udevd Not tainted 6.1.0-rc6+ #13236
>> Hardware name: Hardkernel ODROID-C4 (DT)
>> pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
>> pc : drm_bridge_hpd_enable+0x90/0xa0
>> lr : drm_bridge_hpd_enable+0x90/0xa0
>> ...
>> Call trace:
>>    drm_bridge_hpd_enable+0x90/0xa0
>>    _drm_bridge_connector_enable_hpd+0x24/0x34
> 
> Weird because _drm_bridge_connector_enable_hpd() has been removed with
> 4c00ac500d0e ("drm/bridge_connector: drop 
> drm_bridge_connector_en/disable_hpd()")
> 
> 
>>    drm_kms_helper_poll_enable.part.0+0x50/0xd0
> 
> It seems drm_kms_helper_poll_enable is called again by
> drm_helper_probe_single_connector_modes() because poll_running isn't set.

Yes, I'm currently reworking poll_running handling. I hope to post a 
patch today.

-- 
With best wishes
Dmitry


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

* Re: [v3,3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
  2023-01-12  9:35         ` Neil Armstrong
  (?)
  (?)
@ 2023-01-12 10:48           ` Marek Szyprowski
  -1 siblings, 0 replies; 106+ messages in thread
From: Marek Szyprowski @ 2023-01-12 10:48 UTC (permalink / raw)
  To: neil.armstrong, Dmitry Baryshkov, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Laurentiu Palcu, Lucas Stach, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar,
	Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, dri-devel, linux-arm-kernel, linux-amlogic

Hi Neil,

On 12.01.2023 10:35, Neil Armstrong wrote:
> On 11/01/2023 13:41, Marek Szyprowski wrote:
>> On 02.11.2022 19:07, Dmitry Baryshkov wrote:
>>> Use drm_connector's helpers enable_hpd and disable_hpd to enable and
>>> disable HPD automatically by the means of drm_kms_helper_poll_*
>>> functions. As the drm_bridge_connector_enable_hpd() and
>>> drm_bridge_connector_disable_hpd() functions are now unused, replace
>>> them with stubs to ease driver migration.
>>>
>>> Enabling the HPD from drm_bridge_connector_init() can happen too early,
>>> before the driver is prepared to handle HPD events. As the
>>> drm_bridge_connector_enable_hpd() is empty anyway, drop this call
>>> anyway.
>>>
>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> ---
>>
>> This patch, merged to recent linux-next as commit 92d755d8f13b
>> ("drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD
>> enablement"), triggers the following warning on all my Amlogic Meson
>> based boards:
>>
>> ------------[ cut here ]------------
>> Hot plug detection already enabled
>> WARNING: CPU: 2 PID: 285 at drivers/gpu/drm/drm_bridge.c:1257
>> drm_bridge_hpd_enable+0x90/0xa0
>> Modules linked in: snd_soc_meson_axg_frddr snd_soc_meson_axg_fifo
>> dwmac_generic panfrost(+) reset_meson_audio_arb(+) drm_shmem_helper
>> meson_dw_hdmi(+) dw_hdmi rc_odroid drm_display_helper meson_ir(+)
>> gpu_sched meson_rng rng_core meson_gxbb_wdt crct10dif_ce dwmac_meson8b
>> stmmac_platform snd_soc_meson_axg_sound_card snd_soc_meson_card_utils
>> mdio_mux_meson_g12a stmmac meson_drm pwm_meson pcs_xpcs meson_canvas
>> snd_soc_meson_axg_tdm_interface rtc_meson_vrtc
>> snd_soc_meson_axg_tdm_formatter nvmem_meson_efuse display_connector
>> CPU: 2 PID: 285 Comm: systemd-udevd Not tainted 6.1.0-rc6+ #13236
>> Hardware name: Hardkernel ODROID-C4 (DT)
>> pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
>> pc : drm_bridge_hpd_enable+0x90/0xa0
>> lr : drm_bridge_hpd_enable+0x90/0xa0
>> ...
>> Call trace:
>>    drm_bridge_hpd_enable+0x90/0xa0
>>    _drm_bridge_connector_enable_hpd+0x24/0x34
>
> Weird because _drm_bridge_connector_enable_hpd() has been removed with
> 4c00ac500d0e ("drm/bridge_connector: drop 
> drm_bridge_connector_en/disable_hpd()")

The above log has been captured at commit 92d755d8f13b during bisecting, 
so 4c00ac500d0e is not applied yet. Maybe I should have mention that. 
The issue on top of linux-next is similar.

>
>>  drm_kms_helper_poll_enable.part.0+0x50/0xd0
>
> It seems drm_kms_helper_poll_enable is called again by
> drm_helper_probe_single_connector_modes() because poll_running isn't set.
>
> Can you try with this change:

This fixes the issue on top of linux next-20230112. Thanks! Feel free to 
add if you plan to submit it as a formal patch:

Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>

Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>

 > ...

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


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

* Re: [v3,3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
@ 2023-01-12 10:48           ` Marek Szyprowski
  0 siblings, 0 replies; 106+ messages in thread
From: Marek Szyprowski @ 2023-01-12 10:48 UTC (permalink / raw)
  To: neil.armstrong, Dmitry Baryshkov, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Laurentiu Palcu, Lucas Stach, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar,
	Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel, linux-amlogic

Hi Neil,

On 12.01.2023 10:35, Neil Armstrong wrote:
> On 11/01/2023 13:41, Marek Szyprowski wrote:
>> On 02.11.2022 19:07, Dmitry Baryshkov wrote:
>>> Use drm_connector's helpers enable_hpd and disable_hpd to enable and
>>> disable HPD automatically by the means of drm_kms_helper_poll_*
>>> functions. As the drm_bridge_connector_enable_hpd() and
>>> drm_bridge_connector_disable_hpd() functions are now unused, replace
>>> them with stubs to ease driver migration.
>>>
>>> Enabling the HPD from drm_bridge_connector_init() can happen too early,
>>> before the driver is prepared to handle HPD events. As the
>>> drm_bridge_connector_enable_hpd() is empty anyway, drop this call
>>> anyway.
>>>
>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> ---
>>
>> This patch, merged to recent linux-next as commit 92d755d8f13b
>> ("drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD
>> enablement"), triggers the following warning on all my Amlogic Meson
>> based boards:
>>
>> ------------[ cut here ]------------
>> Hot plug detection already enabled
>> WARNING: CPU: 2 PID: 285 at drivers/gpu/drm/drm_bridge.c:1257
>> drm_bridge_hpd_enable+0x90/0xa0
>> Modules linked in: snd_soc_meson_axg_frddr snd_soc_meson_axg_fifo
>> dwmac_generic panfrost(+) reset_meson_audio_arb(+) drm_shmem_helper
>> meson_dw_hdmi(+) dw_hdmi rc_odroid drm_display_helper meson_ir(+)
>> gpu_sched meson_rng rng_core meson_gxbb_wdt crct10dif_ce dwmac_meson8b
>> stmmac_platform snd_soc_meson_axg_sound_card snd_soc_meson_card_utils
>> mdio_mux_meson_g12a stmmac meson_drm pwm_meson pcs_xpcs meson_canvas
>> snd_soc_meson_axg_tdm_interface rtc_meson_vrtc
>> snd_soc_meson_axg_tdm_formatter nvmem_meson_efuse display_connector
>> CPU: 2 PID: 285 Comm: systemd-udevd Not tainted 6.1.0-rc6+ #13236
>> Hardware name: Hardkernel ODROID-C4 (DT)
>> pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
>> pc : drm_bridge_hpd_enable+0x90/0xa0
>> lr : drm_bridge_hpd_enable+0x90/0xa0
>> ...
>> Call trace:
>>    drm_bridge_hpd_enable+0x90/0xa0
>>    _drm_bridge_connector_enable_hpd+0x24/0x34
>
> Weird because _drm_bridge_connector_enable_hpd() has been removed with
> 4c00ac500d0e ("drm/bridge_connector: drop 
> drm_bridge_connector_en/disable_hpd()")

The above log has been captured at commit 92d755d8f13b during bisecting, 
so 4c00ac500d0e is not applied yet. Maybe I should have mention that. 
The issue on top of linux-next is similar.

>
>>  drm_kms_helper_poll_enable.part.0+0x50/0xd0
>
> It seems drm_kms_helper_poll_enable is called again by
> drm_helper_probe_single_connector_modes() because poll_running isn't set.
>
> Can you try with this change:

This fixes the issue on top of linux next-20230112. Thanks! Feel free to 
add if you plan to submit it as a formal patch:

Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>

Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>

 > ...

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [v3,3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
@ 2023-01-12 10:48           ` Marek Szyprowski
  0 siblings, 0 replies; 106+ messages in thread
From: Marek Szyprowski @ 2023-01-12 10:48 UTC (permalink / raw)
  To: neil.armstrong, Dmitry Baryshkov, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Laurentiu Palcu, Lucas Stach, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar,
	Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel, linux-amlogic

Hi Neil,

On 12.01.2023 10:35, Neil Armstrong wrote:
> On 11/01/2023 13:41, Marek Szyprowski wrote:
>> On 02.11.2022 19:07, Dmitry Baryshkov wrote:
>>> Use drm_connector's helpers enable_hpd and disable_hpd to enable and
>>> disable HPD automatically by the means of drm_kms_helper_poll_*
>>> functions. As the drm_bridge_connector_enable_hpd() and
>>> drm_bridge_connector_disable_hpd() functions are now unused, replace
>>> them with stubs to ease driver migration.
>>>
>>> Enabling the HPD from drm_bridge_connector_init() can happen too early,
>>> before the driver is prepared to handle HPD events. As the
>>> drm_bridge_connector_enable_hpd() is empty anyway, drop this call
>>> anyway.
>>>
>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> ---
>>
>> This patch, merged to recent linux-next as commit 92d755d8f13b
>> ("drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD
>> enablement"), triggers the following warning on all my Amlogic Meson
>> based boards:
>>
>> ------------[ cut here ]------------
>> Hot plug detection already enabled
>> WARNING: CPU: 2 PID: 285 at drivers/gpu/drm/drm_bridge.c:1257
>> drm_bridge_hpd_enable+0x90/0xa0
>> Modules linked in: snd_soc_meson_axg_frddr snd_soc_meson_axg_fifo
>> dwmac_generic panfrost(+) reset_meson_audio_arb(+) drm_shmem_helper
>> meson_dw_hdmi(+) dw_hdmi rc_odroid drm_display_helper meson_ir(+)
>> gpu_sched meson_rng rng_core meson_gxbb_wdt crct10dif_ce dwmac_meson8b
>> stmmac_platform snd_soc_meson_axg_sound_card snd_soc_meson_card_utils
>> mdio_mux_meson_g12a stmmac meson_drm pwm_meson pcs_xpcs meson_canvas
>> snd_soc_meson_axg_tdm_interface rtc_meson_vrtc
>> snd_soc_meson_axg_tdm_formatter nvmem_meson_efuse display_connector
>> CPU: 2 PID: 285 Comm: systemd-udevd Not tainted 6.1.0-rc6+ #13236
>> Hardware name: Hardkernel ODROID-C4 (DT)
>> pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
>> pc : drm_bridge_hpd_enable+0x90/0xa0
>> lr : drm_bridge_hpd_enable+0x90/0xa0
>> ...
>> Call trace:
>>    drm_bridge_hpd_enable+0x90/0xa0
>>    _drm_bridge_connector_enable_hpd+0x24/0x34
>
> Weird because _drm_bridge_connector_enable_hpd() has been removed with
> 4c00ac500d0e ("drm/bridge_connector: drop 
> drm_bridge_connector_en/disable_hpd()")

The above log has been captured at commit 92d755d8f13b during bisecting, 
so 4c00ac500d0e is not applied yet. Maybe I should have mention that. 
The issue on top of linux-next is similar.

>
>>  drm_kms_helper_poll_enable.part.0+0x50/0xd0
>
> It seems drm_kms_helper_poll_enable is called again by
> drm_helper_probe_single_connector_modes() because poll_running isn't set.
>
> Can you try with this change:

This fixes the issue on top of linux next-20230112. Thanks! Feel free to 
add if you plan to submit it as a formal patch:

Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>

Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>

 > ...

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [v3,3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement
@ 2023-01-12 10:48           ` Marek Szyprowski
  0 siblings, 0 replies; 106+ messages in thread
From: Marek Szyprowski @ 2023-01-12 10:48 UTC (permalink / raw)
  To: neil.armstrong, Dmitry Baryshkov, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Laurentiu Palcu, Lucas Stach, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Rob Clark, Sean Paul, Abhinav Kumar,
	Tomi Valkeinen
  Cc: linux-arm-msm, freedreno, linux-arm-kernel, dri-devel, linux-amlogic

Hi Neil,

On 12.01.2023 10:35, Neil Armstrong wrote:
> On 11/01/2023 13:41, Marek Szyprowski wrote:
>> On 02.11.2022 19:07, Dmitry Baryshkov wrote:
>>> Use drm_connector's helpers enable_hpd and disable_hpd to enable and
>>> disable HPD automatically by the means of drm_kms_helper_poll_*
>>> functions. As the drm_bridge_connector_enable_hpd() and
>>> drm_bridge_connector_disable_hpd() functions are now unused, replace
>>> them with stubs to ease driver migration.
>>>
>>> Enabling the HPD from drm_bridge_connector_init() can happen too early,
>>> before the driver is prepared to handle HPD events. As the
>>> drm_bridge_connector_enable_hpd() is empty anyway, drop this call
>>> anyway.
>>>
>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> ---
>>
>> This patch, merged to recent linux-next as commit 92d755d8f13b
>> ("drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD
>> enablement"), triggers the following warning on all my Amlogic Meson
>> based boards:
>>
>> ------------[ cut here ]------------
>> Hot plug detection already enabled
>> WARNING: CPU: 2 PID: 285 at drivers/gpu/drm/drm_bridge.c:1257
>> drm_bridge_hpd_enable+0x90/0xa0
>> Modules linked in: snd_soc_meson_axg_frddr snd_soc_meson_axg_fifo
>> dwmac_generic panfrost(+) reset_meson_audio_arb(+) drm_shmem_helper
>> meson_dw_hdmi(+) dw_hdmi rc_odroid drm_display_helper meson_ir(+)
>> gpu_sched meson_rng rng_core meson_gxbb_wdt crct10dif_ce dwmac_meson8b
>> stmmac_platform snd_soc_meson_axg_sound_card snd_soc_meson_card_utils
>> mdio_mux_meson_g12a stmmac meson_drm pwm_meson pcs_xpcs meson_canvas
>> snd_soc_meson_axg_tdm_interface rtc_meson_vrtc
>> snd_soc_meson_axg_tdm_formatter nvmem_meson_efuse display_connector
>> CPU: 2 PID: 285 Comm: systemd-udevd Not tainted 6.1.0-rc6+ #13236
>> Hardware name: Hardkernel ODROID-C4 (DT)
>> pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
>> pc : drm_bridge_hpd_enable+0x90/0xa0
>> lr : drm_bridge_hpd_enable+0x90/0xa0
>> ...
>> Call trace:
>>    drm_bridge_hpd_enable+0x90/0xa0
>>    _drm_bridge_connector_enable_hpd+0x24/0x34
>
> Weird because _drm_bridge_connector_enable_hpd() has been removed with
> 4c00ac500d0e ("drm/bridge_connector: drop 
> drm_bridge_connector_en/disable_hpd()")

The above log has been captured at commit 92d755d8f13b during bisecting, 
so 4c00ac500d0e is not applied yet. Maybe I should have mention that. 
The issue on top of linux-next is similar.

>
>>  drm_kms_helper_poll_enable.part.0+0x50/0xd0
>
> It seems drm_kms_helper_poll_enable is called again by
> drm_helper_probe_single_connector_modes() because poll_running isn't set.
>
> Can you try with this change:

This fixes the issue on top of linux next-20230112. Thanks! Feel free to 
add if you plan to submit it as a formal patch:

Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>

Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>

 > ...

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
  2023-01-10 10:20         ` Geert Uytterhoeven
  (?)
@ 2023-02-07  9:40           ` Geert Uytterhoeven
  -1 siblings, 0 replies; 106+ messages in thread
From: Geert Uytterhoeven @ 2023-02-07  9:40 UTC (permalink / raw)
  To: Laurentiu Palcu
  Cc: Dmitry Baryshkov, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen, dri-devel, linux-arm-kernel,
	linux-arm-msm, freedreno, Laurent Pinchart, Kieran Bingham,
	Linux-Renesas

On Tue, Jan 10, 2023 at 11:20 AM Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> On Tue, Jan 10, 2023 at 8:07 AM Laurentiu Palcu
> <laurentiu.palcu@oss.nxp.com> wrote:
> > On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
> > > On 09/01/2023 18:21, Laurentiu Palcu wrote:
> > > > It looks like there are some issues with this patchset... :/ I just
> > > > fetched the drm-tip and, with these patches included, the "Hot plug
> > > > detection already enabled" warning is back for i.MX DCSS.
> > >
> > > Could you please provide a backtrace?
> >
> > Sure, see below:
> >
> > ------------[ cut here ]------------
> > Hot plug detection already enabled
> > WARNING: CPU: 2 PID: 9 at drivers/gpu/drm/drm_bridge.c:1257 drm_bridge_hpd_enable+0x94/0x9c [drm]
> > Modules linked in: videobuf2_memops snd_soc_simple_card snd_soc_simple_card_utils fsl_imx8_ddr_perf videobuf2_common snd_soc_imx_spdif adv7511 etnaviv imx8m_ddrc imx_dcss mc cec nwl_dsi gov
> > CPU: 2 PID: 9 Comm: kworker/u8:0 Not tainted 6.2.0-rc2-15208-g25b283acd578 #6
> > Hardware name: NXP i.MX8MQ EVK (DT)
> > Workqueue: events_unbound deferred_probe_work_func
> > pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> > pc : drm_bridge_hpd_enable+0x94/0x9c [drm]
> > lr : drm_bridge_hpd_enable+0x94/0x9c [drm]
> > sp : ffff800009ef3740
> > x29: ffff800009ef3740 x28: ffff000009331f00 x27: 0000000000001000
> > x26: 0000000000000020 x25: ffff800001148ed8 x24: ffff00000a8fe000
> > x23: 00000000fffffffd x22: ffff000005086348 x21: ffff800001133ee0
> > x20: ffff00000550d800 x19: ffff000005086288 x18: 0000000000000006
> > x17: 0000000000000000 x16: ffff8000096ef008 x15: 97ffff2891004260
> > x14: 2a1403e194000000 x13: 97ffff2891004260 x12: 2a1403e194000000
> > x11: 7100385f29400801 x10: 0000000000000aa0 x9 : ffff800008112744
> > x8 : ffff000000250b00 x7 : 0000000000000003 x6 : 0000000000000011
> > x5 : 0000000000000000 x4 : ffff0000bd986a48 x3 : 0000000000000001
> > x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000000250000
> > Call trace:
> >  drm_bridge_hpd_enable+0x94/0x9c [drm]
> >  drm_bridge_connector_enable_hpd+0x2c/0x3c [drm_kms_helper]
> >  drm_kms_helper_poll_enable+0x94/0x10c [drm_kms_helper]
> >  drm_helper_probe_single_connector_modes+0x1a8/0x510 [drm_kms_helper]
> >  drm_client_modeset_probe+0x204/0x1190 [drm]
> >  __drm_fb_helper_initial_config_and_unlock+0x5c/0x4a4 [drm_kms_helper]
> >  drm_fb_helper_initial_config+0x54/0x6c [drm_kms_helper]
> >  drm_fbdev_client_hotplug+0xd0/0x140 [drm_kms_helper]
> >  drm_fbdev_generic_setup+0x90/0x154 [drm_kms_helper]
> >  dcss_kms_attach+0x1c8/0x254 [imx_dcss]
> >  dcss_drv_platform_probe+0x90/0xfc [imx_dcss]
> >  platform_probe+0x70/0xcc
> >  really_probe+0xc4/0x2e0
> >  __driver_probe_device+0x80/0xf0
> >  driver_probe_device+0xe0/0x164
> >  __device_attach_driver+0xc0/0x13c
> >  bus_for_each_drv+0x84/0xe0
> >  __device_attach+0xa4/0x1a0
> >  device_initial_probe+0x1c/0x30
> >  bus_probe_device+0xa4/0xb0
> >  deferred_probe_work_func+0x90/0xd0
> >  process_one_work+0x200/0x474
> >  worker_thread+0x74/0x43c
> >  kthread+0xfc/0x110
> >  ret_from_fork+0x10/0x20
> > ---[ end trace 0000000000000000 ]---
>
> I get a similar trace on R-Car Gen2 (Koelsch with R-Car M2-W) and
> Gen3 (Salvator-XS with R-Car H3 ES2.0), and bisected it to commit
> 92d755d8f13b6791 ("drm/bridge_connector: rely on drm_kms_helper_poll_*
> for HPD enablement") in drm-misc/for-linux-next.
>
> As I do not have any displays connected, I do not know what is the
> full impact.

FTR, the issue is still present.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-02-07  9:40           ` Geert Uytterhoeven
  0 siblings, 0 replies; 106+ messages in thread
From: Geert Uytterhoeven @ 2023-02-07  9:40 UTC (permalink / raw)
  To: Laurentiu Palcu
  Cc: dri-devel, Laurent Pinchart, NXP Linux Team, linux-arm-msm,
	Sascha Hauer, Abhinav Kumar, Sean Paul, Pengutronix Kernel Team,
	linux-arm-kernel, Tomi Valkeinen, freedreno, Linux-Renesas,
	Kieran Bingham, Thomas Zimmermann, Dmitry Baryshkov, Shawn Guo

On Tue, Jan 10, 2023 at 11:20 AM Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> On Tue, Jan 10, 2023 at 8:07 AM Laurentiu Palcu
> <laurentiu.palcu@oss.nxp.com> wrote:
> > On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
> > > On 09/01/2023 18:21, Laurentiu Palcu wrote:
> > > > It looks like there are some issues with this patchset... :/ I just
> > > > fetched the drm-tip and, with these patches included, the "Hot plug
> > > > detection already enabled" warning is back for i.MX DCSS.
> > >
> > > Could you please provide a backtrace?
> >
> > Sure, see below:
> >
> > ------------[ cut here ]------------
> > Hot plug detection already enabled
> > WARNING: CPU: 2 PID: 9 at drivers/gpu/drm/drm_bridge.c:1257 drm_bridge_hpd_enable+0x94/0x9c [drm]
> > Modules linked in: videobuf2_memops snd_soc_simple_card snd_soc_simple_card_utils fsl_imx8_ddr_perf videobuf2_common snd_soc_imx_spdif adv7511 etnaviv imx8m_ddrc imx_dcss mc cec nwl_dsi gov
> > CPU: 2 PID: 9 Comm: kworker/u8:0 Not tainted 6.2.0-rc2-15208-g25b283acd578 #6
> > Hardware name: NXP i.MX8MQ EVK (DT)
> > Workqueue: events_unbound deferred_probe_work_func
> > pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> > pc : drm_bridge_hpd_enable+0x94/0x9c [drm]
> > lr : drm_bridge_hpd_enable+0x94/0x9c [drm]
> > sp : ffff800009ef3740
> > x29: ffff800009ef3740 x28: ffff000009331f00 x27: 0000000000001000
> > x26: 0000000000000020 x25: ffff800001148ed8 x24: ffff00000a8fe000
> > x23: 00000000fffffffd x22: ffff000005086348 x21: ffff800001133ee0
> > x20: ffff00000550d800 x19: ffff000005086288 x18: 0000000000000006
> > x17: 0000000000000000 x16: ffff8000096ef008 x15: 97ffff2891004260
> > x14: 2a1403e194000000 x13: 97ffff2891004260 x12: 2a1403e194000000
> > x11: 7100385f29400801 x10: 0000000000000aa0 x9 : ffff800008112744
> > x8 : ffff000000250b00 x7 : 0000000000000003 x6 : 0000000000000011
> > x5 : 0000000000000000 x4 : ffff0000bd986a48 x3 : 0000000000000001
> > x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000000250000
> > Call trace:
> >  drm_bridge_hpd_enable+0x94/0x9c [drm]
> >  drm_bridge_connector_enable_hpd+0x2c/0x3c [drm_kms_helper]
> >  drm_kms_helper_poll_enable+0x94/0x10c [drm_kms_helper]
> >  drm_helper_probe_single_connector_modes+0x1a8/0x510 [drm_kms_helper]
> >  drm_client_modeset_probe+0x204/0x1190 [drm]
> >  __drm_fb_helper_initial_config_and_unlock+0x5c/0x4a4 [drm_kms_helper]
> >  drm_fb_helper_initial_config+0x54/0x6c [drm_kms_helper]
> >  drm_fbdev_client_hotplug+0xd0/0x140 [drm_kms_helper]
> >  drm_fbdev_generic_setup+0x90/0x154 [drm_kms_helper]
> >  dcss_kms_attach+0x1c8/0x254 [imx_dcss]
> >  dcss_drv_platform_probe+0x90/0xfc [imx_dcss]
> >  platform_probe+0x70/0xcc
> >  really_probe+0xc4/0x2e0
> >  __driver_probe_device+0x80/0xf0
> >  driver_probe_device+0xe0/0x164
> >  __device_attach_driver+0xc0/0x13c
> >  bus_for_each_drv+0x84/0xe0
> >  __device_attach+0xa4/0x1a0
> >  device_initial_probe+0x1c/0x30
> >  bus_probe_device+0xa4/0xb0
> >  deferred_probe_work_func+0x90/0xd0
> >  process_one_work+0x200/0x474
> >  worker_thread+0x74/0x43c
> >  kthread+0xfc/0x110
> >  ret_from_fork+0x10/0x20
> > ---[ end trace 0000000000000000 ]---
>
> I get a similar trace on R-Car Gen2 (Koelsch with R-Car M2-W) and
> Gen3 (Salvator-XS with R-Car H3 ES2.0), and bisected it to commit
> 92d755d8f13b6791 ("drm/bridge_connector: rely on drm_kms_helper_poll_*
> for HPD enablement") in drm-misc/for-linux-next.
>
> As I do not have any displays connected, I do not know what is the
> full impact.

FTR, the issue is still present.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-02-07  9:40           ` Geert Uytterhoeven
  0 siblings, 0 replies; 106+ messages in thread
From: Geert Uytterhoeven @ 2023-02-07  9:40 UTC (permalink / raw)
  To: Laurentiu Palcu
  Cc: Dmitry Baryshkov, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen, dri-devel, linux-arm-kernel,
	linux-arm-msm, freedreno, Laurent Pinchart, Kieran Bingham,
	Linux-Renesas

On Tue, Jan 10, 2023 at 11:20 AM Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> On Tue, Jan 10, 2023 at 8:07 AM Laurentiu Palcu
> <laurentiu.palcu@oss.nxp.com> wrote:
> > On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
> > > On 09/01/2023 18:21, Laurentiu Palcu wrote:
> > > > It looks like there are some issues with this patchset... :/ I just
> > > > fetched the drm-tip and, with these patches included, the "Hot plug
> > > > detection already enabled" warning is back for i.MX DCSS.
> > >
> > > Could you please provide a backtrace?
> >
> > Sure, see below:
> >
> > ------------[ cut here ]------------
> > Hot plug detection already enabled
> > WARNING: CPU: 2 PID: 9 at drivers/gpu/drm/drm_bridge.c:1257 drm_bridge_hpd_enable+0x94/0x9c [drm]
> > Modules linked in: videobuf2_memops snd_soc_simple_card snd_soc_simple_card_utils fsl_imx8_ddr_perf videobuf2_common snd_soc_imx_spdif adv7511 etnaviv imx8m_ddrc imx_dcss mc cec nwl_dsi gov
> > CPU: 2 PID: 9 Comm: kworker/u8:0 Not tainted 6.2.0-rc2-15208-g25b283acd578 #6
> > Hardware name: NXP i.MX8MQ EVK (DT)
> > Workqueue: events_unbound deferred_probe_work_func
> > pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> > pc : drm_bridge_hpd_enable+0x94/0x9c [drm]
> > lr : drm_bridge_hpd_enable+0x94/0x9c [drm]
> > sp : ffff800009ef3740
> > x29: ffff800009ef3740 x28: ffff000009331f00 x27: 0000000000001000
> > x26: 0000000000000020 x25: ffff800001148ed8 x24: ffff00000a8fe000
> > x23: 00000000fffffffd x22: ffff000005086348 x21: ffff800001133ee0
> > x20: ffff00000550d800 x19: ffff000005086288 x18: 0000000000000006
> > x17: 0000000000000000 x16: ffff8000096ef008 x15: 97ffff2891004260
> > x14: 2a1403e194000000 x13: 97ffff2891004260 x12: 2a1403e194000000
> > x11: 7100385f29400801 x10: 0000000000000aa0 x9 : ffff800008112744
> > x8 : ffff000000250b00 x7 : 0000000000000003 x6 : 0000000000000011
> > x5 : 0000000000000000 x4 : ffff0000bd986a48 x3 : 0000000000000001
> > x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000000250000
> > Call trace:
> >  drm_bridge_hpd_enable+0x94/0x9c [drm]
> >  drm_bridge_connector_enable_hpd+0x2c/0x3c [drm_kms_helper]
> >  drm_kms_helper_poll_enable+0x94/0x10c [drm_kms_helper]
> >  drm_helper_probe_single_connector_modes+0x1a8/0x510 [drm_kms_helper]
> >  drm_client_modeset_probe+0x204/0x1190 [drm]
> >  __drm_fb_helper_initial_config_and_unlock+0x5c/0x4a4 [drm_kms_helper]
> >  drm_fb_helper_initial_config+0x54/0x6c [drm_kms_helper]
> >  drm_fbdev_client_hotplug+0xd0/0x140 [drm_kms_helper]
> >  drm_fbdev_generic_setup+0x90/0x154 [drm_kms_helper]
> >  dcss_kms_attach+0x1c8/0x254 [imx_dcss]
> >  dcss_drv_platform_probe+0x90/0xfc [imx_dcss]
> >  platform_probe+0x70/0xcc
> >  really_probe+0xc4/0x2e0
> >  __driver_probe_device+0x80/0xf0
> >  driver_probe_device+0xe0/0x164
> >  __device_attach_driver+0xc0/0x13c
> >  bus_for_each_drv+0x84/0xe0
> >  __device_attach+0xa4/0x1a0
> >  device_initial_probe+0x1c/0x30
> >  bus_probe_device+0xa4/0xb0
> >  deferred_probe_work_func+0x90/0xd0
> >  process_one_work+0x200/0x474
> >  worker_thread+0x74/0x43c
> >  kthread+0xfc/0x110
> >  ret_from_fork+0x10/0x20
> > ---[ end trace 0000000000000000 ]---
>
> I get a similar trace on R-Car Gen2 (Koelsch with R-Car M2-W) and
> Gen3 (Salvator-XS with R-Car H3 ES2.0), and bisected it to commit
> 92d755d8f13b6791 ("drm/bridge_connector: rely on drm_kms_helper_poll_*
> for HPD enablement") in drm-misc/for-linux-next.
>
> As I do not have any displays connected, I do not know what is the
> full impact.

FTR, the issue is still present.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
  2023-01-10 16:29         ` Dmitry Baryshkov
  (?)
@ 2023-02-07  9:40           ` Geert Uytterhoeven
  -1 siblings, 0 replies; 106+ messages in thread
From: Geert Uytterhoeven @ 2023-02-07  9:40 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Laurentiu Palcu, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen, dri-devel, linux-arm-kernel,
	linux-arm-msm, freedreno

Hi Dmitry,

On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
<dmitry.baryshkov@linaro.org> wrote:
> On 10/01/2023 08:57, Laurentiu Palcu wrote:
> > On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
> >> On 09/01/2023 18:21, Laurentiu Palcu wrote:
> >>> It looks like there are some issues with this patchset... :/ I just
> >>> fetched the drm-tip and, with these patches included, the "Hot plug
> >>> detection already enabled" warning is back for i.MX DCSS.
> >>
> >> Could you please provide a backtrace?
> >
> > Sure, see below:
>
> I wondered, why didn't I see this on msm, my main target nowadays. The
> msm driver is calling msm_kms_helper_poll_init() after initializing
> fbdev, so all previous kms_helper_poll_enable() calls return early.
>
> I think I have the fix ready. Let me test it locally before posting.

Is this fix available?
Do you have a lore link?
Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-02-07  9:40           ` Geert Uytterhoeven
  0 siblings, 0 replies; 106+ messages in thread
From: Geert Uytterhoeven @ 2023-02-07  9:40 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Sean Paul, dri-devel, Thomas Zimmermann, Tomi Valkeinen,
	Shawn Guo, Sascha Hauer, Abhinav Kumar, NXP Linux Team,
	Laurentiu Palcu, linux-arm-msm, freedreno,
	Pengutronix Kernel Team, linux-arm-kernel

Hi Dmitry,

On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
<dmitry.baryshkov@linaro.org> wrote:
> On 10/01/2023 08:57, Laurentiu Palcu wrote:
> > On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
> >> On 09/01/2023 18:21, Laurentiu Palcu wrote:
> >>> It looks like there are some issues with this patchset... :/ I just
> >>> fetched the drm-tip and, with these patches included, the "Hot plug
> >>> detection already enabled" warning is back for i.MX DCSS.
> >>
> >> Could you please provide a backtrace?
> >
> > Sure, see below:
>
> I wondered, why didn't I see this on msm, my main target nowadays. The
> msm driver is calling msm_kms_helper_poll_init() after initializing
> fbdev, so all previous kms_helper_poll_enable() calls return early.
>
> I think I have the fix ready. Let me test it locally before posting.

Is this fix available?
Do you have a lore link?
Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-02-07  9:40           ` Geert Uytterhoeven
  0 siblings, 0 replies; 106+ messages in thread
From: Geert Uytterhoeven @ 2023-02-07  9:40 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Laurentiu Palcu, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen, dri-devel, linux-arm-kernel,
	linux-arm-msm, freedreno

Hi Dmitry,

On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
<dmitry.baryshkov@linaro.org> wrote:
> On 10/01/2023 08:57, Laurentiu Palcu wrote:
> > On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
> >> On 09/01/2023 18:21, Laurentiu Palcu wrote:
> >>> It looks like there are some issues with this patchset... :/ I just
> >>> fetched the drm-tip and, with these patches included, the "Hot plug
> >>> detection already enabled" warning is back for i.MX DCSS.
> >>
> >> Could you please provide a backtrace?
> >
> > Sure, see below:
>
> I wondered, why didn't I see this on msm, my main target nowadays. The
> msm driver is calling msm_kms_helper_poll_init() after initializing
> fbdev, so all previous kms_helper_poll_enable() calls return early.
>
> I think I have the fix ready. Let me test it locally before posting.

Is this fix available?
Do you have a lore link?
Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
  2023-02-07  9:40           ` Geert Uytterhoeven
  (?)
@ 2023-02-07  9:59             ` Neil Armstrong
  -1 siblings, 0 replies; 106+ messages in thread
From: Neil Armstrong @ 2023-02-07  9:59 UTC (permalink / raw)
  To: Geert Uytterhoeven, Dmitry Baryshkov
  Cc: Sean Paul, dri-devel, Thomas Zimmermann, Tomi Valkeinen,
	Shawn Guo, Sascha Hauer, Abhinav Kumar, NXP Linux Team,
	Laurentiu Palcu, linux-arm-msm, freedreno,
	Pengutronix Kernel Team, linux-arm-kernel

Hi Geert,

On 07/02/2023 10:40, Geert Uytterhoeven wrote:
> Hi Dmitry,
> 
> On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
> <dmitry.baryshkov@linaro.org> wrote:
>> On 10/01/2023 08:57, Laurentiu Palcu wrote:
>>> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
>>>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
>>>>> It looks like there are some issues with this patchset... :/ I just
>>>>> fetched the drm-tip and, with these patches included, the "Hot plug
>>>>> detection already enabled" warning is back for i.MX DCSS.
>>>>
>>>> Could you please provide a backtrace?
>>>
>>> Sure, see below:
>>
>> I wondered, why didn't I see this on msm, my main target nowadays. The
>> msm driver is calling msm_kms_helper_poll_init() after initializing
>> fbdev, so all previous kms_helper_poll_enable() calls return early.
>>
>> I think I have the fix ready. Let me test it locally before posting.
> 
> Is this fix available?
> Do you have a lore link?

The fix at [1] has been applied on 2023-01-26

[1] https://lore.kernel.org/all/20230124104548.3234554-1-dmitry.baryshkov@linaro.org/

> Thanks!
> 
> Gr{oetje,eeting}s,
> 
>                          Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                  -- Linus Torvalds


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-02-07  9:59             ` Neil Armstrong
  0 siblings, 0 replies; 106+ messages in thread
From: Neil Armstrong @ 2023-02-07  9:59 UTC (permalink / raw)
  To: Geert Uytterhoeven, Dmitry Baryshkov
  Cc: Laurentiu Palcu, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen, dri-devel, linux-arm-kernel,
	linux-arm-msm, freedreno

Hi Geert,

On 07/02/2023 10:40, Geert Uytterhoeven wrote:
> Hi Dmitry,
> 
> On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
> <dmitry.baryshkov@linaro.org> wrote:
>> On 10/01/2023 08:57, Laurentiu Palcu wrote:
>>> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
>>>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
>>>>> It looks like there are some issues with this patchset... :/ I just
>>>>> fetched the drm-tip and, with these patches included, the "Hot plug
>>>>> detection already enabled" warning is back for i.MX DCSS.
>>>>
>>>> Could you please provide a backtrace?
>>>
>>> Sure, see below:
>>
>> I wondered, why didn't I see this on msm, my main target nowadays. The
>> msm driver is calling msm_kms_helper_poll_init() after initializing
>> fbdev, so all previous kms_helper_poll_enable() calls return early.
>>
>> I think I have the fix ready. Let me test it locally before posting.
> 
> Is this fix available?
> Do you have a lore link?

The fix at [1] has been applied on 2023-01-26

[1] https://lore.kernel.org/all/20230124104548.3234554-1-dmitry.baryshkov@linaro.org/

> Thanks!
> 
> Gr{oetje,eeting}s,
> 
>                          Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                  -- Linus Torvalds


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-02-07  9:59             ` Neil Armstrong
  0 siblings, 0 replies; 106+ messages in thread
From: Neil Armstrong @ 2023-02-07  9:59 UTC (permalink / raw)
  To: Geert Uytterhoeven, Dmitry Baryshkov
  Cc: Laurentiu Palcu, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen, dri-devel, linux-arm-kernel,
	linux-arm-msm, freedreno

Hi Geert,

On 07/02/2023 10:40, Geert Uytterhoeven wrote:
> Hi Dmitry,
> 
> On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
> <dmitry.baryshkov@linaro.org> wrote:
>> On 10/01/2023 08:57, Laurentiu Palcu wrote:
>>> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
>>>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
>>>>> It looks like there are some issues with this patchset... :/ I just
>>>>> fetched the drm-tip and, with these patches included, the "Hot plug
>>>>> detection already enabled" warning is back for i.MX DCSS.
>>>>
>>>> Could you please provide a backtrace?
>>>
>>> Sure, see below:
>>
>> I wondered, why didn't I see this on msm, my main target nowadays. The
>> msm driver is calling msm_kms_helper_poll_init() after initializing
>> fbdev, so all previous kms_helper_poll_enable() calls return early.
>>
>> I think I have the fix ready. Let me test it locally before posting.
> 
> Is this fix available?
> Do you have a lore link?

The fix at [1] has been applied on 2023-01-26

[1] https://lore.kernel.org/all/20230124104548.3234554-1-dmitry.baryshkov@linaro.org/

> Thanks!
> 
> Gr{oetje,eeting}s,
> 
>                          Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                  -- Linus Torvalds


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
  2023-02-07  9:59             ` Neil Armstrong
  (?)
@ 2023-02-07 10:02               ` Geert Uytterhoeven
  -1 siblings, 0 replies; 106+ messages in thread
From: Geert Uytterhoeven @ 2023-02-07 10:02 UTC (permalink / raw)
  To: neil.armstrong
  Cc: dri-devel, NXP Linux Team, Thomas Zimmermann, linux-arm-msm,
	Sascha Hauer, Abhinav Kumar, Laurentiu Palcu, Sean Paul,
	Pengutronix Kernel Team, linux-arm-kernel, Tomi Valkeinen,
	freedreno, Dmitry Baryshkov, Shawn Guo

Hi Neil,

On Tue, Feb 7, 2023 at 10:59 AM Neil Armstrong
<neil.armstrong@linaro.org> wrote:
> On 07/02/2023 10:40, Geert Uytterhoeven wrote:
> > On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
> > <dmitry.baryshkov@linaro.org> wrote:
> >> On 10/01/2023 08:57, Laurentiu Palcu wrote:
> >>> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
> >>>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
> >>>>> It looks like there are some issues with this patchset... :/ I just
> >>>>> fetched the drm-tip and, with these patches included, the "Hot plug
> >>>>> detection already enabled" warning is back for i.MX DCSS.
> >>>>
> >>>> Could you please provide a backtrace?
> >>>
> >>> Sure, see below:
> >>
> >> I wondered, why didn't I see this on msm, my main target nowadays. The
> >> msm driver is calling msm_kms_helper_poll_init() after initializing
> >> fbdev, so all previous kms_helper_poll_enable() calls return early.
> >>
> >> I think I have the fix ready. Let me test it locally before posting.
> >
> > Is this fix available?
> > Do you have a lore link?
>
> The fix at [1] has been applied on 2023-01-26
>
> [1] https://lore.kernel.org/all/20230124104548.3234554-1-dmitry.baryshkov@linaro.org/

Applied where? linux-next does not have it.
Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-02-07 10:02               ` Geert Uytterhoeven
  0 siblings, 0 replies; 106+ messages in thread
From: Geert Uytterhoeven @ 2023-02-07 10:02 UTC (permalink / raw)
  To: neil.armstrong
  Cc: Dmitry Baryshkov, Laurentiu Palcu, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar, Tomi Valkeinen, dri-devel,
	linux-arm-kernel, linux-arm-msm, freedreno

Hi Neil,

On Tue, Feb 7, 2023 at 10:59 AM Neil Armstrong
<neil.armstrong@linaro.org> wrote:
> On 07/02/2023 10:40, Geert Uytterhoeven wrote:
> > On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
> > <dmitry.baryshkov@linaro.org> wrote:
> >> On 10/01/2023 08:57, Laurentiu Palcu wrote:
> >>> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
> >>>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
> >>>>> It looks like there are some issues with this patchset... :/ I just
> >>>>> fetched the drm-tip and, with these patches included, the "Hot plug
> >>>>> detection already enabled" warning is back for i.MX DCSS.
> >>>>
> >>>> Could you please provide a backtrace?
> >>>
> >>> Sure, see below:
> >>
> >> I wondered, why didn't I see this on msm, my main target nowadays. The
> >> msm driver is calling msm_kms_helper_poll_init() after initializing
> >> fbdev, so all previous kms_helper_poll_enable() calls return early.
> >>
> >> I think I have the fix ready. Let me test it locally before posting.
> >
> > Is this fix available?
> > Do you have a lore link?
>
> The fix at [1] has been applied on 2023-01-26
>
> [1] https://lore.kernel.org/all/20230124104548.3234554-1-dmitry.baryshkov@linaro.org/

Applied where? linux-next does not have it.
Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-02-07 10:02               ` Geert Uytterhoeven
  0 siblings, 0 replies; 106+ messages in thread
From: Geert Uytterhoeven @ 2023-02-07 10:02 UTC (permalink / raw)
  To: neil.armstrong
  Cc: Dmitry Baryshkov, Laurentiu Palcu, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar, Tomi Valkeinen, dri-devel,
	linux-arm-kernel, linux-arm-msm, freedreno

Hi Neil,

On Tue, Feb 7, 2023 at 10:59 AM Neil Armstrong
<neil.armstrong@linaro.org> wrote:
> On 07/02/2023 10:40, Geert Uytterhoeven wrote:
> > On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
> > <dmitry.baryshkov@linaro.org> wrote:
> >> On 10/01/2023 08:57, Laurentiu Palcu wrote:
> >>> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
> >>>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
> >>>>> It looks like there are some issues with this patchset... :/ I just
> >>>>> fetched the drm-tip and, with these patches included, the "Hot plug
> >>>>> detection already enabled" warning is back for i.MX DCSS.
> >>>>
> >>>> Could you please provide a backtrace?
> >>>
> >>> Sure, see below:
> >>
> >> I wondered, why didn't I see this on msm, my main target nowadays. The
> >> msm driver is calling msm_kms_helper_poll_init() after initializing
> >> fbdev, so all previous kms_helper_poll_enable() calls return early.
> >>
> >> I think I have the fix ready. Let me test it locally before posting.
> >
> > Is this fix available?
> > Do you have a lore link?
>
> The fix at [1] has been applied on 2023-01-26
>
> [1] https://lore.kernel.org/all/20230124104548.3234554-1-dmitry.baryshkov@linaro.org/

Applied where? linux-next does not have it.
Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
  2023-02-07 10:02               ` Geert Uytterhoeven
  (?)
@ 2023-02-07 10:18                 ` neil.armstrong
  -1 siblings, 0 replies; 106+ messages in thread
From: neil.armstrong @ 2023-02-07 10:18 UTC (permalink / raw)
  To: Thomas Zimmermann, Geert Uytterhoeven
  Cc: Dmitry Baryshkov, Laurentiu Palcu, Maarten Lankhorst,
	Maxime Ripard, David Airlie, Daniel Vetter, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen, dri-devel, linux-arm-kernel,
	linux-arm-msm, freedreno

On 07/02/2023 11:02, Geert Uytterhoeven wrote:
> Hi Neil,
> 
> On Tue, Feb 7, 2023 at 10:59 AM Neil Armstrong
> <neil.armstrong@linaro.org> wrote:
>> On 07/02/2023 10:40, Geert Uytterhoeven wrote:
>>> On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
>>> <dmitry.baryshkov@linaro.org> wrote:
>>>> On 10/01/2023 08:57, Laurentiu Palcu wrote:
>>>>> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
>>>>>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
>>>>>>> It looks like there are some issues with this patchset... :/ I just
>>>>>>> fetched the drm-tip and, with these patches included, the "Hot plug
>>>>>>> detection already enabled" warning is back for i.MX DCSS.
>>>>>>
>>>>>> Could you please provide a backtrace?
>>>>>
>>>>> Sure, see below:
>>>>
>>>> I wondered, why didn't I see this on msm, my main target nowadays. The
>>>> msm driver is calling msm_kms_helper_poll_init() after initializing
>>>> fbdev, so all previous kms_helper_poll_enable() calls return early.
>>>>
>>>> I think I have the fix ready. Let me test it locally before posting.
>>>
>>> Is this fix available?
>>> Do you have a lore link?
>>
>> The fix at [1] has been applied on 2023-01-26
>>
>> [1] https://lore.kernel.org/all/20230124104548.3234554-1-dmitry.baryshkov@linaro.org/
> 
> Applied where? linux-next does not have it.

On drm-misc-next, it should have been send to drm-misc, but it seems the last PR
to drm-misc was sent without those:

https://cgit.freedesktop.org/drm/drm-misc/tag/?h=drm-misc-next-2023-01-26

Thomas, Maxime, is it too late to get those into v6.3 ? I did apply them before rc6.

Neil



> Thanks!
> 
> Gr{oetje,eeting}s,
> 
>                          Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                  -- Linus Torvalds


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-02-07 10:18                 ` neil.armstrong
  0 siblings, 0 replies; 106+ messages in thread
From: neil.armstrong @ 2023-02-07 10:18 UTC (permalink / raw)
  To: Thomas Zimmermann, Geert Uytterhoeven
  Cc: Sean Paul, dri-devel, Tomi Valkeinen, Shawn Guo, Sascha Hauer,
	Abhinav Kumar, NXP Linux Team, Laurentiu Palcu, Dmitry Baryshkov,
	linux-arm-msm, freedreno, Pengutronix Kernel Team,
	linux-arm-kernel

On 07/02/2023 11:02, Geert Uytterhoeven wrote:
> Hi Neil,
> 
> On Tue, Feb 7, 2023 at 10:59 AM Neil Armstrong
> <neil.armstrong@linaro.org> wrote:
>> On 07/02/2023 10:40, Geert Uytterhoeven wrote:
>>> On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
>>> <dmitry.baryshkov@linaro.org> wrote:
>>>> On 10/01/2023 08:57, Laurentiu Palcu wrote:
>>>>> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
>>>>>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
>>>>>>> It looks like there are some issues with this patchset... :/ I just
>>>>>>> fetched the drm-tip and, with these patches included, the "Hot plug
>>>>>>> detection already enabled" warning is back for i.MX DCSS.
>>>>>>
>>>>>> Could you please provide a backtrace?
>>>>>
>>>>> Sure, see below:
>>>>
>>>> I wondered, why didn't I see this on msm, my main target nowadays. The
>>>> msm driver is calling msm_kms_helper_poll_init() after initializing
>>>> fbdev, so all previous kms_helper_poll_enable() calls return early.
>>>>
>>>> I think I have the fix ready. Let me test it locally before posting.
>>>
>>> Is this fix available?
>>> Do you have a lore link?
>>
>> The fix at [1] has been applied on 2023-01-26
>>
>> [1] https://lore.kernel.org/all/20230124104548.3234554-1-dmitry.baryshkov@linaro.org/
> 
> Applied where? linux-next does not have it.

On drm-misc-next, it should have been send to drm-misc, but it seems the last PR
to drm-misc was sent without those:

https://cgit.freedesktop.org/drm/drm-misc/tag/?h=drm-misc-next-2023-01-26

Thomas, Maxime, is it too late to get those into v6.3 ? I did apply them before rc6.

Neil



> Thanks!
> 
> Gr{oetje,eeting}s,
> 
>                          Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                  -- Linus Torvalds


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-02-07 10:18                 ` neil.armstrong
  0 siblings, 0 replies; 106+ messages in thread
From: neil.armstrong @ 2023-02-07 10:18 UTC (permalink / raw)
  To: Thomas Zimmermann, Geert Uytterhoeven
  Cc: Dmitry Baryshkov, Laurentiu Palcu, Maarten Lankhorst,
	Maxime Ripard, David Airlie, Daniel Vetter, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen, dri-devel, linux-arm-kernel,
	linux-arm-msm, freedreno

On 07/02/2023 11:02, Geert Uytterhoeven wrote:
> Hi Neil,
> 
> On Tue, Feb 7, 2023 at 10:59 AM Neil Armstrong
> <neil.armstrong@linaro.org> wrote:
>> On 07/02/2023 10:40, Geert Uytterhoeven wrote:
>>> On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
>>> <dmitry.baryshkov@linaro.org> wrote:
>>>> On 10/01/2023 08:57, Laurentiu Palcu wrote:
>>>>> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
>>>>>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
>>>>>>> It looks like there are some issues with this patchset... :/ I just
>>>>>>> fetched the drm-tip and, with these patches included, the "Hot plug
>>>>>>> detection already enabled" warning is back for i.MX DCSS.
>>>>>>
>>>>>> Could you please provide a backtrace?
>>>>>
>>>>> Sure, see below:
>>>>
>>>> I wondered, why didn't I see this on msm, my main target nowadays. The
>>>> msm driver is calling msm_kms_helper_poll_init() after initializing
>>>> fbdev, so all previous kms_helper_poll_enable() calls return early.
>>>>
>>>> I think I have the fix ready. Let me test it locally before posting.
>>>
>>> Is this fix available?
>>> Do you have a lore link?
>>
>> The fix at [1] has been applied on 2023-01-26
>>
>> [1] https://lore.kernel.org/all/20230124104548.3234554-1-dmitry.baryshkov@linaro.org/
> 
> Applied where? linux-next does not have it.

On drm-misc-next, it should have been send to drm-misc, but it seems the last PR
to drm-misc was sent without those:

https://cgit.freedesktop.org/drm/drm-misc/tag/?h=drm-misc-next-2023-01-26

Thomas, Maxime, is it too late to get those into v6.3 ? I did apply them before rc6.

Neil



> Thanks!
> 
> Gr{oetje,eeting}s,
> 
>                          Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                  -- Linus Torvalds


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
  2023-02-07 10:02               ` Geert Uytterhoeven
  (?)
@ 2023-02-07 10:19                 ` Geert Uytterhoeven
  -1 siblings, 0 replies; 106+ messages in thread
From: Geert Uytterhoeven @ 2023-02-07 10:19 UTC (permalink / raw)
  To: neil.armstrong
  Cc: Dmitry Baryshkov, Laurentiu Palcu, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar, Tomi Valkeinen, dri-devel,
	linux-arm-kernel, linux-arm-msm, freedreno

Hi Neil,

On Tue, Feb 7, 2023 at 11:02 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Tue, Feb 7, 2023 at 10:59 AM Neil Armstrong
> <neil.armstrong@linaro.org> wrote:
> > On 07/02/2023 10:40, Geert Uytterhoeven wrote:
> > > On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
> > > <dmitry.baryshkov@linaro.org> wrote:
> > >> On 10/01/2023 08:57, Laurentiu Palcu wrote:
> > >>> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
> > >>>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
> > >>>>> It looks like there are some issues with this patchset... :/ I just
> > >>>>> fetched the drm-tip and, with these patches included, the "Hot plug
> > >>>>> detection already enabled" warning is back for i.MX DCSS.
> > >>>>
> > >>>> Could you please provide a backtrace?
> > >>>
> > >>> Sure, see below:
> > >>
> > >> I wondered, why didn't I see this on msm, my main target nowadays. The
> > >> msm driver is calling msm_kms_helper_poll_init() after initializing
> > >> fbdev, so all previous kms_helper_poll_enable() calls return early.
> > >>
> > >> I think I have the fix ready. Let me test it locally before posting.
> > >
> > > Is this fix available?
> > > Do you have a lore link?
> >
> > The fix at [1] has been applied on 2023-01-26
> >
> > [1] https://lore.kernel.org/all/20230124104548.3234554-1-dmitry.baryshkov@linaro.org/
>
> Applied where? linux-next does not have it.

commit cbf143b282c64e59
("drm/probe_helper: extract two helper functions") in next-20230127
next-20230130 next-20230131
commit d33a54e3991dfce8
("drm/probe_helper: sort out poll_running vs poll_enabled") in
next-20230127 next-20230130 next-20230131

but not in any later version?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-02-07 10:19                 ` Geert Uytterhoeven
  0 siblings, 0 replies; 106+ messages in thread
From: Geert Uytterhoeven @ 2023-02-07 10:19 UTC (permalink / raw)
  To: neil.armstrong
  Cc: dri-devel, NXP Linux Team, Thomas Zimmermann, linux-arm-msm,
	Sascha Hauer, Abhinav Kumar, Laurentiu Palcu, Sean Paul,
	Pengutronix Kernel Team, linux-arm-kernel, Tomi Valkeinen,
	freedreno, Dmitry Baryshkov, Shawn Guo

Hi Neil,

On Tue, Feb 7, 2023 at 11:02 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Tue, Feb 7, 2023 at 10:59 AM Neil Armstrong
> <neil.armstrong@linaro.org> wrote:
> > On 07/02/2023 10:40, Geert Uytterhoeven wrote:
> > > On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
> > > <dmitry.baryshkov@linaro.org> wrote:
> > >> On 10/01/2023 08:57, Laurentiu Palcu wrote:
> > >>> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
> > >>>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
> > >>>>> It looks like there are some issues with this patchset... :/ I just
> > >>>>> fetched the drm-tip and, with these patches included, the "Hot plug
> > >>>>> detection already enabled" warning is back for i.MX DCSS.
> > >>>>
> > >>>> Could you please provide a backtrace?
> > >>>
> > >>> Sure, see below:
> > >>
> > >> I wondered, why didn't I see this on msm, my main target nowadays. The
> > >> msm driver is calling msm_kms_helper_poll_init() after initializing
> > >> fbdev, so all previous kms_helper_poll_enable() calls return early.
> > >>
> > >> I think I have the fix ready. Let me test it locally before posting.
> > >
> > > Is this fix available?
> > > Do you have a lore link?
> >
> > The fix at [1] has been applied on 2023-01-26
> >
> > [1] https://lore.kernel.org/all/20230124104548.3234554-1-dmitry.baryshkov@linaro.org/
>
> Applied where? linux-next does not have it.

commit cbf143b282c64e59
("drm/probe_helper: extract two helper functions") in next-20230127
next-20230130 next-20230131
commit d33a54e3991dfce8
("drm/probe_helper: sort out poll_running vs poll_enabled") in
next-20230127 next-20230130 next-20230131

but not in any later version?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-02-07 10:19                 ` Geert Uytterhoeven
  0 siblings, 0 replies; 106+ messages in thread
From: Geert Uytterhoeven @ 2023-02-07 10:19 UTC (permalink / raw)
  To: neil.armstrong
  Cc: Dmitry Baryshkov, Laurentiu Palcu, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar, Tomi Valkeinen, dri-devel,
	linux-arm-kernel, linux-arm-msm, freedreno

Hi Neil,

On Tue, Feb 7, 2023 at 11:02 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Tue, Feb 7, 2023 at 10:59 AM Neil Armstrong
> <neil.armstrong@linaro.org> wrote:
> > On 07/02/2023 10:40, Geert Uytterhoeven wrote:
> > > On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
> > > <dmitry.baryshkov@linaro.org> wrote:
> > >> On 10/01/2023 08:57, Laurentiu Palcu wrote:
> > >>> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
> > >>>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
> > >>>>> It looks like there are some issues with this patchset... :/ I just
> > >>>>> fetched the drm-tip and, with these patches included, the "Hot plug
> > >>>>> detection already enabled" warning is back for i.MX DCSS.
> > >>>>
> > >>>> Could you please provide a backtrace?
> > >>>
> > >>> Sure, see below:
> > >>
> > >> I wondered, why didn't I see this on msm, my main target nowadays. The
> > >> msm driver is calling msm_kms_helper_poll_init() after initializing
> > >> fbdev, so all previous kms_helper_poll_enable() calls return early.
> > >>
> > >> I think I have the fix ready. Let me test it locally before posting.
> > >
> > > Is this fix available?
> > > Do you have a lore link?
> >
> > The fix at [1] has been applied on 2023-01-26
> >
> > [1] https://lore.kernel.org/all/20230124104548.3234554-1-dmitry.baryshkov@linaro.org/
>
> Applied where? linux-next does not have it.

commit cbf143b282c64e59
("drm/probe_helper: extract two helper functions") in next-20230127
next-20230130 next-20230131
commit d33a54e3991dfce8
("drm/probe_helper: sort out poll_running vs poll_enabled") in
next-20230127 next-20230130 next-20230131

but not in any later version?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
  2023-02-07 10:19                 ` Geert Uytterhoeven
  (?)
@ 2023-02-07 13:30                   ` neil.armstrong
  -1 siblings, 0 replies; 106+ messages in thread
From: neil.armstrong @ 2023-02-07 13:30 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Dmitry Baryshkov, Laurentiu Palcu, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar, Tomi Valkeinen, dri-devel,
	linux-arm-kernel, linux-arm-msm, freedreno

On 07/02/2023 11:19, Geert Uytterhoeven wrote:
> Hi Neil,
> 
> On Tue, Feb 7, 2023 at 11:02 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>> On Tue, Feb 7, 2023 at 10:59 AM Neil Armstrong
>> <neil.armstrong@linaro.org> wrote:
>>> On 07/02/2023 10:40, Geert Uytterhoeven wrote:
>>>> On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
>>>> <dmitry.baryshkov@linaro.org> wrote:
>>>>> On 10/01/2023 08:57, Laurentiu Palcu wrote:
>>>>>> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
>>>>>>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
>>>>>>>> It looks like there are some issues with this patchset... :/ I just
>>>>>>>> fetched the drm-tip and, with these patches included, the "Hot plug
>>>>>>>> detection already enabled" warning is back for i.MX DCSS.
>>>>>>>
>>>>>>> Could you please provide a backtrace?
>>>>>>
>>>>>> Sure, see below:
>>>>>
>>>>> I wondered, why didn't I see this on msm, my main target nowadays. The
>>>>> msm driver is calling msm_kms_helper_poll_init() after initializing
>>>>> fbdev, so all previous kms_helper_poll_enable() calls return early.
>>>>>
>>>>> I think I have the fix ready. Let me test it locally before posting.
>>>>
>>>> Is this fix available?
>>>> Do you have a lore link?
>>>
>>> The fix at [1] has been applied on 2023-01-26
>>>
>>> [1] https://lore.kernel.org/all/20230124104548.3234554-1-dmitry.baryshkov@linaro.org/
>>
>> Applied where? linux-next does not have it.
> 
> commit cbf143b282c64e59
> ("drm/probe_helper: extract two helper functions") in next-20230127
> next-20230130 next-20230131
> commit d33a54e3991dfce8
> ("drm/probe_helper: sort out poll_running vs poll_enabled") in
> next-20230127 next-20230130 next-20230131
> 
> but not in any later version?

$ git log --oneline --author=dmitry next-20230207 drivers/gpu/drm/drm_probe_helper.c
c8268795c9a9 drm/probe-helper: enable and disable HPD on connectors
78b991ccfa64 drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()

$ cat Next/SHA1s | grep drm
drm-fixes       4ec5183ec48656cec489c49f989c508b68b518e3
drm-intel-fixes 4c7b9344cadbed477372c75e3c0a8cfd542f5990
drm-misc-fixes  8f20660f053cefd4693e69cfff9cf58f4f7c4929
drm             1c0db6d84f8e0ac8f14178f13250e36ebcf457ee
drm-misc        d20a8f409259f1782f080b434054854020878f23
drm-intel       155c6b16eec2eaaaf6c71abf2d5e71641770d7ba
drm-tegra       b9930311641cf2ed905a84aabe27e8f3868aee4a
drm-msm         dbd7a2a941b8cbf9e5f79a777ed9fe0090eebb61
drm-msm-lumag   1d233b1cb149ec78c20fac58331b27bb460f9558
imx-drm         927d8fd465adbaaad6cce82f840d489d7c378f29

so weren't merged into drm-misc, I'll ping Thomas & Maxime on irc.

Neil

> 
> Gr{oetje,eeting}s,
> 
>                          Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                  -- Linus Torvalds


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-02-07 13:30                   ` neil.armstrong
  0 siblings, 0 replies; 106+ messages in thread
From: neil.armstrong @ 2023-02-07 13:30 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: dri-devel, NXP Linux Team, Thomas Zimmermann, linux-arm-msm,
	Sascha Hauer, Abhinav Kumar, Laurentiu Palcu, Sean Paul,
	Pengutronix Kernel Team, linux-arm-kernel, Tomi Valkeinen,
	freedreno, Dmitry Baryshkov, Shawn Guo

On 07/02/2023 11:19, Geert Uytterhoeven wrote:
> Hi Neil,
> 
> On Tue, Feb 7, 2023 at 11:02 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>> On Tue, Feb 7, 2023 at 10:59 AM Neil Armstrong
>> <neil.armstrong@linaro.org> wrote:
>>> On 07/02/2023 10:40, Geert Uytterhoeven wrote:
>>>> On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
>>>> <dmitry.baryshkov@linaro.org> wrote:
>>>>> On 10/01/2023 08:57, Laurentiu Palcu wrote:
>>>>>> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
>>>>>>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
>>>>>>>> It looks like there are some issues with this patchset... :/ I just
>>>>>>>> fetched the drm-tip and, with these patches included, the "Hot plug
>>>>>>>> detection already enabled" warning is back for i.MX DCSS.
>>>>>>>
>>>>>>> Could you please provide a backtrace?
>>>>>>
>>>>>> Sure, see below:
>>>>>
>>>>> I wondered, why didn't I see this on msm, my main target nowadays. The
>>>>> msm driver is calling msm_kms_helper_poll_init() after initializing
>>>>> fbdev, so all previous kms_helper_poll_enable() calls return early.
>>>>>
>>>>> I think I have the fix ready. Let me test it locally before posting.
>>>>
>>>> Is this fix available?
>>>> Do you have a lore link?
>>>
>>> The fix at [1] has been applied on 2023-01-26
>>>
>>> [1] https://lore.kernel.org/all/20230124104548.3234554-1-dmitry.baryshkov@linaro.org/
>>
>> Applied where? linux-next does not have it.
> 
> commit cbf143b282c64e59
> ("drm/probe_helper: extract two helper functions") in next-20230127
> next-20230130 next-20230131
> commit d33a54e3991dfce8
> ("drm/probe_helper: sort out poll_running vs poll_enabled") in
> next-20230127 next-20230130 next-20230131
> 
> but not in any later version?

$ git log --oneline --author=dmitry next-20230207 drivers/gpu/drm/drm_probe_helper.c
c8268795c9a9 drm/probe-helper: enable and disable HPD on connectors
78b991ccfa64 drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()

$ cat Next/SHA1s | grep drm
drm-fixes       4ec5183ec48656cec489c49f989c508b68b518e3
drm-intel-fixes 4c7b9344cadbed477372c75e3c0a8cfd542f5990
drm-misc-fixes  8f20660f053cefd4693e69cfff9cf58f4f7c4929
drm             1c0db6d84f8e0ac8f14178f13250e36ebcf457ee
drm-misc        d20a8f409259f1782f080b434054854020878f23
drm-intel       155c6b16eec2eaaaf6c71abf2d5e71641770d7ba
drm-tegra       b9930311641cf2ed905a84aabe27e8f3868aee4a
drm-msm         dbd7a2a941b8cbf9e5f79a777ed9fe0090eebb61
drm-msm-lumag   1d233b1cb149ec78c20fac58331b27bb460f9558
imx-drm         927d8fd465adbaaad6cce82f840d489d7c378f29

so weren't merged into drm-misc, I'll ping Thomas & Maxime on irc.

Neil

> 
> Gr{oetje,eeting}s,
> 
>                          Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                  -- Linus Torvalds


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-02-07 13:30                   ` neil.armstrong
  0 siblings, 0 replies; 106+ messages in thread
From: neil.armstrong @ 2023-02-07 13:30 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Dmitry Baryshkov, Laurentiu Palcu, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar, Tomi Valkeinen, dri-devel,
	linux-arm-kernel, linux-arm-msm, freedreno

On 07/02/2023 11:19, Geert Uytterhoeven wrote:
> Hi Neil,
> 
> On Tue, Feb 7, 2023 at 11:02 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>> On Tue, Feb 7, 2023 at 10:59 AM Neil Armstrong
>> <neil.armstrong@linaro.org> wrote:
>>> On 07/02/2023 10:40, Geert Uytterhoeven wrote:
>>>> On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
>>>> <dmitry.baryshkov@linaro.org> wrote:
>>>>> On 10/01/2023 08:57, Laurentiu Palcu wrote:
>>>>>> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
>>>>>>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
>>>>>>>> It looks like there are some issues with this patchset... :/ I just
>>>>>>>> fetched the drm-tip and, with these patches included, the "Hot plug
>>>>>>>> detection already enabled" warning is back for i.MX DCSS.
>>>>>>>
>>>>>>> Could you please provide a backtrace?
>>>>>>
>>>>>> Sure, see below:
>>>>>
>>>>> I wondered, why didn't I see this on msm, my main target nowadays. The
>>>>> msm driver is calling msm_kms_helper_poll_init() after initializing
>>>>> fbdev, so all previous kms_helper_poll_enable() calls return early.
>>>>>
>>>>> I think I have the fix ready. Let me test it locally before posting.
>>>>
>>>> Is this fix available?
>>>> Do you have a lore link?
>>>
>>> The fix at [1] has been applied on 2023-01-26
>>>
>>> [1] https://lore.kernel.org/all/20230124104548.3234554-1-dmitry.baryshkov@linaro.org/
>>
>> Applied where? linux-next does not have it.
> 
> commit cbf143b282c64e59
> ("drm/probe_helper: extract two helper functions") in next-20230127
> next-20230130 next-20230131
> commit d33a54e3991dfce8
> ("drm/probe_helper: sort out poll_running vs poll_enabled") in
> next-20230127 next-20230130 next-20230131
> 
> but not in any later version?

$ git log --oneline --author=dmitry next-20230207 drivers/gpu/drm/drm_probe_helper.c
c8268795c9a9 drm/probe-helper: enable and disable HPD on connectors
78b991ccfa64 drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()

$ cat Next/SHA1s | grep drm
drm-fixes       4ec5183ec48656cec489c49f989c508b68b518e3
drm-intel-fixes 4c7b9344cadbed477372c75e3c0a8cfd542f5990
drm-misc-fixes  8f20660f053cefd4693e69cfff9cf58f4f7c4929
drm             1c0db6d84f8e0ac8f14178f13250e36ebcf457ee
drm-misc        d20a8f409259f1782f080b434054854020878f23
drm-intel       155c6b16eec2eaaaf6c71abf2d5e71641770d7ba
drm-tegra       b9930311641cf2ed905a84aabe27e8f3868aee4a
drm-msm         dbd7a2a941b8cbf9e5f79a777ed9fe0090eebb61
drm-msm-lumag   1d233b1cb149ec78c20fac58331b27bb460f9558
imx-drm         927d8fd465adbaaad6cce82f840d489d7c378f29

so weren't merged into drm-misc, I'll ping Thomas & Maxime on irc.

Neil

> 
> Gr{oetje,eeting}s,
> 
>                          Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                  -- Linus Torvalds


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
  2023-02-07 13:30                   ` neil.armstrong
  (?)
@ 2023-02-07 14:57                     ` Neil Armstrong
  -1 siblings, 0 replies; 106+ messages in thread
From: Neil Armstrong @ 2023-02-07 14:57 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Dmitry Baryshkov, Laurentiu Palcu, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar, Tomi Valkeinen, dri-devel,
	linux-arm-kernel, linux-arm-msm, freedreno

Geert,

On 07/02/2023 14:30, neil.armstrong@linaro.org wrote:
> On 07/02/2023 11:19, Geert Uytterhoeven wrote:
>> Hi Neil,
>>
>> On Tue, Feb 7, 2023 at 11:02 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>>> On Tue, Feb 7, 2023 at 10:59 AM Neil Armstrong
>>> <neil.armstrong@linaro.org> wrote:
>>>> On 07/02/2023 10:40, Geert Uytterhoeven wrote:
>>>>> On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
>>>>> <dmitry.baryshkov@linaro.org> wrote:
>>>>>> On 10/01/2023 08:57, Laurentiu Palcu wrote:
>>>>>>> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
>>>>>>>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
>>>>>>>>> It looks like there are some issues with this patchset... :/ I just
>>>>>>>>> fetched the drm-tip and, with these patches included, the "Hot plug
>>>>>>>>> detection already enabled" warning is back for i.MX DCSS.
>>>>>>>>
>>>>>>>> Could you please provide a backtrace?
>>>>>>>
>>>>>>> Sure, see below:
>>>>>>
>>>>>> I wondered, why didn't I see this on msm, my main target nowadays. The
>>>>>> msm driver is calling msm_kms_helper_poll_init() after initializing
>>>>>> fbdev, so all previous kms_helper_poll_enable() calls return early.
>>>>>>
>>>>>> I think I have the fix ready. Let me test it locally before posting.
>>>>>
>>>>> Is this fix available?
>>>>> Do you have a lore link?
>>>>
>>>> The fix at [1] has been applied on 2023-01-26
>>>>
>>>> [1] https://lore.kernel.org/all/20230124104548.3234554-1-dmitry.baryshkov@linaro.org/
>>>
>>> Applied where? linux-next does not have it.
>>
>> commit cbf143b282c64e59
>> ("drm/probe_helper: extract two helper functions") in next-20230127
>> next-20230130 next-20230131
>> commit d33a54e3991dfce8
>> ("drm/probe_helper: sort out poll_running vs poll_enabled") in
>> next-20230127 next-20230130 next-20230131
>>
>> but not in any later version?
> 
> $ git log --oneline --author=dmitry next-20230207 drivers/gpu/drm/drm_probe_helper.c
> c8268795c9a9 drm/probe-helper: enable and disable HPD on connectors
> 78b991ccfa64 drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
> 
> $ cat Next/SHA1s | grep drm
> drm-fixes       4ec5183ec48656cec489c49f989c508b68b518e3
> drm-intel-fixes 4c7b9344cadbed477372c75e3c0a8cfd542f5990
> drm-misc-fixes  8f20660f053cefd4693e69cfff9cf58f4f7c4929
> drm             1c0db6d84f8e0ac8f14178f13250e36ebcf457ee
> drm-misc        d20a8f409259f1782f080b434054854020878f23
> drm-intel       155c6b16eec2eaaaf6c71abf2d5e71641770d7ba
> drm-tegra       b9930311641cf2ed905a84aabe27e8f3868aee4a
> drm-msm         dbd7a2a941b8cbf9e5f79a777ed9fe0090eebb61
> drm-msm-lumag   1d233b1cb149ec78c20fac58331b27bb460f9558
> imx-drm         927d8fd465adbaaad6cce82f840d489d7c378f29
> 
> so weren't merged into drm-misc, I'll ping Thomas & Maxime on irc.

Thomas just told me the commits were cherry-picked into drm-misc-next-fixes
and should appear on tomorrow's linux-next tree.

https://cgit.freedesktop.org/drm/drm-misc/commit/?h=drm-misc-next-fixes&id=91f43949662c9eb4a443203a188e806df8290bc9
https://cgit.freedesktop.org/drm/drm-misc/commit/?h=drm-misc-next-fixes&id=a4e771729a51168bc36317effaa9962e336d4f5e

Neil

> 
> Neil
> 
>>
>> Gr{oetje,eeting}s,
>>
>>                          Geert
>>
>> -- 
>> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>>
>> In personal conversations with technical people, I call myself a hacker. But
>> when I'm talking to journalists I just say "programmer" or something like that.
>>                                  -- Linus Torvalds
> 


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-02-07 14:57                     ` Neil Armstrong
  0 siblings, 0 replies; 106+ messages in thread
From: Neil Armstrong @ 2023-02-07 14:57 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: dri-devel, NXP Linux Team, Thomas Zimmermann, linux-arm-msm,
	Sascha Hauer, Abhinav Kumar, Laurentiu Palcu, Sean Paul,
	Pengutronix Kernel Team, linux-arm-kernel, Tomi Valkeinen,
	freedreno, Dmitry Baryshkov, Shawn Guo

Geert,

On 07/02/2023 14:30, neil.armstrong@linaro.org wrote:
> On 07/02/2023 11:19, Geert Uytterhoeven wrote:
>> Hi Neil,
>>
>> On Tue, Feb 7, 2023 at 11:02 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>>> On Tue, Feb 7, 2023 at 10:59 AM Neil Armstrong
>>> <neil.armstrong@linaro.org> wrote:
>>>> On 07/02/2023 10:40, Geert Uytterhoeven wrote:
>>>>> On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
>>>>> <dmitry.baryshkov@linaro.org> wrote:
>>>>>> On 10/01/2023 08:57, Laurentiu Palcu wrote:
>>>>>>> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
>>>>>>>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
>>>>>>>>> It looks like there are some issues with this patchset... :/ I just
>>>>>>>>> fetched the drm-tip and, with these patches included, the "Hot plug
>>>>>>>>> detection already enabled" warning is back for i.MX DCSS.
>>>>>>>>
>>>>>>>> Could you please provide a backtrace?
>>>>>>>
>>>>>>> Sure, see below:
>>>>>>
>>>>>> I wondered, why didn't I see this on msm, my main target nowadays. The
>>>>>> msm driver is calling msm_kms_helper_poll_init() after initializing
>>>>>> fbdev, so all previous kms_helper_poll_enable() calls return early.
>>>>>>
>>>>>> I think I have the fix ready. Let me test it locally before posting.
>>>>>
>>>>> Is this fix available?
>>>>> Do you have a lore link?
>>>>
>>>> The fix at [1] has been applied on 2023-01-26
>>>>
>>>> [1] https://lore.kernel.org/all/20230124104548.3234554-1-dmitry.baryshkov@linaro.org/
>>>
>>> Applied where? linux-next does not have it.
>>
>> commit cbf143b282c64e59
>> ("drm/probe_helper: extract two helper functions") in next-20230127
>> next-20230130 next-20230131
>> commit d33a54e3991dfce8
>> ("drm/probe_helper: sort out poll_running vs poll_enabled") in
>> next-20230127 next-20230130 next-20230131
>>
>> but not in any later version?
> 
> $ git log --oneline --author=dmitry next-20230207 drivers/gpu/drm/drm_probe_helper.c
> c8268795c9a9 drm/probe-helper: enable and disable HPD on connectors
> 78b991ccfa64 drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
> 
> $ cat Next/SHA1s | grep drm
> drm-fixes       4ec5183ec48656cec489c49f989c508b68b518e3
> drm-intel-fixes 4c7b9344cadbed477372c75e3c0a8cfd542f5990
> drm-misc-fixes  8f20660f053cefd4693e69cfff9cf58f4f7c4929
> drm             1c0db6d84f8e0ac8f14178f13250e36ebcf457ee
> drm-misc        d20a8f409259f1782f080b434054854020878f23
> drm-intel       155c6b16eec2eaaaf6c71abf2d5e71641770d7ba
> drm-tegra       b9930311641cf2ed905a84aabe27e8f3868aee4a
> drm-msm         dbd7a2a941b8cbf9e5f79a777ed9fe0090eebb61
> drm-msm-lumag   1d233b1cb149ec78c20fac58331b27bb460f9558
> imx-drm         927d8fd465adbaaad6cce82f840d489d7c378f29
> 
> so weren't merged into drm-misc, I'll ping Thomas & Maxime on irc.

Thomas just told me the commits were cherry-picked into drm-misc-next-fixes
and should appear on tomorrow's linux-next tree.

https://cgit.freedesktop.org/drm/drm-misc/commit/?h=drm-misc-next-fixes&id=91f43949662c9eb4a443203a188e806df8290bc9
https://cgit.freedesktop.org/drm/drm-misc/commit/?h=drm-misc-next-fixes&id=a4e771729a51168bc36317effaa9962e336d4f5e

Neil

> 
> Neil
> 
>>
>> Gr{oetje,eeting}s,
>>
>>                          Geert
>>
>> -- 
>> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>>
>> In personal conversations with technical people, I call myself a hacker. But
>> when I'm talking to journalists I just say "programmer" or something like that.
>>                                  -- Linus Torvalds
> 


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

* Re: [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically
@ 2023-02-07 14:57                     ` Neil Armstrong
  0 siblings, 0 replies; 106+ messages in thread
From: Neil Armstrong @ 2023-02-07 14:57 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Dmitry Baryshkov, Laurentiu Palcu, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	Lucas Stach, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Rob Clark, Sean Paul, Abhinav Kumar, Tomi Valkeinen, dri-devel,
	linux-arm-kernel, linux-arm-msm, freedreno

Geert,

On 07/02/2023 14:30, neil.armstrong@linaro.org wrote:
> On 07/02/2023 11:19, Geert Uytterhoeven wrote:
>> Hi Neil,
>>
>> On Tue, Feb 7, 2023 at 11:02 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>>> On Tue, Feb 7, 2023 at 10:59 AM Neil Armstrong
>>> <neil.armstrong@linaro.org> wrote:
>>>> On 07/02/2023 10:40, Geert Uytterhoeven wrote:
>>>>> On Tue, Jan 10, 2023 at 5:37 PM Dmitry Baryshkov
>>>>> <dmitry.baryshkov@linaro.org> wrote:
>>>>>> On 10/01/2023 08:57, Laurentiu Palcu wrote:
>>>>>>> On Mon, Jan 09, 2023 at 10:26:28PM +0200, Dmitry Baryshkov wrote:
>>>>>>>> On 09/01/2023 18:21, Laurentiu Palcu wrote:
>>>>>>>>> It looks like there are some issues with this patchset... :/ I just
>>>>>>>>> fetched the drm-tip and, with these patches included, the "Hot plug
>>>>>>>>> detection already enabled" warning is back for i.MX DCSS.
>>>>>>>>
>>>>>>>> Could you please provide a backtrace?
>>>>>>>
>>>>>>> Sure, see below:
>>>>>>
>>>>>> I wondered, why didn't I see this on msm, my main target nowadays. The
>>>>>> msm driver is calling msm_kms_helper_poll_init() after initializing
>>>>>> fbdev, so all previous kms_helper_poll_enable() calls return early.
>>>>>>
>>>>>> I think I have the fix ready. Let me test it locally before posting.
>>>>>
>>>>> Is this fix available?
>>>>> Do you have a lore link?
>>>>
>>>> The fix at [1] has been applied on 2023-01-26
>>>>
>>>> [1] https://lore.kernel.org/all/20230124104548.3234554-1-dmitry.baryshkov@linaro.org/
>>>
>>> Applied where? linux-next does not have it.
>>
>> commit cbf143b282c64e59
>> ("drm/probe_helper: extract two helper functions") in next-20230127
>> next-20230130 next-20230131
>> commit d33a54e3991dfce8
>> ("drm/probe_helper: sort out poll_running vs poll_enabled") in
>> next-20230127 next-20230130 next-20230131
>>
>> but not in any later version?
> 
> $ git log --oneline --author=dmitry next-20230207 drivers/gpu/drm/drm_probe_helper.c
> c8268795c9a9 drm/probe-helper: enable and disable HPD on connectors
> 78b991ccfa64 drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini()
> 
> $ cat Next/SHA1s | grep drm
> drm-fixes       4ec5183ec48656cec489c49f989c508b68b518e3
> drm-intel-fixes 4c7b9344cadbed477372c75e3c0a8cfd542f5990
> drm-misc-fixes  8f20660f053cefd4693e69cfff9cf58f4f7c4929
> drm             1c0db6d84f8e0ac8f14178f13250e36ebcf457ee
> drm-misc        d20a8f409259f1782f080b434054854020878f23
> drm-intel       155c6b16eec2eaaaf6c71abf2d5e71641770d7ba
> drm-tegra       b9930311641cf2ed905a84aabe27e8f3868aee4a
> drm-msm         dbd7a2a941b8cbf9e5f79a777ed9fe0090eebb61
> drm-msm-lumag   1d233b1cb149ec78c20fac58331b27bb460f9558
> imx-drm         927d8fd465adbaaad6cce82f840d489d7c378f29
> 
> so weren't merged into drm-misc, I'll ping Thomas & Maxime on irc.

Thomas just told me the commits were cherry-picked into drm-misc-next-fixes
and should appear on tomorrow's linux-next tree.

https://cgit.freedesktop.org/drm/drm-misc/commit/?h=drm-misc-next-fixes&id=91f43949662c9eb4a443203a188e806df8290bc9
https://cgit.freedesktop.org/drm/drm-misc/commit/?h=drm-misc-next-fixes&id=a4e771729a51168bc36317effaa9962e336d4f5e

Neil

> 
> Neil
> 
>>
>> Gr{oetje,eeting}s,
>>
>>                          Geert
>>
>> -- 
>> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>>
>> In personal conversations with technical people, I call myself a hacker. But
>> when I'm talking to journalists I just say "programmer" or something like that.
>>                                  -- Linus Torvalds
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 5/7] drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
  2022-11-02 18:07   ` Dmitry Baryshkov
  (?)
@ 2023-03-08 10:21     ` Johan Hovold
  -1 siblings, 0 replies; 106+ messages in thread
From: Johan Hovold @ 2023-03-08 10:21 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen, dri-devel, linux-arm-kernel,
	linux-arm-msm, freedreno

On Wed, Nov 02, 2022 at 09:07:03PM +0300, Dmitry Baryshkov wrote:
> The functionality of drm_bridge_connector_enable_hpd() and
> drm_bridge_connector_disable_hpd() is provided automatically by the
> drm_kms_poll helpers. Stop calling these functions manually.

I stumbled over this one when investigating a hotplug-related crash in
the MSM DRM driver which this series prevents by moving hotplug
notification enable to drm_kms_helper_poll_enable().

> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>  drivers/gpu/drm/msm/hdmi/hdmi.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
> index 93fe61b86967..a540c45d4fd3 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
> @@ -348,8 +348,6 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi,
>  		goto fail;
>  	}
>  
> -	drm_bridge_connector_enable_hpd(hdmi->connector);
> -
>  	ret = msm_hdmi_hpd_enable(hdmi->bridge);
>  	if (ret < 0) {
>  		DRM_DEV_ERROR(&hdmi->pdev->dev, "failed to enable HPD: %d\n", ret);

It looks like you are now enabling hotplug events before the DRM driver
is ready to receive them (i.e. msm_hdmi_hpd_enable() is called before
drm_bridge_connector_enable_hpd()).

Could this not lead to missed events or is the state being setup
correctly somewhere else?

Shouldn't the call to msm_hdmi_hpd_enable() be moved to when HPD is
enabled either way (e.g. by being converted to a hpd_enable callback)?

Johan

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

* Re: [PATCH v3 5/7] drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
@ 2023-03-08 10:21     ` Johan Hovold
  0 siblings, 0 replies; 106+ messages in thread
From: Johan Hovold @ 2023-03-08 10:21 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Sean Paul, dri-devel, Thomas Zimmermann, Tomi Valkeinen,
	Shawn Guo, Sascha Hauer, Abhinav Kumar, NXP Linux Team,
	Laurentiu Palcu, linux-arm-msm, freedreno,
	Pengutronix Kernel Team, linux-arm-kernel

On Wed, Nov 02, 2022 at 09:07:03PM +0300, Dmitry Baryshkov wrote:
> The functionality of drm_bridge_connector_enable_hpd() and
> drm_bridge_connector_disable_hpd() is provided automatically by the
> drm_kms_poll helpers. Stop calling these functions manually.

I stumbled over this one when investigating a hotplug-related crash in
the MSM DRM driver which this series prevents by moving hotplug
notification enable to drm_kms_helper_poll_enable().

> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>  drivers/gpu/drm/msm/hdmi/hdmi.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
> index 93fe61b86967..a540c45d4fd3 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
> @@ -348,8 +348,6 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi,
>  		goto fail;
>  	}
>  
> -	drm_bridge_connector_enable_hpd(hdmi->connector);
> -
>  	ret = msm_hdmi_hpd_enable(hdmi->bridge);
>  	if (ret < 0) {
>  		DRM_DEV_ERROR(&hdmi->pdev->dev, "failed to enable HPD: %d\n", ret);

It looks like you are now enabling hotplug events before the DRM driver
is ready to receive them (i.e. msm_hdmi_hpd_enable() is called before
drm_bridge_connector_enable_hpd()).

Could this not lead to missed events or is the state being setup
correctly somewhere else?

Shouldn't the call to msm_hdmi_hpd_enable() be moved to when HPD is
enabled either way (e.g. by being converted to a hpd_enable callback)?

Johan

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

* Re: [PATCH v3 5/7] drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
@ 2023-03-08 10:21     ` Johan Hovold
  0 siblings, 0 replies; 106+ messages in thread
From: Johan Hovold @ 2023-03-08 10:21 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen, dri-devel, linux-arm-kernel,
	linux-arm-msm, freedreno

On Wed, Nov 02, 2022 at 09:07:03PM +0300, Dmitry Baryshkov wrote:
> The functionality of drm_bridge_connector_enable_hpd() and
> drm_bridge_connector_disable_hpd() is provided automatically by the
> drm_kms_poll helpers. Stop calling these functions manually.

I stumbled over this one when investigating a hotplug-related crash in
the MSM DRM driver which this series prevents by moving hotplug
notification enable to drm_kms_helper_poll_enable().

> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>  drivers/gpu/drm/msm/hdmi/hdmi.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
> index 93fe61b86967..a540c45d4fd3 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
> @@ -348,8 +348,6 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi,
>  		goto fail;
>  	}
>  
> -	drm_bridge_connector_enable_hpd(hdmi->connector);
> -
>  	ret = msm_hdmi_hpd_enable(hdmi->bridge);
>  	if (ret < 0) {
>  		DRM_DEV_ERROR(&hdmi->pdev->dev, "failed to enable HPD: %d\n", ret);

It looks like you are now enabling hotplug events before the DRM driver
is ready to receive them (i.e. msm_hdmi_hpd_enable() is called before
drm_bridge_connector_enable_hpd()).

Could this not lead to missed events or is the state being setup
correctly somewhere else?

Shouldn't the call to msm_hdmi_hpd_enable() be moved to when HPD is
enabled either way (e.g. by being converted to a hpd_enable callback)?

Johan

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v3 5/7] drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
  2023-03-08 10:21     ` Johan Hovold
  (?)
@ 2023-03-08 12:35       ` Dmitry Baryshkov
  -1 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2023-03-08 12:35 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen, dri-devel, linux-arm-kernel,
	linux-arm-msm, freedreno

On Wed, 8 Mar 2023 at 12:20, Johan Hovold <johan@kernel.org> wrote:
>
> On Wed, Nov 02, 2022 at 09:07:03PM +0300, Dmitry Baryshkov wrote:
> > The functionality of drm_bridge_connector_enable_hpd() and
> > drm_bridge_connector_disable_hpd() is provided automatically by the
> > drm_kms_poll helpers. Stop calling these functions manually.
>
> I stumbled over this one when investigating a hotplug-related crash in
> the MSM DRM driver which this series prevents by moving hotplug
> notification enable to drm_kms_helper_poll_enable().
>
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > ---
> >  drivers/gpu/drm/msm/hdmi/hdmi.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
> > index 93fe61b86967..a540c45d4fd3 100644
> > --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
> > +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
> > @@ -348,8 +348,6 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi,
> >               goto fail;
> >       }
> >
> > -     drm_bridge_connector_enable_hpd(hdmi->connector);
> > -
> >       ret = msm_hdmi_hpd_enable(hdmi->bridge);
> >       if (ret < 0) {
> >               DRM_DEV_ERROR(&hdmi->pdev->dev, "failed to enable HPD: %d\n", ret);
>
> It looks like you are now enabling hotplug events before the DRM driver
> is ready to receive them (i.e. msm_hdmi_hpd_enable() is called before
> drm_bridge_connector_enable_hpd()).
>
> Could this not lead to missed events or is the state being setup
> correctly somewhere else?
>
> Shouldn't the call to msm_hdmi_hpd_enable() be moved to when HPD is
> enabled either way (e.g. by being converted to a hpd_enable callback)?

Eventually I'll get to it (hopefully during this weekend). There is
one item which needs to be investigated, see [1]. I have to check if
this is applicable to earlier generations, which also means
resurrecting the msm8974 HDMI PHY patchset posted ages ago. I think
the initial status is determined correctly using the .detect(). At
least I saw no issues with this patchset. However, thanks for the
pointer.

[1] https://git.codelinaro.org/linaro/qcomlt/kernel/-/commit/6ae2c308555f470ba63f90b7171519a242f96a67


-- 
With best wishes
Dmitry

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

* Re: [PATCH v3 5/7] drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
@ 2023-03-08 12:35       ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2023-03-08 12:35 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Sean Paul, dri-devel, Thomas Zimmermann, Tomi Valkeinen,
	Shawn Guo, Sascha Hauer, Abhinav Kumar, NXP Linux Team,
	Laurentiu Palcu, linux-arm-msm, freedreno,
	Pengutronix Kernel Team, linux-arm-kernel

On Wed, 8 Mar 2023 at 12:20, Johan Hovold <johan@kernel.org> wrote:
>
> On Wed, Nov 02, 2022 at 09:07:03PM +0300, Dmitry Baryshkov wrote:
> > The functionality of drm_bridge_connector_enable_hpd() and
> > drm_bridge_connector_disable_hpd() is provided automatically by the
> > drm_kms_poll helpers. Stop calling these functions manually.
>
> I stumbled over this one when investigating a hotplug-related crash in
> the MSM DRM driver which this series prevents by moving hotplug
> notification enable to drm_kms_helper_poll_enable().
>
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > ---
> >  drivers/gpu/drm/msm/hdmi/hdmi.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
> > index 93fe61b86967..a540c45d4fd3 100644
> > --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
> > +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
> > @@ -348,8 +348,6 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi,
> >               goto fail;
> >       }
> >
> > -     drm_bridge_connector_enable_hpd(hdmi->connector);
> > -
> >       ret = msm_hdmi_hpd_enable(hdmi->bridge);
> >       if (ret < 0) {
> >               DRM_DEV_ERROR(&hdmi->pdev->dev, "failed to enable HPD: %d\n", ret);
>
> It looks like you are now enabling hotplug events before the DRM driver
> is ready to receive them (i.e. msm_hdmi_hpd_enable() is called before
> drm_bridge_connector_enable_hpd()).
>
> Could this not lead to missed events or is the state being setup
> correctly somewhere else?
>
> Shouldn't the call to msm_hdmi_hpd_enable() be moved to when HPD is
> enabled either way (e.g. by being converted to a hpd_enable callback)?

Eventually I'll get to it (hopefully during this weekend). There is
one item which needs to be investigated, see [1]. I have to check if
this is applicable to earlier generations, which also means
resurrecting the msm8974 HDMI PHY patchset posted ages ago. I think
the initial status is determined correctly using the .detect(). At
least I saw no issues with this patchset. However, thanks for the
pointer.

[1] https://git.codelinaro.org/linaro/qcomlt/kernel/-/commit/6ae2c308555f470ba63f90b7171519a242f96a67


-- 
With best wishes
Dmitry

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

* Re: [PATCH v3 5/7] drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd()
@ 2023-03-08 12:35       ` Dmitry Baryshkov
  0 siblings, 0 replies; 106+ messages in thread
From: Dmitry Baryshkov @ 2023-03-08 12:35 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Laurentiu Palcu, Lucas Stach,
	Philipp Zabel, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Rob Clark, Sean Paul,
	Abhinav Kumar, Tomi Valkeinen, dri-devel, linux-arm-kernel,
	linux-arm-msm, freedreno

On Wed, 8 Mar 2023 at 12:20, Johan Hovold <johan@kernel.org> wrote:
>
> On Wed, Nov 02, 2022 at 09:07:03PM +0300, Dmitry Baryshkov wrote:
> > The functionality of drm_bridge_connector_enable_hpd() and
> > drm_bridge_connector_disable_hpd() is provided automatically by the
> > drm_kms_poll helpers. Stop calling these functions manually.
>
> I stumbled over this one when investigating a hotplug-related crash in
> the MSM DRM driver which this series prevents by moving hotplug
> notification enable to drm_kms_helper_poll_enable().
>
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > ---
> >  drivers/gpu/drm/msm/hdmi/hdmi.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
> > index 93fe61b86967..a540c45d4fd3 100644
> > --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
> > +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
> > @@ -348,8 +348,6 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi,
> >               goto fail;
> >       }
> >
> > -     drm_bridge_connector_enable_hpd(hdmi->connector);
> > -
> >       ret = msm_hdmi_hpd_enable(hdmi->bridge);
> >       if (ret < 0) {
> >               DRM_DEV_ERROR(&hdmi->pdev->dev, "failed to enable HPD: %d\n", ret);
>
> It looks like you are now enabling hotplug events before the DRM driver
> is ready to receive them (i.e. msm_hdmi_hpd_enable() is called before
> drm_bridge_connector_enable_hpd()).
>
> Could this not lead to missed events or is the state being setup
> correctly somewhere else?
>
> Shouldn't the call to msm_hdmi_hpd_enable() be moved to when HPD is
> enabled either way (e.g. by being converted to a hpd_enable callback)?

Eventually I'll get to it (hopefully during this weekend). There is
one item which needs to be investigated, see [1]. I have to check if
this is applicable to earlier generations, which also means
resurrecting the msm8974 HDMI PHY patchset posted ages ago. I think
the initial status is determined correctly using the .detect(). At
least I saw no issues with this patchset. However, thanks for the
pointer.

[1] https://git.codelinaro.org/linaro/qcomlt/kernel/-/commit/6ae2c308555f470ba63f90b7171519a242f96a67


-- 
With best wishes
Dmitry

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-03-08 12:36 UTC | newest]

Thread overview: 106+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02 18:06 [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically Dmitry Baryshkov
2022-11-02 18:06 ` Dmitry Baryshkov
2022-11-02 18:06 ` Dmitry Baryshkov
2022-11-02 18:06 ` [PATCH v3 1/7] drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini() Dmitry Baryshkov
2022-11-02 18:06   ` Dmitry Baryshkov
2022-11-02 18:06   ` Dmitry Baryshkov
2022-11-02 18:07 ` [PATCH v3 2/7] drm/probe-helper: enable and disable HPD on connectors Dmitry Baryshkov
2022-11-02 18:07   ` Dmitry Baryshkov
2022-11-02 18:07   ` Dmitry Baryshkov
2022-11-02 18:07 ` [PATCH v3 3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement Dmitry Baryshkov
2022-11-02 18:07   ` Dmitry Baryshkov
2022-11-02 18:07   ` Dmitry Baryshkov
     [not found]   ` <CGME20230111124140eucas1p21242c8b4cb0fc8a994d66827ca76a3ee@eucas1p2.samsung.com>
2023-01-11 12:41     ` [v3,3/7] " Marek Szyprowski
2023-01-11 12:41       ` Marek Szyprowski
2023-01-11 12:41       ` Marek Szyprowski
2023-01-11 12:41       ` Marek Szyprowski
2023-01-12  9:35       ` [v3, 3/7] " Neil Armstrong
2023-01-12  9:35         ` [v3,3/7] " Neil Armstrong
2023-01-12  9:35         ` Neil Armstrong
2023-01-12  9:35         ` Neil Armstrong
2023-01-12  9:36         ` [v3, 3/7] " Dmitry Baryshkov
2023-01-12  9:36           ` [v3,3/7] " Dmitry Baryshkov
2023-01-12  9:36           ` Dmitry Baryshkov
2023-01-12  9:36           ` Dmitry Baryshkov
2023-01-12 10:48         ` Marek Szyprowski
2023-01-12 10:48           ` Marek Szyprowski
2023-01-12 10:48           ` Marek Szyprowski
2023-01-12 10:48           ` Marek Szyprowski
2022-11-02 18:07 ` [PATCH v3 4/7] drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd() Dmitry Baryshkov
2022-11-02 18:07   ` Dmitry Baryshkov
2022-11-02 18:07   ` Dmitry Baryshkov
2023-01-05 14:09   ` Neil Armstrong
2023-01-05 14:09     ` Neil Armstrong
2023-01-05 14:09     ` Neil Armstrong
2022-11-02 18:07 ` [PATCH v3 5/7] drm/msm/hdmi: " Dmitry Baryshkov
2022-11-02 18:07   ` Dmitry Baryshkov
2022-11-02 18:07   ` Dmitry Baryshkov
2023-03-08 10:21   ` Johan Hovold
2023-03-08 10:21     ` Johan Hovold
2023-03-08 10:21     ` Johan Hovold
2023-03-08 12:35     ` Dmitry Baryshkov
2023-03-08 12:35       ` Dmitry Baryshkov
2023-03-08 12:35       ` Dmitry Baryshkov
2022-11-02 18:07 ` [PATCH v3 6/7] drm/omap: " Dmitry Baryshkov
2022-11-02 18:07   ` Dmitry Baryshkov
2022-11-02 18:07   ` Dmitry Baryshkov
2022-11-02 18:07 ` [PATCH v3 7/7] drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd() Dmitry Baryshkov
2022-11-02 18:07   ` Dmitry Baryshkov
2022-11-02 18:07   ` Dmitry Baryshkov
2022-12-28 21:58 ` [PATCH v3 0/7] drm/bridge_connector: perform HPD enablement automatically Dmitry Baryshkov
2022-12-28 21:58   ` Dmitry Baryshkov
2022-12-28 21:58   ` Dmitry Baryshkov
2023-01-04  7:29   ` Tomi Valkeinen
2023-01-04  7:29     ` Tomi Valkeinen
2023-01-04  7:29     ` Tomi Valkeinen
2023-01-04  9:05     ` Neil Armstrong
2023-01-04  9:05       ` Neil Armstrong
2023-01-04  9:05       ` Neil Armstrong
2023-01-05 12:31       ` Dmitry Baryshkov
2023-01-05 12:31         ` Dmitry Baryshkov
2023-01-05 12:31         ` Dmitry Baryshkov
2023-01-05 12:33         ` Tomi Valkeinen
2023-01-05 12:33           ` Tomi Valkeinen
2023-01-05 12:33           ` Tomi Valkeinen
2023-01-05 14:12 ` Neil Armstrong
2023-01-05 14:12   ` Neil Armstrong
2023-01-05 14:12   ` Neil Armstrong
2023-01-09 16:21 ` Laurentiu Palcu
2023-01-09 16:21   ` Laurentiu Palcu
2023-01-09 16:21   ` Laurentiu Palcu
2023-01-09 20:26   ` Dmitry Baryshkov
2023-01-09 20:26     ` Dmitry Baryshkov
2023-01-09 20:26     ` Dmitry Baryshkov
2023-01-10  6:57     ` Laurentiu Palcu
2023-01-10  6:57       ` Laurentiu Palcu
2023-01-10  6:57       ` Laurentiu Palcu
2023-01-10 10:20       ` Geert Uytterhoeven
2023-01-10 10:20         ` Geert Uytterhoeven
2023-01-10 10:20         ` Geert Uytterhoeven
2023-02-07  9:40         ` Geert Uytterhoeven
2023-02-07  9:40           ` Geert Uytterhoeven
2023-02-07  9:40           ` Geert Uytterhoeven
2023-01-10 16:29       ` Dmitry Baryshkov
2023-01-10 16:29         ` Dmitry Baryshkov
2023-01-10 16:29         ` Dmitry Baryshkov
2023-02-07  9:40         ` Geert Uytterhoeven
2023-02-07  9:40           ` Geert Uytterhoeven
2023-02-07  9:40           ` Geert Uytterhoeven
2023-02-07  9:59           ` Neil Armstrong
2023-02-07  9:59             ` Neil Armstrong
2023-02-07  9:59             ` Neil Armstrong
2023-02-07 10:02             ` Geert Uytterhoeven
2023-02-07 10:02               ` Geert Uytterhoeven
2023-02-07 10:02               ` Geert Uytterhoeven
2023-02-07 10:18               ` neil.armstrong
2023-02-07 10:18                 ` neil.armstrong
2023-02-07 10:18                 ` neil.armstrong
2023-02-07 10:19               ` Geert Uytterhoeven
2023-02-07 10:19                 ` Geert Uytterhoeven
2023-02-07 10:19                 ` Geert Uytterhoeven
2023-02-07 13:30                 ` neil.armstrong
2023-02-07 13:30                   ` neil.armstrong
2023-02-07 13:30                   ` neil.armstrong
2023-02-07 14:57                   ` Neil Armstrong
2023-02-07 14:57                     ` Neil Armstrong
2023-02-07 14:57                     ` Neil Armstrong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.