mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
* [PATCH 0/5] drm/msm/dp: Add MSM Type-C MST support
@ 2026-06-29 14:48 Yongxing Mou
  2026-06-29 14:48 ` [PATCH 1/5] drm/bridge: allow hpd_notify() to suppress connector hotplug events Yongxing Mou
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Yongxing Mou @ 2026-06-29 14:48 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Rob Clark,
	Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
	Marijn Suijten, Tomi Valkeinen, Bjorn Andersson, Konrad Dybcio
  Cc: dri-devel, linux-kernel, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, freedreno, Yongxing Mou

The bridge connector framework currently treats every HPD notification
as a connector state update and emits a userspace hotplug event.
Once MST is enabled, however, connector creation, removal and hotplug
handling are already managed by the DRM DP MST topology manager.

As a result:

  - the SST connector may transiently transition between connected and
    disconnected during MST initialization

  - MST IRQ notifications may generate duplicate userspace hotplug
    events, once from the bridge connector layer and once from the MST
    topology manager

Introduce explicit support for IRQ-only HPD notifications in the bridge
connector framework and allow bridge drivers to suppress connector
hotplug events when those events are already handled elsewhere.

MSM DP uses these mechanisms to integrate Type-C MST hubs without
generating duplicate or spurious userspace hotplug notifications.

Testing
-------
Tested on Hamoa-EVK with a Type-C MST hub and dual-monitor setup.
Both fbcon and Weston were exercised. No duplicate hotplug events,
connector state oscillation or display flickering were observed after
hub attachment.

Dependencies
------------
This patch series was made on top of:

[1] drm: handle IRQ_HPD events correctly (v4)
    https://lore.kernel.org/r/20260608-hpd-irq-events-v4-0-30b62b335487@oss.qualcomm.com

[2] drm/msm/dp: Add MST support for MSM chipsets (v5)
    https://patchwork.freedesktop.org/series/142207/#rev5

[3] drm/msm/dp: Prerequisite cleanup for upcoming MST support (v7)
    https://lore.kernel.org/r/20260609-dp_mstclean-v7-0-ea04113e8233@oss.qualcomm.com

Signed-off-by: Yongxing Mou <yongxing.mou@oss.qualcomm.com>
---
Yongxing Mou (5):
      drm/bridge: allow hpd_notify() to suppress connector hotplug events
      drm/bridge_connector: preserve connector status for IRQ-only HPD events
      drm/msm/dp: suppress bridge hotplug events during MST operation
      drm/msm/dp: report IRQ_HPD as an IRQ-only notification
      drm/msm/dp: mark the SST connector disconnected when MST is enabled

 drivers/gpu/drm/bridge/lontium-lt9611uxc.c     |  3 +-
 drivers/gpu/drm/display/drm_bridge_connector.c | 31 ++++++++++++++++-----
 drivers/gpu/drm/meson/meson_encoder_hdmi.c     |  3 +-
 drivers/gpu/drm/msm/dp/dp_display.c            | 38 +++++++++++++++-----------
 drivers/gpu/drm/msm/dp/dp_drm.h                |  3 +-
 drivers/gpu/drm/omapdrm/dss/hdmi4.c            |  3 +-
 drivers/soc/qcom/pmic_glink_altmode.c          | 14 ++++++----
 include/drm/drm_bridge.h                       |  3 +-
 8 files changed, 65 insertions(+), 33 deletions(-)
---
base-commit: e7d700e14934e68f86338c5610cf2ae76798b663
change-id: 20260629-msm-dp-msttypec-b420df7da587
prerequisite-message-id: <20260608-hpd-irq-events-v4-0-30b62b335487@oss.qualcomm.com>
prerequisite-patch-id: adc6d802a2f71d23c077a5cdb9a257809e9db50e
prerequisite-patch-id: bbd956a3b65a90c1fe9e884bc32c49bd83fd3129
prerequisite-patch-id: 014460a25c380d089764ab4e1a58577ebc1b9e71
prerequisite-patch-id: fc03fb9435b8c60321f9ae28e396a6bff2f347ae
prerequisite-patch-id: cd4cd57a72c798fc95afdfdeb9b81cc7a2dbd25d
prerequisite-patch-id: fe431fb614383eb6444f6bfb928e7e40c2de951e
prerequisite-patch-id: 2a058aa8309016f424b1d4ca19a9b20e92f4d8b6
prerequisite-patch-id: 64c3616bb979b663a01342d1f217588b347ae8bb
prerequisite-change-id: 20260410-msm-dp-mst-35130b6e8b84:v5
prerequisite-patch-id: 1d440cb9fed2bdd66d8de0e1e20475f0fe166973
prerequisite-patch-id: be0f4b80697df7224c80362b161b8a9f0a542184
prerequisite-patch-id: eefa6e6353df301420feae1da704a9db2c2155f2
prerequisite-patch-id: 9e9095f82dd6c131c9f3c1de4fdb8a62bd65ca24
prerequisite-patch-id: 3e635f008f9b56823101abd9253905f078fcb3b5
prerequisite-patch-id: e39e0dc124ed043c7a419610ebe03ad105da27db
prerequisite-patch-id: 945af39213cd4241e1a5929fada04a9286aeb5db
prerequisite-patch-id: 898ae7e4582a6b31492c223e7dd167fb9ce78096
prerequisite-patch-id: 3887553893357c1ffbda99eb010801bc2166cbad
prerequisite-patch-id: 7ccd961fa3c6f925659dee7d7a5bd167c8e7331b
prerequisite-patch-id: be2bf918e0e87ec2ea999927f36bd172c498748e
prerequisite-patch-id: 6aacdabb2dd0536dc04da04f8419ae39e35f8b19
prerequisite-patch-id: a9f27eff8f643ff445810b17d670891928f5b416
prerequisite-patch-id: efd300a2b52715153b8c1c7407db696eb331594b
prerequisite-patch-id: 950abefc4862050ef606404977fd27c5dd2cbb2b
prerequisite-patch-id: c6a9aaba753b5538864f7f6e065d910833baec21
prerequisite-patch-id: c73c1f6eb16b2a6ff11b20495fa0981683bdaaee
prerequisite-patch-id: 94957394b3870ec63ab766d682df592da978dd19
prerequisite-patch-id: f27cba0cf5f08d21f59f29a0c9ed7f197ddfa2c7
prerequisite-patch-id: 683855949a9ed37bc0cc4d1899373e55eac4ddc3
prerequisite-patch-id: 9b3a2b526476c32c8a859824e551e23412674766
prerequisite-patch-id: be866cf2acd4960f31f0dbd05e21f0722dcb70ab
prerequisite-patch-id: 58bd115be590c0d892a72e06794f5b244dbdb7f8
prerequisite-patch-id: 87435a0f6827516f4e2b5d8471a2b289bb73a88c
prerequisite-patch-id: 1064db7111fc77377dbf246eb0fdef90c18c46ee
prerequisite-patch-id: e112aaf6088f2bfa90bc67feaac86a4fc1ad23ca
prerequisite-patch-id: fcc0f2ee6dc0358d62593c1295d26a013fa11223
prerequisite-patch-id: 66364b8806fc6abeabe1a0b871e4e8c841ce2aa7
prerequisite-patch-id: 243046f52a14b416caead3469d580ea5b029f9bb
prerequisite-patch-id: efd8014f647a6aa5fadc9d62a6e1920d76a6c80f
prerequisite-patch-id: f4dbd5ae84a01ea89c7d00ca39fd76cd247bc353
prerequisite-patch-id: 30a16a45edefc8769b10d90a7807b6522cd31f15
prerequisite-patch-id: e12fd2908ca33de1f1265fd40190eaad8637e569
prerequisite-patch-id: 3baac076fdda664d00aa9a83481f76ec38c07e8a
prerequisite-patch-id: ee6a93ffa2d5461ee7b07929ff21626a14773b7a
prerequisite-patch-id: c8d444e2a6512f106da2675d4a42a92208d5c6f1
prerequisite-patch-id: 0491a69feb036cfa2e75401e093ebad387cf2846
prerequisite-patch-id: 707e7a3e5114c86f5bcc0b36e7cc8beb0c957780
prerequisite-patch-id: b1ae90d73bd7c3d19cfe4371b5dc9a816f1316a6
prerequisite-patch-id: 4c183b8ffd599169c8d3c5f3aad5ecc467b150f2
prerequisite-message-id: <20260609-dp_mstclean-v7-0-ea04113e8233@oss.qualcomm.com>
prerequisite-patch-id: 1d440cb9fed2bdd66d8de0e1e20475f0fe166973
prerequisite-patch-id: be0f4b80697df7224c80362b161b8a9f0a542184
prerequisite-patch-id: eefa6e6353df301420feae1da704a9db2c2155f2
prerequisite-patch-id: 9e9095f82dd6c131c9f3c1de4fdb8a62bd65ca24
prerequisite-patch-id: 3e635f008f9b56823101abd9253905f078fcb3b5
prerequisite-patch-id: e39e0dc124ed043c7a419610ebe03ad105da27db
prerequisite-patch-id: 945af39213cd4241e1a5929fada04a9286aeb5db
prerequisite-patch-id: 898ae7e4582a6b31492c223e7dd167fb9ce78096
prerequisite-patch-id: 3887553893357c1ffbda99eb010801bc2166cbad
prerequisite-patch-id: 7ccd961fa3c6f925659dee7d7a5bd167c8e7331b
prerequisite-patch-id: be2bf918e0e87ec2ea999927f36bd172c498748e
prerequisite-patch-id: 6aacdabb2dd0536dc04da04f8419ae39e35f8b19
prerequisite-patch-id: a9f27eff8f643ff445810b17d670891928f5b416
prerequisite-patch-id: efd300a2b52715153b8c1c7407db696eb331594b
prerequisite-patch-id: 950abefc4862050ef606404977fd27c5dd2cbb2b

Best regards,
-- 
Yongxing Mou <yongxing.mou@oss.qualcomm.com>


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

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

* [PATCH 1/5] drm/bridge: allow hpd_notify() to suppress connector hotplug events
  2026-06-29 14:48 [PATCH 0/5] drm/msm/dp: Add MSM Type-C MST support Yongxing Mou
@ 2026-06-29 14:48 ` Yongxing Mou
  2026-07-12 10:21   ` Dmitry Baryshkov
  2026-06-29 14:48 ` [PATCH 2/5] drm/bridge_connector: preserve connector status for IRQ-only HPD events Yongxing Mou
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Yongxing Mou @ 2026-06-29 14:48 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Rob Clark,
	Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
	Marijn Suijten, Tomi Valkeinen, Bjorn Andersson, Konrad Dybcio
  Cc: dri-devel, linux-kernel, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, freedreno, Yongxing Mou

The bridge connector framework currently invokes all bridge
hpd_notify() callbacks and unconditionally emits a connector hotplug
event afterwards.

However, not every HPD notification requires a userspace hotplug event.

In particular, DP MST bridges may use hpd_notify() to propagate HPD and
IRQ notifications through the bridge chain while the actual hotplug
handling is performed by the DRM DP MST core. Connector creation,
removal and userspace hotplug events are already managed by the MST
topology framework.

Allow hpd_notify() implementations to suppress the bridge connector
hotplug event by introducing a bool *send_hotplug parameter. Drivers
can clear this flag when HPD processing should not result in a
connector hotplug notification.

A NULL pointer indicates that hotplug suppression is not supported by
the caller, such as the connector detect polling path.

Signed-off-by: Yongxing Mou <yongxing.mou@oss.qualcomm.com>
---
 drivers/gpu/drm/bridge/lontium-lt9611uxc.c     |  3 ++-
 drivers/gpu/drm/display/drm_bridge_connector.c | 15 +++++++++------
 drivers/gpu/drm/meson/meson_encoder_hdmi.c     |  3 ++-
 drivers/gpu/drm/msm/dp/dp_display.c            |  3 ++-
 drivers/gpu/drm/msm/dp/dp_drm.h                |  3 ++-
 drivers/gpu/drm/omapdrm/dss/hdmi4.c            |  3 ++-
 include/drm/drm_bridge.h                       |  3 ++-
 7 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
index 8cb17bd0e238..42e1cadcd3fb 100644
--- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
+++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
@@ -430,7 +430,8 @@ static const struct drm_edid *lt9611uxc_bridge_edid_read(struct drm_bridge *brid
 static void lt9611uxc_bridge_hpd_notify(struct drm_bridge *bridge,
 					struct drm_connector *connector,
 					enum drm_connector_status status,
-					enum drm_connector_status_extra extra_status)
+					enum drm_connector_status_extra extra_status,
+					bool *send_hotplug)
 {
 	const struct drm_edid *drm_edid;
 
diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
index 8f7075fd2aa5..5edca47a025f 100644
--- a/drivers/gpu/drm/display/drm_bridge_connector.c
+++ b/drivers/gpu/drm/display/drm_bridge_connector.c
@@ -142,7 +142,8 @@ struct drm_bridge_connector {
 
 static void drm_bridge_connector_hpd_notify(struct drm_connector *connector,
 					    enum drm_connector_status status,
-					    enum drm_connector_status_extra extra_status)
+					    enum drm_connector_status_extra extra_status,
+					    bool *send_hotplug)
 {
 	struct drm_bridge_connector *bridge_connector =
 		to_drm_bridge_connector(connector);
@@ -150,13 +151,14 @@ static void drm_bridge_connector_hpd_notify(struct drm_connector *connector,
 	/* Notify all bridges in the pipeline of hotplug events. */
 	drm_for_each_bridge_in_chain_scoped(bridge_connector->encoder, bridge) {
 		if (bridge->funcs->hpd_notify)
-			bridge->funcs->hpd_notify(bridge, connector, status, extra_status);
+			bridge->funcs->hpd_notify(bridge, connector, status,
+						  extra_status, send_hotplug);
 	}
 }
 
 static void drm_bridge_connector_handle_hpd(struct drm_bridge_connector *drm_bridge_connector,
-					    enum drm_connector_status status,
-					    enum drm_connector_status_extra extra_status)
+	enum drm_connector_status status,
+	enum drm_connector_status_extra extra_status)
 {
 	struct drm_connector *connector = &drm_bridge_connector->base;
 	struct drm_device *dev = connector->dev;
@@ -165,7 +167,7 @@ static void drm_bridge_connector_handle_hpd(struct drm_bridge_connector *drm_bri
 	connector->status = status;
 	mutex_unlock(&dev->mode_config.mutex);
 
-	drm_bridge_connector_hpd_notify(connector, status, extra_status);
+	drm_bridge_connector_hpd_notify(connector, status, extra_status, NULL);
 
 	drm_kms_helper_connector_hotplug_event(connector);
 }
@@ -227,7 +229,8 @@ drm_bridge_connector_detect(struct drm_connector *connector, bool force)
 		if (hdmi)
 			drm_atomic_helper_connector_hdmi_hotplug(connector, status);
 
-		drm_bridge_connector_hpd_notify(connector, status, DRM_CONNECTOR_NO_EXTRA_STATUS);
+		drm_bridge_connector_hpd_notify(connector, status,
+						DRM_CONNECTOR_NO_EXTRA_STATUS, NULL);
 	} else {
 		switch (connector->connector_type) {
 		case DRM_MODE_CONNECTOR_DPI:
diff --git a/drivers/gpu/drm/meson/meson_encoder_hdmi.c b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
index 4aecf0ffcf75..a67e7b365c5b 100644
--- a/drivers/gpu/drm/meson/meson_encoder_hdmi.c
+++ b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
@@ -324,7 +324,8 @@ static int meson_encoder_hdmi_atomic_check(struct drm_bridge *bridge,
 static void meson_encoder_hdmi_hpd_notify(struct drm_bridge *bridge,
 					  struct drm_connector *connector,
 					  enum drm_connector_status status,
-					  enum drm_connector_status_extra extra_status)
+					  enum drm_connector_status_extra extra_status,
+					  bool *send_hotplug)
 {
 	struct meson_encoder_hdmi *encoder_hdmi = bridge_to_meson_encoder_hdmi(bridge);
 
diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index fcfee26f0078..6835c68fe510 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -1763,7 +1763,8 @@ void msm_dp_bridge_hpd_disable(struct drm_bridge *bridge)
 void msm_dp_bridge_hpd_notify(struct drm_bridge *bridge,
 			      struct drm_connector *connector,
 			      enum drm_connector_status status,
-			      enum drm_connector_status_extra extra_status)
+			      enum drm_connector_status_extra extra_status,
+			      bool *send_hotplug)
 {
 	struct msm_dp_bridge *msm_dp_bridge = to_dp_bridge(bridge);
 	struct msm_dp *msm_dp_display = msm_dp_bridge->msm_dp_display;
diff --git a/drivers/gpu/drm/msm/dp/dp_drm.h b/drivers/gpu/drm/msm/dp/dp_drm.h
index f6b96c27408a..07ddcd055962 100644
--- a/drivers/gpu/drm/msm/dp/dp_drm.h
+++ b/drivers/gpu/drm/msm/dp/dp_drm.h
@@ -32,6 +32,7 @@ void msm_dp_bridge_hpd_disable(struct drm_bridge *bridge);
 void msm_dp_bridge_hpd_notify(struct drm_bridge *bridge,
 			      struct drm_connector *connector,
 			      enum drm_connector_status status,
-			      enum drm_connector_status_extra extra_status);
+			      enum drm_connector_status_extra extra_status,
+			      bool *send_hotplug);
 
 #endif /* _DP_DRM_H_ */
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index d02d432abde4..ad659cef16f5 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -430,7 +430,8 @@ static void hdmi4_bridge_disable(struct drm_bridge *bridge,
 static void hdmi4_bridge_hpd_notify(struct drm_bridge *bridge,
 				    struct drm_connector *connector,
 				    enum drm_connector_status status,
-				    enum drm_connector_status_extra extra_status)
+				    enum drm_connector_status_extra extra_status,
+				    bool *send_hotplug)
 {
 	struct omap_hdmi *hdmi = drm_bridge_to_hdmi(bridge);
 
diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
index 9c4c88024cc5..e6de665ce8f6 100644
--- a/include/drm/drm_bridge.h
+++ b/include/drm/drm_bridge.h
@@ -616,7 +616,8 @@ struct drm_bridge_funcs {
 	void (*hpd_notify)(struct drm_bridge *bridge,
 			   struct drm_connector *connector,
 			   enum drm_connector_status status,
-			   enum drm_connector_status_extra extra_status);
+			   enum drm_connector_status_extra extra_status,
+			   bool *send_hotplug);
 
 	/**
 	 * @hpd_enable:

-- 
2.43.0


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

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

* [PATCH 2/5] drm/bridge_connector: preserve connector status for IRQ-only HPD events
  2026-06-29 14:48 [PATCH 0/5] drm/msm/dp: Add MSM Type-C MST support Yongxing Mou
  2026-06-29 14:48 ` [PATCH 1/5] drm/bridge: allow hpd_notify() to suppress connector hotplug events Yongxing Mou
@ 2026-06-29 14:48 ` Yongxing Mou
  2026-07-12 10:33   ` Dmitry Baryshkov
  2026-06-29 14:48 ` [PATCH 3/5] drm/msm/dp: suppress bridge hotplug events during MST operation Yongxing Mou
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Yongxing Mou @ 2026-06-29 14:48 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Rob Clark,
	Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
	Marijn Suijten, Tomi Valkeinen, Bjorn Andersson, Konrad Dybcio
  Cc: dri-devel, linux-kernel, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, freedreno, Yongxing Mou

The bridge connector HPD handling path currently updates
connector->status for every hpd_notify() invocation.

This does not work well for IRQ-only notifications where the event being
reported is carried by extra_status and no connector status transition is
associated with it.

One example is DP MST. HPD IRQs are propagated through
drm_bridge_hpd_notify_*() so that bridge drivers can process the
notification. During MST operation, however, the SST connector attached
to the bridge connector is intentionally kept disconnected while the MST
topology manager handles all connector creation, removal and hotplug
processing.

Updating connector->status for an IRQ-only MST notification may cause
the SST connector state to oscillate between connected and disconnected
depending on the notification path. These artificial state transitions
can later be detected by the polling logic and result in unnecessary
hotplug events being generated. Userspace then re-probes connector
status, potentially triggering the same sequence again.

Treat notifications with status == connector_status_unknown and a valid
extra_status as IRQ-only events. Forward the notification to bridge
drivers without modifying connector->status.

This keeps IRQ delivery working while leaving connector state management
to the component that actually owns it, such as the DP MST topology
framework.

Signed-off-by: Yongxing Mou <yongxing.mou@oss.qualcomm.com>
---
 drivers/gpu/drm/display/drm_bridge_connector.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
index 5edca47a025f..7334d6677604 100644
--- a/drivers/gpu/drm/display/drm_bridge_connector.c
+++ b/drivers/gpu/drm/display/drm_bridge_connector.c
@@ -163,6 +163,18 @@ static void drm_bridge_connector_handle_hpd(struct drm_bridge_connector *drm_bri
 	struct drm_connector *connector = &drm_bridge_connector->base;
 	struct drm_device *dev = connector->dev;
 
+	/*
+	 * IRQ-only notification: extra_status carries the event but
+	 * status is unknown — do not overwrite connector->status.
+	 */
+	if (status == connector_status_unknown &&
+	    extra_status != DRM_CONNECTOR_NO_EXTRA_STATUS) {
+		drm_bridge_connector_hpd_notify(connector,
+						connector->status,
+						extra_status, NULL);
+		return;
+	}
+
 	mutex_lock(&dev->mode_config.mutex);
 	connector->status = status;
 	mutex_unlock(&dev->mode_config.mutex);

-- 
2.43.0


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

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

* [PATCH 3/5] drm/msm/dp: suppress bridge hotplug events during MST operation
  2026-06-29 14:48 [PATCH 0/5] drm/msm/dp: Add MSM Type-C MST support Yongxing Mou
  2026-06-29 14:48 ` [PATCH 1/5] drm/bridge: allow hpd_notify() to suppress connector hotplug events Yongxing Mou
  2026-06-29 14:48 ` [PATCH 2/5] drm/bridge_connector: preserve connector status for IRQ-only HPD events Yongxing Mou
@ 2026-06-29 14:48 ` Yongxing Mou
  2026-07-12 10:44   ` Dmitry Baryshkov
  2026-06-29 14:48 ` [PATCH 4/5] drm/msm/dp: report IRQ_HPD as an IRQ-only notification Yongxing Mou
  2026-06-29 14:48 ` [PATCH 5/5] drm/msm/dp: mark the SST connector disconnected when MST is enabled Yongxing Mou
  4 siblings, 1 reply; 11+ messages in thread
From: Yongxing Mou @ 2026-06-29 14:48 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Rob Clark,
	Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
	Marijn Suijten, Tomi Valkeinen, Bjorn Andersson, Konrad Dybcio
  Cc: dri-devel, linux-kernel, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, freedreno, Yongxing Mou

The DP MST framework already generates the required hotplug events for
MST topology changes.

Suppress connector hotplug event generation from the bridge connector
path while MST is active, and continue propagating HPD notifications to
the DP driver.

Signed-off-by: Yongxing Mou <yongxing.mou@oss.qualcomm.com>
---
 drivers/gpu/drm/display/drm_bridge_connector.c | 6 ++++--
 drivers/gpu/drm/msm/dp/dp_display.c            | 9 ++++++++-
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
index 7334d6677604..82ed0dc450ab 100644
--- a/drivers/gpu/drm/display/drm_bridge_connector.c
+++ b/drivers/gpu/drm/display/drm_bridge_connector.c
@@ -162,6 +162,7 @@ static void drm_bridge_connector_handle_hpd(struct drm_bridge_connector *drm_bri
 {
 	struct drm_connector *connector = &drm_bridge_connector->base;
 	struct drm_device *dev = connector->dev;
+	bool send_hotplug = true;
 
 	/*
 	 * IRQ-only notification: extra_status carries the event but
@@ -179,9 +180,10 @@ static void drm_bridge_connector_handle_hpd(struct drm_bridge_connector *drm_bri
 	connector->status = status;
 	mutex_unlock(&dev->mode_config.mutex);
 
-	drm_bridge_connector_hpd_notify(connector, status, extra_status, NULL);
+	drm_bridge_connector_hpd_notify(connector, status, extra_status, &send_hotplug);
 
-	drm_kms_helper_connector_hotplug_event(connector);
+	if (send_hotplug)
+		drm_kms_helper_connector_hotplug_event(connector);
 }
 
 static void drm_bridge_connector_hpd_cb(void *cb_data,
diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index 6835c68fe510..bc93b566fbca 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -1790,10 +1790,17 @@ void msm_dp_bridge_hpd_notify(struct drm_bridge *bridge,
 			msm_dp_hpd_plug_handle(dp);
 		} else {
 			msm_dp_hpd_plug_handle(dp);
+			/* mst_active is set in plug_handle; suppress SST hotplug */
+			if (send_hotplug && msm_dp_display->mst_active)
+				*send_hotplug = false;
 		}
 	} else {
-		if (hpd_link_status == ISR_DISCONNECTED)
+		if (!msm_dp_display->mst_active) {
 			msm_dp_hpd_unplug_handle(dp);
+		} else if (send_hotplug) {
+			msm_dp_hpd_unplug_handle(dp);
+			*send_hotplug = false;
+		}
 	}
 
 	pm_runtime_put_sync(&msm_dp_display->pdev->dev);

-- 
2.43.0


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

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

* [PATCH 4/5] drm/msm/dp: report IRQ_HPD as an IRQ-only notification
  2026-06-29 14:48 [PATCH 0/5] drm/msm/dp: Add MSM Type-C MST support Yongxing Mou
                   ` (2 preceding siblings ...)
  2026-06-29 14:48 ` [PATCH 3/5] drm/msm/dp: suppress bridge hotplug events during MST operation Yongxing Mou
@ 2026-06-29 14:48 ` Yongxing Mou
  2026-07-12 10:55   ` Dmitry Baryshkov
  2026-06-29 14:48 ` [PATCH 5/5] drm/msm/dp: mark the SST connector disconnected when MST is enabled Yongxing Mou
  4 siblings, 1 reply; 11+ messages in thread
From: Yongxing Mou @ 2026-06-29 14:48 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Rob Clark,
	Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
	Marijn Suijten, Tomi Valkeinen, Bjorn Andersson, Konrad Dybcio
  Cc: dri-devel, linux-kernel, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, freedreno, Yongxing Mou

MST reuses the SST connector bridge to propagate HPD IRQ events through
the bridge chain.

For IRQ_HPD notifications there is no connector state transition to
report. Use connector_status_unknown together with
DRM_CONNECTOR_DP_IRQ_HPD so that the bridge connector framework treats
them as IRQ-only notifications and forwards them without modifying
connector state.

The DP driver handles IRQ_HPD events based on
DRM_CONNECTOR_DP_IRQ_HPD rather than connector status transitions.

Signed-off-by: Yongxing Mou <yongxing.mou@oss.qualcomm.com>
---
 drivers/gpu/drm/msm/dp/dp_display.c   | 22 +++++++++-------------
 drivers/soc/qcom/pmic_glink_altmode.c | 14 +++++++++-----
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index bc93b566fbca..4ee391cc7165 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -1119,14 +1119,10 @@ static irqreturn_t msm_dp_display_irq_thread(int irq, void *dev_id)
 		drm_bridge_hpd_notify(dp->msm_dp_display.bridge,
 				      connector_status_connected);
 
-	/* Send HPD as connected and distinguish it in the notifier */
-	if (hpd_isr_status & DP_DP_IRQ_HPD_INT_MASK) {
-		if (dp->msm_dp_display.mst_active)
-			msm_dp_irq_hpd_handle(dp);
-		else
-			drm_bridge_hpd_notify(dp->msm_dp_display.bridge,
-					      connector_status_connected);
-	}
+	if (hpd_isr_status & DP_DP_IRQ_HPD_INT_MASK)
+		drm_bridge_hpd_notify_extra(dp->msm_dp_display.bridge,
+					    connector_status_unknown,
+					    DRM_CONNECTOR_DP_IRQ_HPD);
 
 	ret = IRQ_HANDLED;
 
@@ -1781,11 +1777,11 @@ void msm_dp_bridge_hpd_notify(struct drm_bridge *bridge,
 	drm_dbg_dp(dp->drm_dev, "type=%d link hpd_link_status=0x%x, status=%d\n",
 		   msm_dp_display->connector_type, hpd_link_status, status);
 
-	if (status == connector_status_connected) {
-		if (hpd_link_status == ISR_IRQ_HPD_PULSE_COUNT ||
-		    extra_status == DRM_CONNECTOR_DP_IRQ_HPD) {
-			msm_dp_irq_hpd_handle(dp);
-		} else if (hpd_link_status == ISR_HPD_REPLUG_COUNT) {
+	if (extra_status == DRM_CONNECTOR_DP_IRQ_HPD ||
+	    hpd_link_status == ISR_IRQ_HPD_PULSE_COUNT) {
+		msm_dp_irq_hpd_handle(dp);
+	} else if (status == connector_status_connected) {
+		if (hpd_link_status == ISR_HPD_REPLUG_COUNT) {
 			msm_dp_hpd_unplug_handle(dp);
 			msm_dp_hpd_plug_handle(dp);
 		} else {
diff --git a/drivers/soc/qcom/pmic_glink_altmode.c b/drivers/soc/qcom/pmic_glink_altmode.c
index 946eb20b8f83..28ab8cbb5ef9 100644
--- a/drivers/soc/qcom/pmic_glink_altmode.c
+++ b/drivers/soc/qcom/pmic_glink_altmode.c
@@ -373,11 +373,15 @@ static void pmic_glink_altmode_worker(struct work_struct *work)
 		else
 			conn_status = connector_status_disconnected;
 
-		drm_aux_hpd_bridge_notify_extra(&alt_port->bridge->dev,
-						conn_status,
-						alt_port->hpd_irq ?
-						DRM_CONNECTOR_DP_IRQ_HPD :
-						DRM_CONNECTOR_NO_EXTRA_STATUS);
+		if (alt_port->hpd_irq) {
+			drm_aux_hpd_bridge_notify_extra(&alt_port->bridge->dev,
+							connector_status_unknown,
+							DRM_CONNECTOR_DP_IRQ_HPD);
+		} else {
+			drm_aux_hpd_bridge_notify_extra(&alt_port->bridge->dev,
+							conn_status,
+							DRM_CONNECTOR_NO_EXTRA_STATUS);
+		}
 	} else if (alt_port->mux_ctrl == MUX_CTRL_STATE_TUNNELING) {
 		if (alt_port->svid == USB_TYPEC_TBT_SID)
 			pmic_glink_altmode_enable_tbt(altmode, alt_port);

-- 
2.43.0


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

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

* [PATCH 5/5] drm/msm/dp: mark the SST connector disconnected when MST is enabled
  2026-06-29 14:48 [PATCH 0/5] drm/msm/dp: Add MSM Type-C MST support Yongxing Mou
                   ` (3 preceding siblings ...)
  2026-06-29 14:48 ` [PATCH 4/5] drm/msm/dp: report IRQ_HPD as an IRQ-only notification Yongxing Mou
@ 2026-06-29 14:48 ` Yongxing Mou
  2026-07-12 10:56   ` Dmitry Baryshkov
  4 siblings, 1 reply; 11+ messages in thread
From: Yongxing Mou @ 2026-06-29 14:48 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Rob Clark,
	Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
	Marijn Suijten, Tomi Valkeinen, Bjorn Andersson, Konrad Dybcio
  Cc: dri-devel, linux-kernel, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, freedreno, Yongxing Mou

When MST becomes active, the initial HPD plug notification updates the
SST connector state to connected.

However, the subsequent SST connector detect path reports disconnected
while MST is enabled. This connected -> disconnected transition is then
observed by the polling logic and may result in an unnecessary hotplug
event.

Set the SST connector state to disconnected immediately after MST is
initialized so that the detect path does not introduce a transient
state change.

Signed-off-by: Yongxing Mou <yongxing.mou@oss.qualcomm.com>
---
 drivers/gpu/drm/msm/dp/dp_display.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index 4ee391cc7165..f8ca60d6d714 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -352,8 +352,10 @@ static int msm_dp_display_process_hpd_high(struct msm_dp_display_private *dp)
 	if (dp->max_stream > 1 && drm_dp_read_mst_cap(dp->aux, dp->panel->dpcd))
 		msm_dp_display_mst_init(dp);
 
-	if (dp->msm_dp_display.mst_active)
+	if (dp->msm_dp_display.mst_active) {
+		connector->status = connector_status_disconnected;
 		msm_dp_mst_display_set_mgr_state(&dp->msm_dp_display, true);
+	}
 
 	msm_dp_link_reset_phy_params_vx_px(dp->link);
 

-- 
2.43.0


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

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

* Re: [PATCH 1/5] drm/bridge: allow hpd_notify() to suppress connector hotplug events
  2026-06-29 14:48 ` [PATCH 1/5] drm/bridge: allow hpd_notify() to suppress connector hotplug events Yongxing Mou
@ 2026-07-12 10:21   ` Dmitry Baryshkov
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Baryshkov @ 2026-07-12 10:21 UTC (permalink / raw)
  To: Yongxing Mou
  Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Rob Clark,
	Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
	Marijn Suijten, Tomi Valkeinen, Bjorn Andersson, Konrad Dybcio,
	dri-devel, linux-kernel, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, freedreno

On Mon, Jun 29, 2026 at 10:48:03PM +0800, Yongxing Mou wrote:
> The bridge connector framework currently invokes all bridge
> hpd_notify() callbacks and unconditionally emits a connector hotplug
> event afterwards.
> 
> However, not every HPD notification requires a userspace hotplug event.
> 
> In particular, DP MST bridges may use hpd_notify() to propagate HPD and
> IRQ notifications through the bridge chain while the actual hotplug
> handling is performed by the DRM DP MST core. Connector creation,
> removal and userspace hotplug events are already managed by the MST
> topology framework.
> 
> Allow hpd_notify() implementations to suppress the bridge connector
> hotplug event by introducing a bool *send_hotplug parameter. Drivers
> can clear this flag when HPD processing should not result in a
> connector hotplug notification.

Why? Worst case the kernel receives another hotplug notification which
gets ignored by the driver.

> 
> A NULL pointer indicates that hotplug suppression is not supported by
> the caller, such as the connector detect polling path.

And nothing in this patch makes any use of it. I'd say, it's
questionable addition. Let me check other patches...

> 
> Signed-off-by: Yongxing Mou <yongxing.mou@oss.qualcomm.com>
> ---
>  drivers/gpu/drm/bridge/lontium-lt9611uxc.c     |  3 ++-
>  drivers/gpu/drm/display/drm_bridge_connector.c | 15 +++++++++------
>  drivers/gpu/drm/meson/meson_encoder_hdmi.c     |  3 ++-
>  drivers/gpu/drm/msm/dp/dp_display.c            |  3 ++-
>  drivers/gpu/drm/msm/dp/dp_drm.h                |  3 ++-
>  drivers/gpu/drm/omapdrm/dss/hdmi4.c            |  3 ++-
>  include/drm/drm_bridge.h                       |  3 ++-
>  7 files changed, 21 insertions(+), 12 deletions(-)

-- 
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] 11+ messages in thread

* Re: [PATCH 2/5] drm/bridge_connector: preserve connector status for IRQ-only HPD events
  2026-06-29 14:48 ` [PATCH 2/5] drm/bridge_connector: preserve connector status for IRQ-only HPD events Yongxing Mou
@ 2026-07-12 10:33   ` Dmitry Baryshkov
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Baryshkov @ 2026-07-12 10:33 UTC (permalink / raw)
  To: Yongxing Mou
  Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Rob Clark,
	Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
	Marijn Suijten, Tomi Valkeinen, Bjorn Andersson, Konrad Dybcio,
	dri-devel, linux-kernel, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, freedreno

On Mon, Jun 29, 2026 at 10:48:04PM +0800, Yongxing Mou wrote:
> The bridge connector HPD handling path currently updates
> connector->status for every hpd_notify() invocation.
> 
> This does not work well for IRQ-only notifications where the event being
> reported is carried by extra_status and no connector status transition is
> associated with it.
> 
> One example is DP MST. HPD IRQs are propagated through
> drm_bridge_hpd_notify_*() so that bridge drivers can process the
> notification. During MST operation, however, the SST connector attached
> to the bridge connector is intentionally kept disconnected while the MST
> topology manager handles all connector creation, removal and hotplug
> processing.
> 
> Updating connector->status for an IRQ-only MST notification may cause
> the SST connector state to oscillate between connected and disconnected
> depending on the notification path. These artificial state transitions
> can later be detected by the polling logic and result in unnecessary
> hotplug events being generated. Userspace then re-probes connector
> status, potentially triggering the same sequence again.

Then the API might need to be adjusted.

Remember, we have two usecases, which we must be able to interpret
correctly:
- The driver gets separate HPD and IRQ_HPD events.
- The driver gets HPD and IRQ_HPD at the same time.

> 
> Treat notifications with status == connector_status_unknown and a valid
> extra_status as IRQ-only events. Forward the notification to bridge
> drivers without modifying connector->status.
> 
> This keeps IRQ delivery working while leaving connector state management
> to the component that actually owns it, such as the DP MST topology
> framework.

How is it handled by other drivers (i915, amd, nouveau)?

> 
> Signed-off-by: Yongxing Mou <yongxing.mou@oss.qualcomm.com>
> ---
>  drivers/gpu/drm/display/drm_bridge_connector.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
> index 5edca47a025f..7334d6677604 100644
> --- a/drivers/gpu/drm/display/drm_bridge_connector.c
> +++ b/drivers/gpu/drm/display/drm_bridge_connector.c
> @@ -163,6 +163,18 @@ static void drm_bridge_connector_handle_hpd(struct drm_bridge_connector *drm_bri
>  	struct drm_connector *connector = &drm_bridge_connector->base;
>  	struct drm_device *dev = connector->dev;
>  
> +	/*
> +	 * IRQ-only notification: extra_status carries the event but
> +	 * status is unknown — do not overwrite connector->status.

But it's not unknown at this point. The connector status is reported
following the HPD status.

> +	 */
> +	if (status == connector_status_unknown &&
> +	    extra_status != DRM_CONNECTOR_NO_EXTRA_STATUS) {
> +		drm_bridge_connector_hpd_notify(connector,
> +						connector->status,
> +						extra_status, NULL);
> +		return;
> +	}
> +
>  	mutex_lock(&dev->mode_config.mutex);
>  	connector->status = status;
>  	mutex_unlock(&dev->mode_config.mutex);
> 
> -- 
> 2.43.0
> 

-- 
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] 11+ messages in thread

* Re: [PATCH 3/5] drm/msm/dp: suppress bridge hotplug events during MST operation
  2026-06-29 14:48 ` [PATCH 3/5] drm/msm/dp: suppress bridge hotplug events during MST operation Yongxing Mou
@ 2026-07-12 10:44   ` Dmitry Baryshkov
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Baryshkov @ 2026-07-12 10:44 UTC (permalink / raw)
  To: Yongxing Mou
  Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Rob Clark,
	Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
	Marijn Suijten, Tomi Valkeinen, Bjorn Andersson, Konrad Dybcio,
	dri-devel, linux-kernel, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, freedreno

On Mon, Jun 29, 2026 at 10:48:05PM +0800, Yongxing Mou wrote:
> The DP MST framework already generates the required hotplug events for
> MST topology changes.
> 
> Suppress connector hotplug event generation from the bridge connector
> path while MST is active, and continue propagating HPD notifications to
> the DP driver.
> 
> Signed-off-by: Yongxing Mou <yongxing.mou@oss.qualcomm.com>
> ---
>  drivers/gpu/drm/display/drm_bridge_connector.c | 6 ++++--
>  drivers/gpu/drm/msm/dp/dp_display.c            | 9 ++++++++-

No, it can't go as this. The drm_bridge_connector part should have been
a part of the first patch.

>  2 files changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
> index 7334d6677604..82ed0dc450ab 100644
> --- a/drivers/gpu/drm/display/drm_bridge_connector.c
> +++ b/drivers/gpu/drm/display/drm_bridge_connector.c
> @@ -162,6 +162,7 @@ static void drm_bridge_connector_handle_hpd(struct drm_bridge_connector *drm_bri
>  {
>  	struct drm_connector *connector = &drm_bridge_connector->base;
>  	struct drm_device *dev = connector->dev;
> +	bool send_hotplug = true;
>  
>  	/*
>  	 * IRQ-only notification: extra_status carries the event but
> @@ -179,9 +180,10 @@ static void drm_bridge_connector_handle_hpd(struct drm_bridge_connector *drm_bri
>  	connector->status = status;
>  	mutex_unlock(&dev->mode_config.mutex);
>  
> -	drm_bridge_connector_hpd_notify(connector, status, extra_status, NULL);
> +	drm_bridge_connector_hpd_notify(connector, status, extra_status, &send_hotplug);
>  
> -	drm_kms_helper_connector_hotplug_event(connector);
> +	if (send_hotplug)
> +		drm_kms_helper_connector_hotplug_event(connector);

But now I can also see that the idea seems to be incorrect. You are
preventing the kernel from sending the events, but it doesn't really
matter. If connection status oscillates, then other components might
notice it even without the event being sent.


>  }
>  
>  static void drm_bridge_connector_hpd_cb(void *cb_data,
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index 6835c68fe510..bc93b566fbca 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -1790,10 +1790,17 @@ void msm_dp_bridge_hpd_notify(struct drm_bridge *bridge,
>  			msm_dp_hpd_plug_handle(dp);
>  		} else {
>  			msm_dp_hpd_plug_handle(dp);
> +			/* mst_active is set in plug_handle; suppress SST hotplug */
> +			if (send_hotplug && msm_dp_display->mst_active)
> +				*send_hotplug = false;
>  		}
>  	} else {
> -		if (hpd_link_status == ISR_DISCONNECTED)
> +		if (!msm_dp_display->mst_active) {
>  			msm_dp_hpd_unplug_handle(dp);
> +		} else if (send_hotplug) {
> +			msm_dp_hpd_unplug_handle(dp);
> +			*send_hotplug = false;

Why? Disconnected events definitely should be reported further.

> +		}
>  	}
>  
>  	pm_runtime_put_sync(&msm_dp_display->pdev->dev);
> 
> -- 
> 2.43.0
> 

-- 
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] 11+ messages in thread

* Re: [PATCH 4/5] drm/msm/dp: report IRQ_HPD as an IRQ-only notification
  2026-06-29 14:48 ` [PATCH 4/5] drm/msm/dp: report IRQ_HPD as an IRQ-only notification Yongxing Mou
@ 2026-07-12 10:55   ` Dmitry Baryshkov
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Baryshkov @ 2026-07-12 10:55 UTC (permalink / raw)
  To: Yongxing Mou
  Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Rob Clark,
	Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
	Marijn Suijten, Tomi Valkeinen, Bjorn Andersson, Konrad Dybcio,
	dri-devel, linux-kernel, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, freedreno

On Mon, Jun 29, 2026 at 10:48:06PM +0800, Yongxing Mou wrote:
> MST reuses the SST connector bridge to propagate HPD IRQ events through
> the bridge chain.
> 
> For IRQ_HPD notifications there is no connector state transition to
> report. Use connector_status_unknown together with
> DRM_CONNECTOR_DP_IRQ_HPD so that the bridge connector framework treats
> them as IRQ-only notifications and forwards them without modifying
> connector state.
> 
> The DP driver handles IRQ_HPD events based on
> DRM_CONNECTOR_DP_IRQ_HPD rather than connector status transitions.
> 
> Signed-off-by: Yongxing Mou <yongxing.mou@oss.qualcomm.com>
> ---
>  drivers/gpu/drm/msm/dp/dp_display.c   | 22 +++++++++-------------
>  drivers/soc/qcom/pmic_glink_altmode.c | 14 +++++++++-----

And which tree (and why) would be able to merge this patch?

>  2 files changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index bc93b566fbca..4ee391cc7165 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -1119,14 +1119,10 @@ static irqreturn_t msm_dp_display_irq_thread(int irq, void *dev_id)
>  		drm_bridge_hpd_notify(dp->msm_dp_display.bridge,
>  				      connector_status_connected);
>  
> -	/* Send HPD as connected and distinguish it in the notifier */
> -	if (hpd_isr_status & DP_DP_IRQ_HPD_INT_MASK) {
> -		if (dp->msm_dp_display.mst_active)
> -			msm_dp_irq_hpd_handle(dp);
> -		else
> -			drm_bridge_hpd_notify(dp->msm_dp_display.bridge,
> -					      connector_status_connected);
> -	}
> +	if (hpd_isr_status & DP_DP_IRQ_HPD_INT_MASK)
> +		drm_bridge_hpd_notify_extra(dp->msm_dp_display.bridge,
> +					    connector_status_unknown,

It's _not_ unknown.

> +					    DRM_CONNECTOR_DP_IRQ_HPD);

This should be fixed in the MST patchset. You should not be doing any
actual handling in the ISR routing.

>  
>  	ret = IRQ_HANDLED;
>  
> @@ -1781,11 +1777,11 @@ void msm_dp_bridge_hpd_notify(struct drm_bridge *bridge,
>  	drm_dbg_dp(dp->drm_dev, "type=%d link hpd_link_status=0x%x, status=%d\n",
>  		   msm_dp_display->connector_type, hpd_link_status, status);
>  
> -	if (status == connector_status_connected) {
> -		if (hpd_link_status == ISR_IRQ_HPD_PULSE_COUNT ||
> -		    extra_status == DRM_CONNECTOR_DP_IRQ_HPD) {
> -			msm_dp_irq_hpd_handle(dp);
> -		} else if (hpd_link_status == ISR_HPD_REPLUG_COUNT) {
> +	if (extra_status == DRM_CONNECTOR_DP_IRQ_HPD ||
> +	    hpd_link_status == ISR_IRQ_HPD_PULSE_COUNT) {
> +		msm_dp_irq_hpd_handle(dp);

ANd here you missed the case when IRQ_HPD is being reported together
with the first HPD event.

> +	} else if (status == connector_status_connected) {
> +		if (hpd_link_status == ISR_HPD_REPLUG_COUNT) {
>  			msm_dp_hpd_unplug_handle(dp);
>  			msm_dp_hpd_plug_handle(dp);
>  		} else {
> diff --git a/drivers/soc/qcom/pmic_glink_altmode.c b/drivers/soc/qcom/pmic_glink_altmode.c
> index 946eb20b8f83..28ab8cbb5ef9 100644
> --- a/drivers/soc/qcom/pmic_glink_altmode.c
> +++ b/drivers/soc/qcom/pmic_glink_altmode.c
> @@ -373,11 +373,15 @@ static void pmic_glink_altmode_worker(struct work_struct *work)
>  		else
>  			conn_status = connector_status_disconnected;
>  
> -		drm_aux_hpd_bridge_notify_extra(&alt_port->bridge->dev,
> -						conn_status,
> -						alt_port->hpd_irq ?
> -						DRM_CONNECTOR_DP_IRQ_HPD :
> -						DRM_CONNECTOR_NO_EXTRA_STATUS);
> +		if (alt_port->hpd_irq) {
> +			drm_aux_hpd_bridge_notify_extra(&alt_port->bridge->dev,
> +							connector_status_unknown,

And this is completely wrong. The AltMode driver (btw, you also missed
the normal altmode driver for DP) doesn't know if it should handle the
events in some way. It should report the HPD and IRQ_HPD as is.

> +							DRM_CONNECTOR_DP_IRQ_HPD);
> +		} else {
> +			drm_aux_hpd_bridge_notify_extra(&alt_port->bridge->dev,
> +							conn_status,
> +							DRM_CONNECTOR_NO_EXTRA_STATUS);
> +		}
>  	} else if (alt_port->mux_ctrl == MUX_CTRL_STATE_TUNNELING) {
>  		if (alt_port->svid == USB_TYPEC_TBT_SID)
>  			pmic_glink_altmode_enable_tbt(altmode, alt_port);
> 
> -- 
> 2.43.0
> 

-- 
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] 11+ messages in thread

* Re: [PATCH 5/5] drm/msm/dp: mark the SST connector disconnected when MST is enabled
  2026-06-29 14:48 ` [PATCH 5/5] drm/msm/dp: mark the SST connector disconnected when MST is enabled Yongxing Mou
@ 2026-07-12 10:56   ` Dmitry Baryshkov
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Baryshkov @ 2026-07-12 10:56 UTC (permalink / raw)
  To: Yongxing Mou
  Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Rob Clark,
	Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
	Marijn Suijten, Tomi Valkeinen, Bjorn Andersson, Konrad Dybcio,
	dri-devel, linux-kernel, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, freedreno

On Mon, Jun 29, 2026 at 10:48:07PM +0800, Yongxing Mou wrote:
> When MST becomes active, the initial HPD plug notification updates the
> SST connector state to connected.
> 
> However, the subsequent SST connector detect path reports disconnected
> while MST is enabled. This connected -> disconnected transition is then
> observed by the polling logic and may result in an unnecessary hotplug
> event.
> 
> Set the SST connector state to disconnected immediately after MST is
> initialized so that the detect path does not introduce a transient
> state change.
> 
> Signed-off-by: Yongxing Mou <yongxing.mou@oss.qualcomm.com>
> ---
>  drivers/gpu/drm/msm/dp/dp_display.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index 4ee391cc7165..f8ca60d6d714 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -352,8 +352,10 @@ static int msm_dp_display_process_hpd_high(struct msm_dp_display_private *dp)
>  	if (dp->max_stream > 1 && drm_dp_read_mst_cap(dp->aux, dp->panel->dpcd))
>  		msm_dp_display_mst_init(dp);
>  
> -	if (dp->msm_dp_display.mst_active)
> +	if (dp->msm_dp_display.mst_active) {
> +		connector->status = connector_status_disconnected;
>  		msm_dp_mst_display_set_mgr_state(&dp->msm_dp_display, true);

This should be a part of the MST series.

> +	}
>  
>  	msm_dp_link_reset_phy_params_vx_px(dp->link);
>  
> 
> -- 
> 2.43.0
> 

-- 
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] 11+ messages in thread

end of thread, other threads:[~2026-07-12 10:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-29 14:48 [PATCH 0/5] drm/msm/dp: Add MSM Type-C MST support Yongxing Mou
2026-06-29 14:48 ` [PATCH 1/5] drm/bridge: allow hpd_notify() to suppress connector hotplug events Yongxing Mou
2026-07-12 10:21   ` Dmitry Baryshkov
2026-06-29 14:48 ` [PATCH 2/5] drm/bridge_connector: preserve connector status for IRQ-only HPD events Yongxing Mou
2026-07-12 10:33   ` Dmitry Baryshkov
2026-06-29 14:48 ` [PATCH 3/5] drm/msm/dp: suppress bridge hotplug events during MST operation Yongxing Mou
2026-07-12 10:44   ` Dmitry Baryshkov
2026-06-29 14:48 ` [PATCH 4/5] drm/msm/dp: report IRQ_HPD as an IRQ-only notification Yongxing Mou
2026-07-12 10:55   ` Dmitry Baryshkov
2026-06-29 14:48 ` [PATCH 5/5] drm/msm/dp: mark the SST connector disconnected when MST is enabled Yongxing Mou
2026-07-12 10:56   ` Dmitry Baryshkov

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