Skip to contentSkip to conversation

Revert "drm/msm/dp: use drm_bridge_hpd_notify() to report HPD status changes"

PATCH In review Dmitry Baryshkov 5 participants 10 messages Feb 27, 2024 – Feb 29, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "drm/msm/dp: use drm_bridge_hpd_notify() to report HPD status changes"

This reverts commit e467e0bde881 ("drm/msm/dp: use drm_bridge_hpd_notify() to report HPD status changes").

The commit changed the way how the MSM DP driver communicates HPD-related events to the userspace. The mentioned commit made some of the HPD events being reported earlier. This way userspace starts poking around. It interacts in a bad way with the dp_bridge_detect and the driver's state machine, ending up either with the very long delays during hotplug detection or even inability of the DP driver to report the display as connected.

A proper fix will involve redesigning of the HPD handling in the MSM DP driver. It is underway, but it will be intrusive and can not be thought about as a simple fix for the issue. Thus, revert the offending commit.

Fixes e467e0bde881 ("drm/msm/dp: use drm_bridge_hpd_notify() to report HPD status changes")
---
 drivers/gpu/drm/msm/dp/dp_display.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/dp/dp_display.c +18 -2
index d37d599aec27..4c72124ffb5d 100644
@@ -329,10 +329,26 @@ static const struct component_ops dp_display_comp_ops = {
 	.unbind = dp_display_unbind,
 };
 
+static void dp_display_send_hpd_event(struct msm_dp *dp_display)
+{
+	struct dp_display_private *dp;
+	struct drm_connector *connector;
+
+	dp = container_of(dp_display, struct dp_display_private, dp_display);
+
+	connector = dp->dp_display.connector;
+	drm_helper_hpd_irq_event(connector->dev);
+}
+
 static int dp_display_send_hpd_notification(struct dp_display_private *dp,
 					    bool hpd)
 {
-	struct drm_bridge *bridge = dp->dp_display.bridge;
+	if ((hpd && dp->dp_display.link_ready) ||
+			(!hpd && !dp->dp_display.link_ready)) {
+		drm_dbg_dp(dp->drm_dev, "HPD already %s\n",
+				(hpd ? "on" : "off"));
+		return 0;
+	}
 
 	/* reset video pattern flag on disconnect */
 	if (!hpd) {
@@ -348,7 +364,7 @@ static int dp_display_send_hpd_notification(struct dp_display_private *dp,
 
 	drm_dbg_dp(dp->drm_dev, "type=%d hpd=%d\n",
 			dp->dp_display.connector_type, hpd);
-	drm_bridge_hpd_notify(bridge, dp->dp_display.link_ready);
+	dp_display_send_hpd_event(&dp->dp_display);
 
 	return 0;
 }
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Dmitry Baryshkov

This reverts commit e467e0bde881 ("drm/msm/dp: use drm_bridge_hpd_notify() to report HPD status changes").

The commit changed the way how the MSM DP driver communicates HPD-related events to the userspace. The mentioned commit made some of the HPD events being reported earlier. This way userspace starts poking around. It interacts in a bad way with the dp_bridge_detect and the driver's state machine, ending up either with the very long delays during hotplug detection or even inability of the DP driver to report the display as connected.

Quoted 4 lines

A proper fix will involve redesigning of the HPD handling in the MSM DP driver. It is underway, but it will be intrusive and can not be thought about as a simple fix for the issue. Thus, revert the offending commit.

Yes, for fixing this on 6.9 I am fine with this.

I hope there were not other changes which were built on top of this. So it will be better if we retest internal HPD case as well with this.

We will do that in a day or two and give Tested-by.

Quoted 9 lines
Fixes e467e0bde881 ("drm/msm/dp: use drm_bridge_hpd_notify() to report HPD status changes")
---
  drivers/gpu/drm/msm/dp/dp_display.c | 20 ++++++++++++++++++--
  1 file changed, 18 insertions(+), 2 deletions(-)

For the change itself,

Tested-by
#2 lore raw
Quoted 35 lines · Abhinav Kumar
Quoted 11 lines · Dmitry Baryshkov

This reverts commit e467e0bde881 ("drm/msm/dp: use drm_bridge_hpd_notify() to report HPD status changes").

The commit changed the way how the MSM DP driver communicates HPD-related events to the userspace. The mentioned commit made some of the HPD events being reported earlier. This way userspace starts poking around. It interacts in a bad way with the dp_bridge_detect and the driver's state machine, ending up either with the very long delays during hotplug detection or even inability of the DP driver to report the display as connected.

Quoted 4 lines

A proper fix will involve redesigning of the HPD handling in the MSM DP driver. It is underway, but it will be intrusive and can not be thought about as a simple fix for the issue. Thus, revert the offending commit.

Yes, for fixing this on 6.9 I am fine with this.

I hope there were not other changes which were built on top of this. So it will be better if we retest internal HPD case as well with this.

We will do that in a day or two and give Tested-by.

Quoted 9 lines
Fixes e467e0bde881 ("drm/msm/dp: use drm_bridge_hpd_notify() to report HPD status changes")

---
  drivers/gpu/drm/msm/dp/dp_display.c | 20 ++++++++++++++++++--

  1 file changed, 18 insertions(+), 2 deletions(-)
Quoted 4 lines

For the change itself,

#3 lore raw
In reply to Abhinav Kumar
Quoted 12 lines · Abhinav Kumar
Quoted 11 lines · Dmitry Baryshkov

This reverts commit e467e0bde881 ("drm/msm/dp: use drm_bridge_hpd_notify() to report HPD status changes").

The commit changed the way how the MSM DP driver communicates HPD-related events to the userspace. The mentioned commit made some of the HPD events being reported earlier. This way userspace starts poking around. It interacts in a bad way with the dp_bridge_detect and the driver's state machine, ending up either with the very long delays during hotplug detection or even inability of the DP driver to report the display as connected.

Quoted 5 lines
Quoted 3 lines

A proper fix will involve redesigning of the HPD handling in the MSM DP driver. It is underway, but it will be intrusive and can not be thought about as a simple fix for the issue. Thus, revert the offending commit.

Yes, for fixing this on 6.9 I am fine with this.

Since this is a regression in 6.8-rc1, I hope you meant to say 6.8 here?

Quoted 4 lines

I hope there were not other changes which were built on top of this. So it will be better if we retest internal HPD case as well with this.

We will do that in a day or two and give Tested-by.

Johan

#4 lore raw
Quoted 14 lines · Johan Hovold
Quoted 12 lines · Abhinav Kumar
Quoted 11 lines · Dmitry Baryshkov

This reverts commit e467e0bde881 ("drm/msm/dp: use drm_bridge_hpd_notify() to report HPD status changes").

The commit changed the way how the MSM DP driver communicates HPD-related events to the userspace. The mentioned commit made some of the HPD events being reported earlier. This way userspace starts poking around. It interacts in a bad way with the dp_bridge_detect and the driver's state machine, ending up either with the very long delays during hotplug detection or even inability of the DP driver to report the display as connected.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

A proper fix will involve redesigning of the HPD handling in the MSM DP driver. It is underway, but it will be intrusive and can not be thought about as a simple fix for the issue. Thus, revert the offending commit.

Yes, for fixing this on 6.9 I am fine with this.

Since this is a regression in 6.8-rc1, I hope you meant to say 6.8 here?

In the worst case it will land to 6.8.x via the stable tree process.

Quoted 7 lines
Quoted 5 lines

I hope there were not other changes which were built on top of this. So it will be better if we retest internal HPD case as well with this.

We will do that in a day or two and give Tested-by.

Johan

Signature · 2 lines
With best wishes
Dmitry
#5 lore raw
Quoted 19 lines · Dmitry Baryshkov
Quoted 18 lines · Johan Hovold
Quoted 16 lines · Abhinav Kumar
Quoted 14 lines · Dmitry Baryshkov

This reverts commit e467e0bde881 ("drm/msm/dp: use drm_bridge_hpd_notify() to report HPD status changes").

The commit changed the way how the MSM DP driver communicates HPD-related events to the userspace. The mentioned commit made some of the HPD events being reported earlier. This way userspace starts poking around. It interacts in a bad way with the dp_bridge_detect and the driver's state machine, ending up either with the very long delays during hotplug detection or even inability of the DP driver to report the display as connected.

A proper fix will involve redesigning of the HPD handling in the MSM DP driver. It is underway, but it will be intrusive and can not be thought about as a simple fix for the issue. Thus, revert the offending commit.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Yes, for fixing this on 6.9 I am fine with this.

Since this is a regression in 6.8-rc1, I hope you meant to say 6.8 here?

In the worst case it will land to 6.8.x via the stable tree process.

This is a fix for a user-visible regression that was reported formally two weeks ago and informally (e.g. to you) soon after rc1 came out, and which now also has an identified cause and an analysis of the problem. And we're at rc6 so there should be no reason to delay fixing this (e.g. even if you want to run some more tests for a couple of days).

Johan

#6 lore raw
Quoted 24 lines · Johan Hovold
Quoted 23 lines · Dmitry Baryshkov
Quoted 21 lines · Johan Hovold
Quoted 12 lines · Abhinav Kumar
Quoted 11 lines · Dmitry Baryshkov

This reverts commit e467e0bde881 ("drm/msm/dp: use drm_bridge_hpd_notify() to report HPD status changes").

The commit changed the way how the MSM DP driver communicates HPD-related events to the userspace. The mentioned commit made some of the HPD events being reported earlier. This way userspace starts poking around. It interacts in a bad way with the dp_bridge_detect and the driver's state machine, ending up either with the very long delays during hotplug detection or even inability of the DP driver to report the display as connected.

Quoted 5 lines
Quoted 3 lines

A proper fix will involve redesigning of the HPD handling in the MSM DP driver. It is underway, but it will be intrusive and can not be thought about as a simple fix for the issue. Thus, revert the offending commit.

Yes, for fixing this on 6.9 I am fine with this.

Since this is a regression in 6.8-rc1, I hope you meant to say 6.8 here?

Quoted 8 lines
Quoted 1 line

In the worst case it will land to 6.8.x via the stable tree process.

This is a fix for a user-visible regression that was reported formally two weeks ago and informally (e.g. to you) soon after rc1 came out, and which now also has an identified cause and an analysis of the problem. And we're at rc6 so there should be no reason to delay fixing this (e.g. even if you want to run some more tests for a couple of days).

Yup, we landed it in msm-fixes now, so this will go as a late -fixes PR for 6.8.

Quoted 1 line

Johan

#7 lore raw
Quoted 10 lines · Abhinav Kumar
Quoted 5 lines · Johan Hovold

This is a fix for a user-visible regression that was reported formally two weeks ago and informally (e.g. to you) soon after rc1 came out, and which now also has an identified cause and an analysis of the problem. And we're at rc6 so there should be no reason to delay fixing this (e.g. even if you want to run some more tests for a couple of days).

Yup, we landed it in msm-fixes now, so this will go as a late -fixes PR for 6.8.

Perfect, thanks!

Johan

Tested-by on v1 1/1
#8 lore raw
In reply to Dmitry Baryshkov
Quoted 15 lines · Dmitry Baryshkov

This reverts commit e467e0bde881 ("drm/msm/dp: use drm_bridge_hpd_notify() to report HPD status changes").

The commit changed the way how the MSM DP driver communicates HPD-related events to the userspace. The mentioned commit made some of the HPD events being reported earlier. This way userspace starts poking around. It interacts in a bad way with the dp_bridge_detect and the driver's state machine, ending up either with the very long delays during hotplug detection or even inability of the DP driver to report the display as connected.

A proper fix will involve redesigning of the HPD handling in the MSM DP driver. It is underway, but it will be intrusive and can not be thought about as a simple fix for the issue. Thus, revert the offending commit.

Quoted 5 lines
Fixes e467e0bde881 ("drm/msm/dp: use drm_bridge_hpd_notify() to report HPD status changes")
Tested-by on v1 1/1
#9 lore raw
In reply to Dmitry Baryshkov
Quoted 57 lines · Dmitry Baryshkov

This reverts commit e467e0bde881 ("drm/msm/dp: use drm_bridge_hpd_notify() to report HPD status changes").

The commit changed the way how the MSM DP driver communicates HPD-related events to the userspace. The mentioned commit made some of the HPD events being reported earlier. This way userspace starts poking around. It interacts in a bad way with the dp_bridge_detect and the driver's state machine, ending up either with the very long delays during hotplug detection or even inability of the DP driver to report the display as connected.

A proper fix will involve redesigning of the HPD handling in the MSM DP driver. It is underway, but it will be intrusive and can not be thought about as a simple fix for the issue. Thus, revert the offending commit.

Fixes e467e0bde881 ("drm/msm/dp: use drm_bridge_hpd_notify() to report HPD status changes")
---
  drivers/gpu/drm/msm/dp/dp_display.c | 20 ++++++++++++++++++--
  1 file changed, 18 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/dp/dp_display.c +17 -1
index d37d599aec27..4c72124ffb5d 100644
@@ -329,10 +329,26 @@ static const struct component_ops dp_display_comp_ops = {
  	.unbind = dp_display_unbind,
  };
 
+static void dp_display_send_hpd_event(struct msm_dp *dp_display)
+{
+	struct dp_display_private *dp;
+	struct drm_connector *connector;
+
+	dp = container_of(dp_display, struct dp_display_private, dp_display);
+
+	connector = dp->dp_display.connector;
+	drm_helper_hpd_irq_event(connector->dev);
+}
+
  static int dp_display_send_hpd_notification(struct dp_display_private *dp,
  					    bool hpd)
  {
-	struct drm_bridge *bridge = dp->dp_display.bridge;
+	if ((hpd && dp->dp_display.link_ready) ||
+			(!hpd && !dp->dp_display.link_ready)) {
+		drm_dbg_dp(dp->drm_dev, "HPD already %s\n",
+				(hpd ? "on" : "off"));
+		return 0;
+	}
 
  	/* reset video pattern flag on disconnect */
  	if (!hpd) {

drivers/gpu/drm/msm/dp/dp_display.c static int dp_display_send_hpd_notification(struct dp_display_private *dp, · line 370

Quoted 8 lines
drivers/gpu/drm/msm/dp/dp_display.c +1 -1
@@ -348,7 +364,7 @@ static int dp_display_send_hpd_notification(struct dp_display_private *dp,
 
  	drm_dbg_dp(dp->drm_dev, "type=%d hpd=%d\n",
  			dp->dp_display.connector_type, hpd);
-	drm_bridge_hpd_notify(bridge, dp->dp_display.link_ready);
+	dp_display_send_hpd_event(&dp->dp_display);
 
  	return 0;
  }