public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH v3 0/6] drm: handle IRQ_HPD events correctly
@ 2026-04-20 23:33 Dmitry Baryshkov
  2026-04-20 23:33 ` [PATCH v3 1/6] drm/connector: report IRQ_HPD events to drm_connector_oob_hotplug_event() Dmitry Baryshkov
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Dmitry Baryshkov @ 2026-04-20 23:33 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Heikki Krogerus, Greg Kroah-Hartman, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Adrien Grassein, Jani Nikula, Rodrigo Vivi,
	Joonas Lahtinen, Tvrtko Ursulin, Kevin Hilman, Jerome Brunet,
	Martin Blumenstingl, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
	Jessica Zhang, Sean Paul, Marijn Suijten, Tomi Valkeinen,
	Bjorn Andersson, Konrad Dybcio, Pengyu Luo, Nikita Travkin,
	Yongxing Mou
  Cc: dri-devel, linux-kernel, linux-usb, intel-gfx, intel-xe,
	linux-amlogic, linux-arm-kernel, linux-arm-msm, freedreno

Both DisplayPort and HDMI standards define a way for the Sink / display
to notify the Source / host about some kinds of events. In case of HDMI
it's as simple as singnalling changes to the EDID. In case of
DisplayPort it's more complicated and requires actual checking of the
DPCD registers.

Currently USB-C drivers don't have a way to deliver the IRQ_HPD
notifications, leading to missing MST notifications. Provide necessary
plumbing to let IRQ_HPD events be passed to the DisplayPort drivers.

Note: the Yoga C630 UCSI driver and Acer Aspire1 EC driver are not yet
enabled to send the IRQ_HPD events. Both of them would need some more
reverse engineering to find out how the event is being reported by the
EC.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
Changes in v3:
- Fixed build error if aux bridges are disabled (Intel GFX CI)
- Link to v2: https://patch.msgid.link/20260420-hpd-irq-events-v2-0-402ffe27e9e9@oss.qualcomm.com

Changes in v2:
- Change irq_hpd arg to be an enum, possibly desribing other uses (Toni)
- Account for that, chaning the API accordingly (with_irq -> extra,
  etc.)
- Wire up AUX bridge notifications
- Link to v1: https://patch.msgid.link/20260416-hpd-irq-events-v1-0-1ab1f1cfb2b2@oss.qualcomm.com

---
Dmitry Baryshkov (6):
      drm/connector: report IRQ_HPD events to drm_connector_oob_hotplug_event()
      drm/bridge: pass down IRQ_HPD to the drivers
      drm/bridge: aux-hpd: let drivers pass IRQ_HPD events
      drm/msm: dp: handle the IRQ_HPD events reported by USB-C
      soc: qcom: pmic-glink-altmode: pass down HPD_IRQ events
      usb: typec: ucsi: huawei-gaokun: pass down HPD_IRQ events

 drivers/gpu/drm/bridge/aux-hpd-bridge.c        | 11 +++++----
 drivers/gpu/drm/bridge/chrontel-ch7033.c       |  3 ++-
 drivers/gpu/drm/bridge/lontium-lt8912b.c       |  3 ++-
 drivers/gpu/drm/bridge/lontium-lt9611uxc.c     |  3 ++-
 drivers/gpu/drm/bridge/ti-tfp410.c             |  4 ++--
 drivers/gpu/drm/display/drm_bridge_connector.c | 22 ++++++++++--------
 drivers/gpu/drm/drm_bridge.c                   | 20 ++++++++++-------
 drivers/gpu/drm/drm_connector.c                |  7 ++++--
 drivers/gpu/drm/i915/display/intel_dp.c        |  3 ++-
 drivers/gpu/drm/meson/meson_encoder_hdmi.c     |  3 ++-
 drivers/gpu/drm/msm/dp/dp_display.c            |  6 ++++-
 drivers/gpu/drm/msm/dp/dp_drm.h                |  3 ++-
 drivers/gpu/drm/omapdrm/dss/hdmi4.c            |  3 ++-
 drivers/soc/qcom/pmic_glink_altmode.c          |  6 ++++-
 drivers/usb/typec/altmodes/displayport.c       | 15 +++++++++----
 drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c    | 11 +++++----
 include/drm/bridge/aux-bridge.h                | 13 +++++++++--
 include/drm/drm_bridge.h                       | 31 +++++++++++++++++++++-----
 include/drm/drm_connector.h                    | 22 ++++++++++++++++--
 19 files changed, 138 insertions(+), 51 deletions(-)
---
base-commit: c7275b05bc428c7373d97aa2da02d3a7fa6b9f66
change-id: 20260414-hpd-irq-events-e72bc076a5f1

Best regards,
--  
With best wishes
Dmitry


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

* [PATCH v3 1/6] drm/connector: report IRQ_HPD events to drm_connector_oob_hotplug_event()
  2026-04-20 23:33 [PATCH v3 0/6] drm: handle IRQ_HPD events correctly Dmitry Baryshkov
@ 2026-04-20 23:33 ` Dmitry Baryshkov
  2026-04-22 23:07   ` Claude review: " Claude Code Review Bot
  2026-04-20 23:33 ` [PATCH v3 2/6] drm/bridge: pass down IRQ_HPD to the drivers Dmitry Baryshkov
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 16+ messages in thread
From: Dmitry Baryshkov @ 2026-04-20 23:33 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Heikki Krogerus, Greg Kroah-Hartman, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Adrien Grassein, Jani Nikula, Rodrigo Vivi,
	Joonas Lahtinen, Tvrtko Ursulin, Kevin Hilman, Jerome Brunet,
	Martin Blumenstingl, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
	Jessica Zhang, Sean Paul, Marijn Suijten, Tomi Valkeinen,
	Bjorn Andersson, Konrad Dybcio, Pengyu Luo, Nikita Travkin,
	Yongxing Mou
  Cc: dri-devel, linux-kernel, linux-usb, intel-gfx, intel-xe,
	linux-amlogic, linux-arm-kernel, linux-arm-msm, freedreno

The DisplayPort standard defines a special kind of events called IRQ.
These events are used to notify DP Source about the events on the Sink
side. It is extremely important for DP MST handling, where the MST
events are reported through this IRQ.

In case of the USB-C DP AltMode there is no actual HPD pulse, but the
events are ported through the bits in the AltMode VDOs.

Extend the drm_connector_oob_hotplug_event() interface and report IRQ
events to the DisplayPort Sink drivers.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
 drivers/gpu/drm/drm_connector.c          |  5 ++++-
 drivers/usb/typec/altmodes/displayport.c | 15 +++++++++++----
 include/drm/drm_connector.h              | 19 ++++++++++++++++++-
 3 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 47dc53c4a738..edee9daccd51 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -3510,6 +3510,8 @@ struct drm_connector *drm_connector_find_by_fwnode(struct fwnode_handle *fwnode)
  * drm_connector_oob_hotplug_event - Report out-of-band hotplug event to connector
  * @connector_fwnode: fwnode_handle to report the event on
  * @status: hot plug detect logical state
+ * @extra_status: additional information provided by the sink without changing
+ * the HPD state (or in addition to such a change).
  *
  * On some hardware a hotplug event notification may come from outside the display
  * driver / device. An example of this is some USB Type-C setups where the hardware
@@ -3520,7 +3522,8 @@ struct drm_connector *drm_connector_find_by_fwnode(struct fwnode_handle *fwnode)
  * a drm_connector reference through calling drm_connector_find_by_fwnode().
  */
 void drm_connector_oob_hotplug_event(struct fwnode_handle *connector_fwnode,
-				     enum drm_connector_status status)
+				     enum drm_connector_status status,
+				     enum drm_connector_status_extra extra_status)
 {
 	struct drm_connector *connector;
 
diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c
index 35d9c3086990..7182a8e2e710 100644
--- a/drivers/usb/typec/altmodes/displayport.c
+++ b/drivers/usb/typec/altmodes/displayport.c
@@ -189,7 +189,9 @@ static int dp_altmode_status_update(struct dp_altmode *dp)
 	} else {
 		drm_connector_oob_hotplug_event(dp->connector_fwnode,
 						hpd ? connector_status_connected :
-						      connector_status_disconnected);
+						      connector_status_disconnected,
+						(hpd && irq_hpd) ? DRM_CONNECTOR_DP_IRQ_HPD :
+								   DRM_CONNECTOR_NO_EXTRA_STATUS);
 		dp->hpd = hpd;
 		sysfs_notify(&dp->alt->dev.kobj, "displayport", "hpd");
 		if (hpd && irq_hpd) {
@@ -212,7 +214,10 @@ static int dp_altmode_configured(struct dp_altmode *dp)
 	 */
 	if (dp->pending_hpd) {
 		drm_connector_oob_hotplug_event(dp->connector_fwnode,
-						connector_status_connected);
+						connector_status_connected,
+						dp->pending_irq_hpd ?
+						DRM_CONNECTOR_DP_IRQ_HPD :
+						DRM_CONNECTOR_NO_EXTRA_STATUS);
 		sysfs_notify(&dp->alt->dev.kobj, "displayport", "hpd");
 		dp->pending_hpd = false;
 		if (dp->pending_irq_hpd) {
@@ -397,7 +402,8 @@ static int dp_altmode_vdm(struct typec_altmode *alt,
 			dp->data.conf = 0;
 			if (dp->hpd) {
 				drm_connector_oob_hotplug_event(dp->connector_fwnode,
-								connector_status_disconnected);
+								connector_status_disconnected,
+								DRM_CONNECTOR_NO_EXTRA_STATUS);
 				dp->hpd = false;
 				sysfs_notify(&dp->alt->dev.kobj, "displayport", "hpd");
 			}
@@ -827,7 +833,8 @@ void dp_altmode_remove(struct typec_altmode *alt)
 
 	if (dp->connector_fwnode) {
 		drm_connector_oob_hotplug_event(dp->connector_fwnode,
-						connector_status_disconnected);
+						connector_status_disconnected,
+						DRM_CONNECTOR_NO_EXTRA_STATUS);
 
 		fwnode_handle_put(dp->connector_fwnode);
 	}
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index f83f28cae207..e05197e970d3 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -91,6 +91,22 @@ enum drm_connector_status {
 	connector_status_unknown = 3,
 };
 
+/**
+ * enum drm_connector_status_extra - additional events sent by the sink /
+ * display together or in replacement of the HPD status changes.
+ */
+enum drm_connector_status_extra {
+	/**
+	 * @DRM_CONNECTOR_NO_EXTRA_STATUS: No additional status reported.
+	 */
+	DRM_CONNECTOR_NO_EXTRA_STATUS,
+	/**
+	 * @DRM_CONNECTOR_DP_IRQ_HPD: DisplayPort Sink has sent the
+	 * IRQ_HPD (either by the HPD short pulse or via the AltMode event).
+	 */
+	DRM_CONNECTOR_DP_IRQ_HPD,
+};
+
 /**
  * enum drm_connector_registration_state - userspace registration status for
  * a &drm_connector
@@ -2521,7 +2537,8 @@ drm_connector_is_unregistered(struct drm_connector *connector)
 }
 
 void drm_connector_oob_hotplug_event(struct fwnode_handle *connector_fwnode,
-				     enum drm_connector_status status);
+				     enum drm_connector_status status,
+				     enum drm_connector_status_extra extra_status);
 const char *drm_get_connector_type_name(unsigned int connector_type);
 const char *drm_get_connector_status_name(enum drm_connector_status status);
 const char *drm_get_subpixel_order_name(enum subpixel_order order);

-- 
2.47.3


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

* [PATCH v3 2/6] drm/bridge: pass down IRQ_HPD to the drivers
  2026-04-20 23:33 [PATCH v3 0/6] drm: handle IRQ_HPD events correctly Dmitry Baryshkov
  2026-04-20 23:33 ` [PATCH v3 1/6] drm/connector: report IRQ_HPD events to drm_connector_oob_hotplug_event() Dmitry Baryshkov
@ 2026-04-20 23:33 ` Dmitry Baryshkov
  2026-04-22 23:07   ` Claude review: " Claude Code Review Bot
  2026-04-20 23:33 ` [PATCH v3 3/6] drm/bridge: aux-hpd: let drivers pass IRQ_HPD events Dmitry Baryshkov
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 16+ messages in thread
From: Dmitry Baryshkov @ 2026-04-20 23:33 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Heikki Krogerus, Greg Kroah-Hartman, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Adrien Grassein, Jani Nikula, Rodrigo Vivi,
	Joonas Lahtinen, Tvrtko Ursulin, Kevin Hilman, Jerome Brunet,
	Martin Blumenstingl, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
	Jessica Zhang, Sean Paul, Marijn Suijten, Tomi Valkeinen,
	Bjorn Andersson, Konrad Dybcio, Pengyu Luo, Nikita Travkin,
	Yongxing Mou
  Cc: dri-devel, linux-kernel, linux-usb, intel-gfx, intel-xe,
	linux-amlogic, linux-arm-kernel, linux-arm-msm, freedreno

Pass down the notifications about the IRQ_HPD events down to the
individual drivers, letting them handle those as required.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
 drivers/gpu/drm/bridge/chrontel-ch7033.c       |  3 ++-
 drivers/gpu/drm/bridge/lontium-lt8912b.c       |  3 ++-
 drivers/gpu/drm/bridge/lontium-lt9611uxc.c     |  3 ++-
 drivers/gpu/drm/bridge/ti-tfp410.c             |  4 ++--
 drivers/gpu/drm/display/drm_bridge_connector.c | 22 +++++++++++++---------
 drivers/gpu/drm/drm_bridge.c                   |  5 +++--
 drivers/gpu/drm/drm_connector.c                |  2 +-
 drivers/gpu/drm/i915/display/intel_dp.c        |  3 ++-
 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                       |  9 ++++++---
 include/drm/drm_connector.h                    |  3 ++-
 14 files changed, 43 insertions(+), 26 deletions(-)

diff --git a/drivers/gpu/drm/bridge/chrontel-ch7033.c b/drivers/gpu/drm/bridge/chrontel-ch7033.c
index 54d49d4882c8..04e6b4c00a28 100644
--- a/drivers/gpu/drm/bridge/chrontel-ch7033.c
+++ b/drivers/gpu/drm/bridge/chrontel-ch7033.c
@@ -259,7 +259,8 @@ static const struct drm_connector_helper_funcs ch7033_connector_helper_funcs = {
 	.best_encoder = ch7033_connector_best_encoder,
 };
 
-static void ch7033_hpd_event(void *arg, enum drm_connector_status status)
+static void ch7033_hpd_event(void *arg, enum drm_connector_status status,
+			     enum drm_connector_status_extra extra_status)
 {
 	struct ch7033_priv *priv = arg;
 
diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
index 8a0b48efca58..b404f0cbf60d 100644
--- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
+++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
@@ -504,7 +504,8 @@ static int lt8912_attach_dsi(struct lt8912 *lt)
 	return 0;
 }
 
-static void lt8912_bridge_hpd_cb(void *data, enum drm_connector_status status)
+static void lt8912_bridge_hpd_cb(void *data, enum drm_connector_status status,
+				 enum drm_connector_status_extra extra_status)
 {
 	struct lt8912 *lt = data;
 
diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
index 11aab07d88df..ca41ebe9f26f 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 status,
+					enum drm_connector_status_extra extra_status)
 {
 	const struct drm_edid *drm_edid;
 
diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c
index 3b6b0e92cf89..199916662895 100644
--- a/drivers/gpu/drm/bridge/ti-tfp410.c
+++ b/drivers/gpu/drm/bridge/ti-tfp410.c
@@ -39,7 +39,6 @@ drm_bridge_to_tfp410(struct drm_bridge *bridge)
 {
 	return container_of(bridge, struct tfp410, bridge);
 }
-
 static inline struct tfp410 *
 drm_connector_to_tfp410(struct drm_connector *connector)
 {
@@ -110,7 +109,8 @@ static void tfp410_hpd_work_func(struct work_struct *work)
 		drm_helper_hpd_irq_event(dvi->bridge.dev);
 }
 
-static void tfp410_hpd_callback(void *arg, enum drm_connector_status status)
+static void tfp410_hpd_callback(void *arg, enum drm_connector_status status,
+				enum drm_connector_status_extra extra_status)
 {
 	struct tfp410 *dvi = arg;
 
diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
index 39cc18f78eda..5fdb1a231cec 100644
--- a/drivers/gpu/drm/display/drm_bridge_connector.c
+++ b/drivers/gpu/drm/display/drm_bridge_connector.c
@@ -141,7 +141,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 status,
+					    enum drm_connector_status_extra extra_status)
 {
 	struct drm_bridge_connector *bridge_connector =
 		to_drm_bridge_connector(connector);
@@ -149,12 +150,13 @@ 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);
+			bridge->funcs->hpd_notify(bridge, connector, status, extra_status);
 	}
 }
 
 static void drm_bridge_connector_handle_hpd(struct drm_bridge_connector *drm_bridge_connector,
-					    enum drm_connector_status 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;
@@ -163,24 +165,26 @@ 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);
+	drm_bridge_connector_hpd_notify(connector, status, extra_status);
 
 	drm_kms_helper_connector_hotplug_event(connector);
 }
 
 static void drm_bridge_connector_hpd_cb(void *cb_data,
-					enum drm_connector_status status)
+					enum drm_connector_status status,
+					enum drm_connector_status_extra extra_status)
 {
-	drm_bridge_connector_handle_hpd(cb_data, status);
+	drm_bridge_connector_handle_hpd(cb_data, status, extra_status);
 }
 
 static void drm_bridge_connector_oob_hotplug_event(struct drm_connector *connector,
-						   enum drm_connector_status status)
+						   enum drm_connector_status status,
+						   enum drm_connector_status_extra extra_status)
 {
 	struct drm_bridge_connector *bridge_connector =
 		to_drm_bridge_connector(connector);
 
-	drm_bridge_connector_handle_hpd(bridge_connector, status);
+	drm_bridge_connector_handle_hpd(bridge_connector, status, extra_status);
 }
 
 static void drm_bridge_connector_enable_hpd(struct drm_connector *connector)
@@ -223,7 +227,7 @@ 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_bridge_connector_hpd_notify(connector, status, DRM_CONNECTOR_NO_EXTRA_STATUS);
 	} else {
 		switch (connector->connector_type) {
 		case DRM_MODE_CONNECTOR_DPI:
diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
index d6f512b73389..c8c3301cd936 100644
--- a/drivers/gpu/drm/drm_bridge.c
+++ b/drivers/gpu/drm/drm_bridge.c
@@ -1444,7 +1444,8 @@ EXPORT_SYMBOL_GPL(drm_bridge_edid_read);
  */
 void drm_bridge_hpd_enable(struct drm_bridge *bridge,
 			   void (*cb)(void *data,
-				      enum drm_connector_status status),
+				      enum drm_connector_status status,
+				      enum drm_connector_status_extra extra_status),
 			   void *data)
 {
 	if (!(bridge->ops & DRM_BRIDGE_OP_HPD))
@@ -1509,7 +1510,7 @@ void drm_bridge_hpd_notify(struct drm_bridge *bridge,
 {
 	mutex_lock(&bridge->hpd_mutex);
 	if (bridge->hpd_cb)
-		bridge->hpd_cb(bridge->hpd_data, status);
+		bridge->hpd_cb(bridge->hpd_data, status, DRM_CONNECTOR_NO_EXTRA_STATUS);
 	mutex_unlock(&bridge->hpd_mutex);
 }
 EXPORT_SYMBOL_GPL(drm_bridge_hpd_notify);
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index edee9daccd51..415eb834808c 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -3532,7 +3532,7 @@ void drm_connector_oob_hotplug_event(struct fwnode_handle *connector_fwnode,
 		return;
 
 	if (connector->funcs->oob_hotplug_event)
-		connector->funcs->oob_hotplug_event(connector, status);
+		connector->funcs->oob_hotplug_event(connector, status, extra_status);
 
 	drm_connector_put(connector);
 }
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 4955bd8b11d7..98bbcab2067b 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -6779,7 +6779,8 @@ static int intel_dp_connector_atomic_check(struct drm_connector *_connector,
 }
 
 static void intel_dp_oob_hotplug_event(struct drm_connector *_connector,
-				       enum drm_connector_status hpd_state)
+				       enum drm_connector_status hpd_state,
+				       enum drm_connector_status_extra extra_status)
 {
 	struct intel_connector *connector = to_intel_connector(_connector);
 	struct intel_display *display = to_intel_display(connector);
diff --git a/drivers/gpu/drm/meson/meson_encoder_hdmi.c b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
index 1abb0572bb5f..691b9996c8a4 100644
--- a/drivers/gpu/drm/meson/meson_encoder_hdmi.c
+++ b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
@@ -323,7 +323,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 status,
+					  enum drm_connector_status_extra extra_status)
 {
 	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 d2124d625485..7a0623fdbd8e 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -1785,7 +1785,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 status,
+			      enum drm_connector_status_extra extra_status)
 {
 	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 9eb3431dd93a..74da3ef6b625 100644
--- a/drivers/gpu/drm/msm/dp/dp_drm.h
+++ b/drivers/gpu/drm/msm/dp/dp_drm.h
@@ -41,6 +41,7 @@ void msm_dp_bridge_hpd_enable(struct drm_bridge *bridge);
 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 status,
+			      enum drm_connector_status_extra extra_status);
 
 #endif /* _DP_DRM_H_ */
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index 29b2dfb90b5f..a7288791b2a5 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -429,7 +429,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 status,
+				    enum drm_connector_status_extra extra_status)
 {
 	struct omap_hdmi *hdmi = drm_bridge_to_hdmi(bridge);
 
diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
index a8d67bd9ee50..3e4672fbd7a8 100644
--- a/include/drm/drm_bridge.h
+++ b/include/drm/drm_bridge.h
@@ -615,7 +615,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 status,
+			   enum drm_connector_status_extra extra_status);
 
 	/**
 	 * @hpd_enable:
@@ -1260,7 +1261,8 @@ struct drm_bridge {
 	 * @hpd_cb: Hot plug detection callback, registered with
 	 * drm_bridge_hpd_enable().
 	 */
-	void (*hpd_cb)(void *data, enum drm_connector_status status);
+	void (*hpd_cb)(void *data, enum drm_connector_status status,
+		       enum drm_connector_status_extra extra_status);
 	/**
 	 * @hpd_data: Private data passed to the Hot plug detection callback
 	 * @hpd_cb.
@@ -1550,7 +1552,8 @@ const struct drm_edid *drm_bridge_edid_read(struct drm_bridge *bridge,
 					    struct drm_connector *connector);
 void drm_bridge_hpd_enable(struct drm_bridge *bridge,
 			   void (*cb)(void *data,
-				      enum drm_connector_status status),
+				      enum drm_connector_status status,
+				      enum drm_connector_status_extra extra_status),
 			   void *data);
 void drm_bridge_hpd_disable(struct drm_bridge *bridge);
 void drm_bridge_hpd_notify(struct drm_bridge *bridge,
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index e05197e970d3..5ac5a64f83d9 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1720,7 +1720,8 @@ struct drm_connector_funcs {
 	 * has been received from a source outside the display driver / device.
 	 */
 	void (*oob_hotplug_event)(struct drm_connector *connector,
-				  enum drm_connector_status status);
+				  enum drm_connector_status status,
+				  enum drm_connector_status_extra extra_status);
 
 	/**
 	 * @debugfs_init:

-- 
2.47.3


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

* [PATCH v3 3/6] drm/bridge: aux-hpd: let drivers pass IRQ_HPD events
  2026-04-20 23:33 [PATCH v3 0/6] drm: handle IRQ_HPD events correctly Dmitry Baryshkov
  2026-04-20 23:33 ` [PATCH v3 1/6] drm/connector: report IRQ_HPD events to drm_connector_oob_hotplug_event() Dmitry Baryshkov
  2026-04-20 23:33 ` [PATCH v3 2/6] drm/bridge: pass down IRQ_HPD to the drivers Dmitry Baryshkov
@ 2026-04-20 23:33 ` Dmitry Baryshkov
  2026-04-22 23:07   ` Claude review: " Claude Code Review Bot
  2026-04-20 23:33 ` [PATCH v3 4/6] drm/msm: dp: handle the IRQ_HPD events reported by USB-C Dmitry Baryshkov
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 16+ messages in thread
From: Dmitry Baryshkov @ 2026-04-20 23:33 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Heikki Krogerus, Greg Kroah-Hartman, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Adrien Grassein, Jani Nikula, Rodrigo Vivi,
	Joonas Lahtinen, Tvrtko Ursulin, Kevin Hilman, Jerome Brunet,
	Martin Blumenstingl, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
	Jessica Zhang, Sean Paul, Marijn Suijten, Tomi Valkeinen,
	Bjorn Andersson, Konrad Dybcio, Pengyu Luo, Nikita Travkin,
	Yongxing Mou
  Cc: dri-devel, linux-kernel, linux-usb, intel-gfx, intel-xe,
	linux-amlogic, linux-arm-kernel, linux-arm-msm, freedreno

Let users of aux-hpd, the UCSI and PMIC GLINK drivers pass the IRQ_HPD
events to the DisplayPort drivers.

The drm_aux_hpd_bridge_notify() is keps to ease merging of the series,
preventing extra cross-tree merges. It will be removed once all
drivers are converted. The drm_bridge_hpd_notify() function is kept for
the driver which only care about the connector status and will always
pass false as the irq_hpd event.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
 drivers/gpu/drm/bridge/aux-hpd-bridge.c | 11 +++++++----
 drivers/gpu/drm/drm_bridge.c            | 17 ++++++++++-------
 include/drm/bridge/aux-bridge.h         | 13 +++++++++++--
 include/drm/drm_bridge.h                | 22 ++++++++++++++++++++--
 4 files changed, 48 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/bridge/aux-hpd-bridge.c b/drivers/gpu/drm/bridge/aux-hpd-bridge.c
index f02a38a2638a..0e2f0b046121 100644
--- a/drivers/gpu/drm/bridge/aux-hpd-bridge.c
+++ b/drivers/gpu/drm/bridge/aux-hpd-bridge.c
@@ -136,16 +136,19 @@ struct device *drm_dp_hpd_bridge_register(struct device *parent, struct device_n
 EXPORT_SYMBOL_GPL(drm_dp_hpd_bridge_register);
 
 /**
- * drm_aux_hpd_bridge_notify - notify hot plug detection events
+ * drm_aux_hpd_bridge_notify_extra - notify hot plug detection events
  * @dev: device created for the HPD bridge
  * @status: output connection status
+ * @extra_status: extra status bits like DRM_CONNECTOR_DP_IRQ_HPD
  *
  * A wrapper around drm_bridge_hpd_notify() that is used to report hot plug
  * detection events for bridges created via drm_dp_hpd_bridge_register().
  *
  * This function shall be called in a context that can sleep.
  */
-void drm_aux_hpd_bridge_notify(struct device *dev, enum drm_connector_status status)
+void drm_aux_hpd_bridge_notify_extra(struct device *dev,
+				     enum drm_connector_status status,
+				     enum drm_connector_status_extra extra_status)
 {
 	struct auxiliary_device *adev = to_auxiliary_dev(dev);
 	struct drm_aux_hpd_bridge_data *data = auxiliary_get_drvdata(adev);
@@ -153,9 +156,9 @@ void drm_aux_hpd_bridge_notify(struct device *dev, enum drm_connector_status sta
 	if (!data)
 		return;
 
-	drm_bridge_hpd_notify(&data->bridge, status);
+	drm_bridge_hpd_notify_extra(&data->bridge, status, extra_status);
 }
-EXPORT_SYMBOL_GPL(drm_aux_hpd_bridge_notify);
+EXPORT_SYMBOL_GPL(drm_aux_hpd_bridge_notify_extra);
 
 static int drm_aux_hpd_bridge_attach(struct drm_bridge *bridge,
 				     struct drm_encoder *encoder,
diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
index c8c3301cd936..09c3f5954ade 100644
--- a/drivers/gpu/drm/drm_bridge.c
+++ b/drivers/gpu/drm/drm_bridge.c
@@ -1495,25 +1495,28 @@ void drm_bridge_hpd_disable(struct drm_bridge *bridge)
 EXPORT_SYMBOL_GPL(drm_bridge_hpd_disable);
 
 /**
- * drm_bridge_hpd_notify - notify hot plug detection events
+ * drm_bridge_hpd_notify_extra - notify hot plug detection and sink IRQ events
  * @bridge: bridge control structure
  * @status: output connection status
+ * @extra_status: additional status recorded by the sink
  *
  * Bridge drivers shall call this function to report hot plug events when they
- * detect a change in the output status, when hot plug detection has been
- * enabled by drm_bridge_hpd_enable().
+ * detect a change in the output status or when the sink has reported extra HPD
+ * status events (like the IRQ_HPD in case of the DisplayPort), when hot plug
+ * detection has been enabled by drm_bridge_hpd_enable().
  *
  * This function shall be called in a context that can sleep.
  */
-void drm_bridge_hpd_notify(struct drm_bridge *bridge,
-			   enum drm_connector_status status)
+void drm_bridge_hpd_notify_extra(struct drm_bridge *bridge,
+				 enum drm_connector_status status,
+				 enum drm_connector_status_extra extra_status)
 {
 	mutex_lock(&bridge->hpd_mutex);
 	if (bridge->hpd_cb)
-		bridge->hpd_cb(bridge->hpd_data, status, DRM_CONNECTOR_NO_EXTRA_STATUS);
+		bridge->hpd_cb(bridge->hpd_data, status, extra_status);
 	mutex_unlock(&bridge->hpd_mutex);
 }
-EXPORT_SYMBOL_GPL(drm_bridge_hpd_notify);
+EXPORT_SYMBOL_GPL(drm_bridge_hpd_notify_extra);
 
 #ifdef CONFIG_OF
 /**
diff --git a/include/drm/bridge/aux-bridge.h b/include/drm/bridge/aux-bridge.h
index c2f5a855512f..f9a86886b0df 100644
--- a/include/drm/bridge/aux-bridge.h
+++ b/include/drm/bridge/aux-bridge.h
@@ -25,7 +25,9 @@ struct auxiliary_device *devm_drm_dp_hpd_bridge_alloc(struct device *parent, str
 int devm_drm_dp_hpd_bridge_add(struct device *dev, struct auxiliary_device *adev);
 struct device *drm_dp_hpd_bridge_register(struct device *parent,
 					  struct device_node *np);
-void drm_aux_hpd_bridge_notify(struct device *dev, enum drm_connector_status status);
+void drm_aux_hpd_bridge_notify_extra(struct device *dev,
+				     enum drm_connector_status status,
+				     enum drm_connector_status_extra extra_status);
 #else
 static inline struct auxiliary_device *devm_drm_dp_hpd_bridge_alloc(struct device *parent,
 								    struct device_node *np)
@@ -44,9 +46,16 @@ static inline struct device *drm_dp_hpd_bridge_register(struct device *parent,
 	return NULL;
 }
 
-static inline void drm_aux_hpd_bridge_notify(struct device *dev, enum drm_connector_status status)
+static inline void drm_aux_hpd_bridge_notify_extra(struct device *dev,
+						   enum drm_connector_status status,
+						   enum drm_connector_status_extra extra_status)
 {
 }
 #endif
 
+static inline void drm_aux_hpd_bridge_notify(struct device *dev, enum drm_connector_status status)
+{
+	drm_aux_hpd_bridge_notify_extra(dev, status, DRM_CONNECTOR_NO_EXTRA_STATUS);
+}
+
 #endif
diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
index 3e4672fbd7a8..2cf604cf02db 100644
--- a/include/drm/drm_bridge.h
+++ b/include/drm/drm_bridge.h
@@ -1556,8 +1556,26 @@ void drm_bridge_hpd_enable(struct drm_bridge *bridge,
 				      enum drm_connector_status_extra extra_status),
 			   void *data);
 void drm_bridge_hpd_disable(struct drm_bridge *bridge);
-void drm_bridge_hpd_notify(struct drm_bridge *bridge,
-			   enum drm_connector_status status);
+void drm_bridge_hpd_notify_extra(struct drm_bridge *bridge,
+				 enum drm_connector_status status,
+				 enum drm_connector_status_extra extra_status);
+
+/**
+ * drm_bridge_hpd_notify - notify hot plug detection events
+ * @bridge: bridge control structure
+ * @status: output connection status
+ *
+ * Bridge drivers shall call this function to report hot plug events when they
+ * detect a change in the output status, when hot plug detection has been
+ * enabled by drm_bridge_hpd_enable().
+ *
+ * This function shall be called in a context that can sleep.
+ */
+static inline void drm_bridge_hpd_notify(struct drm_bridge *bridge,
+					 enum drm_connector_status status)
+{
+	drm_bridge_hpd_notify_extra(bridge, status, DRM_CONNECTOR_NO_EXTRA_STATUS);
+}
 
 #ifdef CONFIG_DRM_PANEL_BRIDGE
 bool drm_bridge_is_panel(const struct drm_bridge *bridge);

-- 
2.47.3


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

* [PATCH v3 4/6] drm/msm: dp: handle the IRQ_HPD events reported by USB-C
  2026-04-20 23:33 [PATCH v3 0/6] drm: handle IRQ_HPD events correctly Dmitry Baryshkov
                   ` (2 preceding siblings ...)
  2026-04-20 23:33 ` [PATCH v3 3/6] drm/bridge: aux-hpd: let drivers pass IRQ_HPD events Dmitry Baryshkov
@ 2026-04-20 23:33 ` Dmitry Baryshkov
  2026-04-22 23:07   ` Claude review: " Claude Code Review Bot
  2026-04-20 23:33 ` [PATCH v3 5/6] soc: qcom: pmic-glink-altmode: pass down HPD_IRQ events Dmitry Baryshkov
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 16+ messages in thread
From: Dmitry Baryshkov @ 2026-04-20 23:33 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Heikki Krogerus, Greg Kroah-Hartman, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Adrien Grassein, Jani Nikula, Rodrigo Vivi,
	Joonas Lahtinen, Tvrtko Ursulin, Kevin Hilman, Jerome Brunet,
	Martin Blumenstingl, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
	Jessica Zhang, Sean Paul, Marijn Suijten, Tomi Valkeinen,
	Bjorn Andersson, Konrad Dybcio, Pengyu Luo, Nikita Travkin,
	Yongxing Mou
  Cc: dri-devel, linux-kernel, linux-usb, intel-gfx, intel-xe,
	linux-amlogic, linux-arm-kernel, linux-arm-msm, freedreno

Let the MSM DisplayPort driver properly track and handle IRQ_HPD
delivered over the OOB events (e.g. from the USB-C AltMode handler).

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
 drivers/gpu/drm/msm/dp/dp_display.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index 7a0623fdbd8e..8df579bb320a 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -1800,4 +1800,7 @@ void msm_dp_bridge_hpd_notify(struct drm_bridge *bridge,
 		msm_dp_add_event(dp, EV_HPD_PLUG_INT, 0, 0);
 	else if (msm_dp_display->link_ready && status == connector_status_disconnected)
 		msm_dp_add_event(dp, EV_HPD_UNPLUG_INT, 0, 0);
+
+	if (extra_status == DRM_CONNECTOR_DP_IRQ_HPD)
+		msm_dp_add_event(dp, EV_IRQ_HPD_INT, 0, 0);
 }

-- 
2.47.3


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

* [PATCH v3 5/6] soc: qcom: pmic-glink-altmode: pass down HPD_IRQ events
  2026-04-20 23:33 [PATCH v3 0/6] drm: handle IRQ_HPD events correctly Dmitry Baryshkov
                   ` (3 preceding siblings ...)
  2026-04-20 23:33 ` [PATCH v3 4/6] drm/msm: dp: handle the IRQ_HPD events reported by USB-C Dmitry Baryshkov
@ 2026-04-20 23:33 ` Dmitry Baryshkov
  2026-04-21  9:51   ` Konrad Dybcio
  2026-04-22 23:07   ` Claude review: " Claude Code Review Bot
  2026-04-20 23:33 ` [PATCH v3 6/6] usb: typec: ucsi: huawei-gaokun: " Dmitry Baryshkov
  2026-04-22 23:07 ` Claude review: drm: handle IRQ_HPD events correctly Claude Code Review Bot
  6 siblings, 2 replies; 16+ messages in thread
From: Dmitry Baryshkov @ 2026-04-20 23:33 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Heikki Krogerus, Greg Kroah-Hartman, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Adrien Grassein, Jani Nikula, Rodrigo Vivi,
	Joonas Lahtinen, Tvrtko Ursulin, Kevin Hilman, Jerome Brunet,
	Martin Blumenstingl, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
	Jessica Zhang, Sean Paul, Marijn Suijten, Tomi Valkeinen,
	Bjorn Andersson, Konrad Dybcio, Pengyu Luo, Nikita Travkin,
	Yongxing Mou
  Cc: dri-devel, linux-kernel, linux-usb, intel-gfx, intel-xe,
	linux-amlogic, linux-arm-kernel, linux-arm-msm, freedreno

Pass IRQ_HPD events to the HPD bridge, letting those to be delivered to
the DisplayPort driver.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
 drivers/soc/qcom/pmic_glink_altmode.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/pmic_glink_altmode.c b/drivers/soc/qcom/pmic_glink_altmode.c
index 619bad2c27ee..946eb20b8f83 100644
--- a/drivers/soc/qcom/pmic_glink_altmode.c
+++ b/drivers/soc/qcom/pmic_glink_altmode.c
@@ -373,7 +373,11 @@ static void pmic_glink_altmode_worker(struct work_struct *work)
 		else
 			conn_status = connector_status_disconnected;
 
-		drm_aux_hpd_bridge_notify(&alt_port->bridge->dev, conn_status);
+		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);
 	} 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.47.3


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

* [PATCH v3 6/6] usb: typec: ucsi: huawei-gaokun: pass down HPD_IRQ events
  2026-04-20 23:33 [PATCH v3 0/6] drm: handle IRQ_HPD events correctly Dmitry Baryshkov
                   ` (4 preceding siblings ...)
  2026-04-20 23:33 ` [PATCH v3 5/6] soc: qcom: pmic-glink-altmode: pass down HPD_IRQ events Dmitry Baryshkov
@ 2026-04-20 23:33 ` Dmitry Baryshkov
  2026-04-22 23:07   ` Claude review: " Claude Code Review Bot
  2026-04-22 23:07 ` Claude review: drm: handle IRQ_HPD events correctly Claude Code Review Bot
  6 siblings, 1 reply; 16+ messages in thread
From: Dmitry Baryshkov @ 2026-04-20 23:33 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Heikki Krogerus, Greg Kroah-Hartman, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Adrien Grassein, Jani Nikula, Rodrigo Vivi,
	Joonas Lahtinen, Tvrtko Ursulin, Kevin Hilman, Jerome Brunet,
	Martin Blumenstingl, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
	Jessica Zhang, Sean Paul, Marijn Suijten, Tomi Valkeinen,
	Bjorn Andersson, Konrad Dybcio, Pengyu Luo, Nikita Travkin,
	Yongxing Mou
  Cc: dri-devel, linux-kernel, linux-usb, intel-gfx, intel-xe,
	linux-amlogic, linux-arm-kernel, linux-arm-msm, freedreno

Pass IRQ_HPD events to the HPD bridge, letting those to be delivered to
the DisplayPort driver.

Reviewed-by: Pengyu Luo <mitltlatltl@gmail.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
 drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c b/drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c
index ca749fde49bd..5e3f887ecbd8 100644
--- a/drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c
+++ b/drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c
@@ -299,10 +299,13 @@ static void gaokun_ucsi_handle_altmode(struct gaokun_ucsi_port *port)
 
 	/* UCSI callback .connector_status() have set orientation */
 	if (port->bridge)
-		drm_aux_hpd_bridge_notify(&port->bridge->dev,
-					  port->hpd_state ?
-					  connector_status_connected :
-					  connector_status_disconnected);
+		drm_aux_hpd_bridge_notify_extra(&port->bridge->dev,
+						port->hpd_state ?
+						connector_status_connected :
+						connector_status_disconnected,
+						port->hpd_irq ?
+						DRM_CONNECTOR_DP_IRQ_HPD :
+						DRM_CONNECTOR_NO_EXTRA_STATUS);
 
 	gaokun_ec_ucsi_pan_ack(uec->ec, port->idx);
 }

-- 
2.47.3


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

* Re: [PATCH v3 5/6] soc: qcom: pmic-glink-altmode: pass down HPD_IRQ events
  2026-04-20 23:33 ` [PATCH v3 5/6] soc: qcom: pmic-glink-altmode: pass down HPD_IRQ events Dmitry Baryshkov
@ 2026-04-21  9:51   ` Konrad Dybcio
  2026-04-22 23:07   ` Claude review: " Claude Code Review Bot
  1 sibling, 0 replies; 16+ messages in thread
From: Konrad Dybcio @ 2026-04-21  9:51 UTC (permalink / raw)
  To: Dmitry Baryshkov, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Heikki Krogerus,
	Greg Kroah-Hartman, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Adrien Grassein,
	Jani Nikula, Rodrigo Vivi, Joonas Lahtinen, Tvrtko Ursulin,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Rob Clark,
	Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
	Marijn Suijten, Tomi Valkeinen, Bjorn Andersson, Konrad Dybcio,
	Pengyu Luo, Nikita Travkin, Yongxing Mou
  Cc: dri-devel, linux-kernel, linux-usb, intel-gfx, intel-xe,
	linux-amlogic, linux-arm-kernel, linux-arm-msm, freedreno

On 4/21/26 1:33 AM, Dmitry Baryshkov wrote:
> Pass IRQ_HPD events to the HPD bridge, letting those to be delivered to
> the DisplayPort driver.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

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

* Claude review: drm: handle IRQ_HPD events correctly
  2026-04-20 23:33 [PATCH v3 0/6] drm: handle IRQ_HPD events correctly Dmitry Baryshkov
                   ` (5 preceding siblings ...)
  2026-04-20 23:33 ` [PATCH v3 6/6] usb: typec: ucsi: huawei-gaokun: " Dmitry Baryshkov
@ 2026-04-22 23:07 ` Claude Code Review Bot
  6 siblings, 0 replies; 16+ messages in thread
From: Claude Code Review Bot @ 2026-04-22 23:07 UTC (permalink / raw)
  To: dri-devel-reviews

Overall Series Review

Subject: drm: handle IRQ_HPD events correctly
Author: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patches: 8
Reviewed: 2026-04-23T09:07:42.466808

---

This is a well-structured 6-patch series from Dmitry Baryshkov that addresses a real gap in the DRM/USB-C DisplayPort AltMode subsystem: the inability to propagate IRQ_HPD (short hotplug pulses / sink attention requests) through the out-of-band hotplug path. This is critical for DP MST support over USB-C, where MST sideband messages are delivered via IRQ_HPD.

The approach is sound:
1. Introduce `enum drm_connector_status_extra` to carry additional event information alongside HPD status
2. Thread this new parameter through the connector, bridge, and aux-hpd APIs
3. Provide backward-compatible inline wrappers so existing callers don't need updating
4. Wire up consumers: MSM DP driver, PMIC GLINK altmode, and Huawei Gaokun UCSI

The layering is clean -- core API changes first, then bridge plumbing, then driver consumers. The backward-compatible wrappers (`drm_bridge_hpd_notify()`, `drm_aux_hpd_bridge_notify()`) are a pragmatic choice to avoid cross-tree merge complications.

**Minor issues found:** One typo in a commit message, one stray cosmetic change, and a question about the `_extra` naming suffix. No correctness bugs identified.

---

---
Generated by Claude Code Patch Reviewer

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

* Claude review: drm/connector: report IRQ_HPD events to drm_connector_oob_hotplug_event()
  2026-04-20 23:33 ` [PATCH v3 1/6] drm/connector: report IRQ_HPD events to drm_connector_oob_hotplug_event() Dmitry Baryshkov
@ 2026-04-22 23:07   ` Claude Code Review Bot
  0 siblings, 0 replies; 16+ messages in thread
From: Claude Code Review Bot @ 2026-04-22 23:07 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Design:** The new `enum drm_connector_status_extra` is well-defined with good kerneldoc. Using a separate enum rather than overloading `drm_connector_status` is the right call -- these are orthogonal concepts (connection state vs. event type).

**drm_connector.c change** -- clean and minimal. The function signature gains the extra parameter, which is threaded through to `connector->funcs->oob_hotplug_event()` (done later in patch 2).

**displayport.c changes** -- the logic is correct:

```c
(hpd && irq_hpd) ? DRM_CONNECTOR_DP_IRQ_HPD :
                   DRM_CONNECTOR_NO_EXTRA_STATUS
```

IRQ_HPD only makes sense when HPD is asserted (connected), so the `hpd && irq_hpd` guard is correct per the DP spec. The disconnect paths correctly pass `DRM_CONNECTOR_NO_EXTRA_STATUS`.

The `dp_altmode_configured()` path correctly uses `dp->pending_irq_hpd` for deferred HPD events. No issues.

**Nit:** The cover letter has "singnalling" (typo for "signalling").

---
Generated by Claude Code Patch Reviewer

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

* Claude review: drm/bridge: pass down IRQ_HPD to the drivers
  2026-04-20 23:33 ` [PATCH v3 2/6] drm/bridge: pass down IRQ_HPD to the drivers Dmitry Baryshkov
@ 2026-04-22 23:07   ` Claude Code Review Bot
  0 siblings, 0 replies; 16+ messages in thread
From: Claude Code Review Bot @ 2026-04-22 23:07 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

This is the largest patch -- a mechanical update of callback signatures across the bridge subsystem. All the changes are consistent:

- `hpd_notify` funcs pointer: gains `enum drm_connector_status_extra extra_status`
- `hpd_cb` function pointer: same
- `drm_bridge_hpd_enable()`: callback parameter updated
- `oob_hotplug_event` funcs pointer: same
- All bridge driver callbacks updated to accept but ignore the new parameter (correct -- non-DP bridges don't need it)

**Key correctness check** -- In `drm_bridge.c`, the existing `drm_bridge_hpd_notify()` passes `DRM_CONNECTOR_NO_EXTRA_STATUS` to the updated `hpd_cb`:

```c
bridge->hpd_cb(bridge->hpd_data, status, DRM_CONNECTOR_NO_EXTRA_STATUS);
```

This is correct for backward compatibility -- callers that don't know about IRQ_HPD continue to work.

In `drm_bridge_connector.c`, `drm_bridge_connector_detect()` correctly passes `DRM_CONNECTOR_NO_EXTRA_STATUS` since polling-based detection doesn't have IRQ events.

**Minor cosmetic issue:** In `ti-tfp410.c`, a blank line between `drm_bridge_to_tfp410()` and `drm_connector_to_tfp410()` is removed. This is unrelated to the IRQ_HPD changes:

```c
-}
-
-static inline struct tfp410 *
+}
+static inline struct tfp410 *
```

Consider keeping the blank line to avoid unnecessary churn.

---
Generated by Claude Code Patch Reviewer

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

* Claude review: drm/bridge: aux-hpd: let drivers pass IRQ_HPD events
  2026-04-20 23:33 ` [PATCH v3 3/6] drm/bridge: aux-hpd: let drivers pass IRQ_HPD events Dmitry Baryshkov
@ 2026-04-22 23:07   ` Claude Code Review Bot
  0 siblings, 0 replies; 16+ messages in thread
From: Claude Code Review Bot @ 2026-04-22 23:07 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

This renames the core notification functions to `_extra` variants and keeps the old names as inline wrappers. The approach is pragmatic for cross-tree merging.

**aux-bridge.h wrapper placement** -- The `drm_aux_hpd_bridge_notify()` inline wrapper is placed outside the `#ifdef CONFIG_DRM_AUX_HPD_BRIDGE` / `#else` blocks but inside the header guard. This works correctly because `drm_aux_hpd_bridge_notify_extra()` is available in both the real and stub forms.

**drm_bridge.h wrapper** -- Clean, with proper kerneldoc.

**Typo in commit message:** "The drm_aux_hpd_bridge_notify() is **keps** to ease merging" should be "**kept**".

**Naming:** The `_extra` suffix is somewhat generic. While I understand this was chosen based on v2 review feedback (Tomi suggested making it more general for future extra status bits), names like `_with_extra_status` or `_extended` might be slightly clearer. But this is a matter of taste and the current naming is acceptable.

---
Generated by Claude Code Patch Reviewer

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

* Claude review: drm/msm: dp: handle the IRQ_HPD events reported by USB-C
  2026-04-20 23:33 ` [PATCH v3 4/6] drm/msm: dp: handle the IRQ_HPD events reported by USB-C Dmitry Baryshkov
@ 2026-04-22 23:07   ` Claude Code Review Bot
  0 siblings, 0 replies; 16+ messages in thread
From: Claude Code Review Bot @ 2026-04-22 23:07 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

Small, focused patch:

```c
if (extra_status == DRM_CONNECTOR_DP_IRQ_HPD)
    msm_dp_add_event(dp, EV_IRQ_HPD_INT, 0, 0);
```

This correctly reuses the existing `EV_IRQ_HPD_INT` event path that already handles IRQ_HPD from native HPD sources. The early return for `internal_hpd` at the top of the function also covers this new code path.

**Potential concern:** When both HPD connect and IRQ_HPD arrive simultaneously (initial connection with IRQ), both `EV_HPD_PLUG_INT` and `EV_IRQ_HPD_INT` are queued. The PLUG handler schedules async link training, so the IRQ_HPD handler may run before the link is fully trained. However, this is the same pattern as native HPD interrupt handling in `msm_dp_display_irq_handler()` where both interrupt bits can fire simultaneously, so the driver is already designed to handle this ordering.

---
Generated by Claude Code Patch Reviewer

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

* Claude review: soc: qcom: pmic-glink-altmode: pass down HPD_IRQ events
  2026-04-20 23:33 ` [PATCH v3 5/6] soc: qcom: pmic-glink-altmode: pass down HPD_IRQ events Dmitry Baryshkov
  2026-04-21  9:51   ` Konrad Dybcio
@ 2026-04-22 23:07   ` Claude Code Review Bot
  1 sibling, 0 replies; 16+ messages in thread
From: Claude Code Review Bot @ 2026-04-22 23:07 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

Clean consumer change. The `alt_port->hpd_irq` field already exists and is populated from PMIC GLINK messages. This patch simply passes it through the bridge notification path:

```c
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);
```

Note that `pmic_glink_altmode_enable_dp()` on the lines above already receives `alt_port->hpd_irq` and handles the DP PHY configuration side. The bridge notification handles the display/connector side. No duplication issue.

---
Generated by Claude Code Patch Reviewer

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

* Claude review: usb: typec: ucsi: huawei-gaokun: pass down HPD_IRQ events
  2026-04-20 23:33 ` [PATCH v3 6/6] usb: typec: ucsi: huawei-gaokun: " Dmitry Baryshkov
@ 2026-04-22 23:07   ` Claude Code Review Bot
  0 siblings, 0 replies; 16+ messages in thread
From: Claude Code Review Bot @ 2026-04-22 23:07 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

Same pattern as patch 5 for the Huawei Gaokun UCSI driver. Already has Reviewed-by from Pengyu Luo and Acked-by from Heikki Krogerus. No issues.

---

**Summary:** The series is in good shape. The two typos ("keps" in patch 3 commit message, stray blank line removal in patch 2) are minor. No correctness issues found. The approach is architecturally sound and the backward-compatible wrappers are a pragmatic choice for cross-subsystem merging.

---
Generated by Claude Code Patch Reviewer

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

* Claude review: drm/connector: report IRQ_HPD events to drm_connector_oob_hotplug_event()
  2026-04-20 15:31 ` [PATCH v2 1/6] drm/connector: report IRQ_HPD events to drm_connector_oob_hotplug_event() Dmitry Baryshkov
@ 2026-04-22 23:32   ` Claude Code Review Bot
  0 siblings, 0 replies; 16+ messages in thread
From: Claude Code Review Bot @ 2026-04-22 23:32 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

This patch introduces the `enum drm_connector_status_extra` type and extends `drm_connector_oob_hotplug_event()` and all its callers in the USB typec displayport altmode driver.

**Looks good overall.** The enum and its documentation are clear. The callers in `displayport.c` are correctly updated.

One minor observation: in the `dp_altmode_status_update()` path:

```c
drm_connector_oob_hotplug_event(dp->connector_fwnode,
				hpd ? connector_status_connected :
				      connector_status_disconnected,
				(hpd && irq_hpd) ? DRM_CONNECTOR_DP_IRQ_HPD :
						   DRM_CONNECTOR_NO_EXTRA_STATUS);
```

This correctly only sends IRQ_HPD when HPD is asserted (since IRQ_HPD without HPD is meaningless per DP spec). Good.

Minor nit: the cover letter says "desribing" (typo for "describing") and "chaning" (typo for "changing"), but those are in the changelog, not in code.

---
Generated by Claude Code Patch Reviewer

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

end of thread, other threads:[~2026-04-22 23:32 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20 23:33 [PATCH v3 0/6] drm: handle IRQ_HPD events correctly Dmitry Baryshkov
2026-04-20 23:33 ` [PATCH v3 1/6] drm/connector: report IRQ_HPD events to drm_connector_oob_hotplug_event() Dmitry Baryshkov
2026-04-22 23:07   ` Claude review: " Claude Code Review Bot
2026-04-20 23:33 ` [PATCH v3 2/6] drm/bridge: pass down IRQ_HPD to the drivers Dmitry Baryshkov
2026-04-22 23:07   ` Claude review: " Claude Code Review Bot
2026-04-20 23:33 ` [PATCH v3 3/6] drm/bridge: aux-hpd: let drivers pass IRQ_HPD events Dmitry Baryshkov
2026-04-22 23:07   ` Claude review: " Claude Code Review Bot
2026-04-20 23:33 ` [PATCH v3 4/6] drm/msm: dp: handle the IRQ_HPD events reported by USB-C Dmitry Baryshkov
2026-04-22 23:07   ` Claude review: " Claude Code Review Bot
2026-04-20 23:33 ` [PATCH v3 5/6] soc: qcom: pmic-glink-altmode: pass down HPD_IRQ events Dmitry Baryshkov
2026-04-21  9:51   ` Konrad Dybcio
2026-04-22 23:07   ` Claude review: " Claude Code Review Bot
2026-04-20 23:33 ` [PATCH v3 6/6] usb: typec: ucsi: huawei-gaokun: " Dmitry Baryshkov
2026-04-22 23:07   ` Claude review: " Claude Code Review Bot
2026-04-22 23:07 ` Claude review: drm: handle IRQ_HPD events correctly Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-04-20 15:31 [PATCH v2 0/6] " Dmitry Baryshkov
2026-04-20 15:31 ` [PATCH v2 1/6] drm/connector: report IRQ_HPD events to drm_connector_oob_hotplug_event() Dmitry Baryshkov
2026-04-22 23:32   ` Claude review: " Claude Code Review Bot

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