All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joonhoe Kim <26rote@gmail.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: Rob Clark <robin.clark@oss.qualcomm.com>,
	Dmitry Baryshkov <lumag@kernel.org>,
	Abhinav Kumar <abhinav.kumar@linux.dev>,
	Jessica Zhang <jesszhan0024@gmail.com>,
	Sean Paul <sean@poorly.run>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Pengyu Luo <mitltlatltl@gmail.com>,
	Yongxing Mou <yongxing.mou@oss.qualcomm.com>,
	linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 7/9] drm/msm/dp: handle the IRQ_HPD events reported by USB-C
Date: Sun,  8 Nov 2026 10:15:01 +0900	[thread overview]
Message-ID: <20261108011501.4466-1-26rote@gmail.com> (raw)
In-Reply-To: <20261024-hpd-irq-events-v8-7-6ee949e7a384@oss.qualcomm.com>

On Sat, 24 Oct 2026 03:35:23 +0300, Dmitry Baryshkov wrote:
> +		if (hpd_link_status == ISR_IRQ_HPD_PULSE_COUNT ||
> +		    event == DRM_CONNECTOR_DP_IRQ_HPD)
> +			msm_dp_irq_hpd_handle(dp);

With this, an IRQ_HPD that arrives while the link is down hangs the
board. I hit it on the Lenovo Y700 Gen 5 (TB323FU, Kaanapali), DP over
USB-C (pmic_glink altmode), when booting with a 5120x2160 SST monitor
attached. The tree is Linux v7.3 with this series (6/9 replaced by an
equivalent local change), the MST v7 series [1] and a few local fixes
outside this path.

The path itself is not new: the native HPD block can reach it through
ISR_IRQ_HPD_PULSE_COUNT. This patch makes it reachable from USB-C,
where every IRQ_HPD now goes there.

When the boot-time mode is disabled for the first modeset from
userspace, the monitor loses the link and sends an IRQ_HPD with
LINK_STATUS_UPDATED (DPCD 0x204 = 0x80). From a boot with the
active_stream_cnt check described below and drm.debug=0x100
(msm_dp_irq_hpd_handle() is inlined into msm_dp_bridge_hpd_notify()):

 [    4.572532] [drm:msm_dp_ctrl_off_link] disable
 [    4.573756] [drm:msm_dp_ctrl_link_clk_disable] disabled link clocks
 [    4.608443] msm_dpu 9801000.display-controller: [drm:msm_dp_bridge_hpd_notify] type=10 link hpd_link_status=0x0, status=1
 ...
 [    4.823192] [drm:msm_dp_link_process_link_status_update] channel_eq_done = 0, clock_recovery_done = 0
 [    4.823194] [drm:msm_dp_link_process_request] sink request=0x80
 [    4.823197] msm_dpu 9801000.display-controller: [drm:msm_dp_bridge_hpd_notify] sink_request=128
 [    4.823199] msm_dpu 9801000.display-controller: [drm:msm_dp_bridge_hpd_notify] 128
 [    4.823201] msm_dpu 9801000.display-controller: [drm:msm_dp_bridge_hpd_notify] After, type=10, sink_count=1

Without the check, msm_dp_display_handle_irq_hpd() calls
msm_dp_ctrl_handle_sink_request(), and msm_dp_ctrl_link_maintenance()
starts with msm_dp_ctrl_push_idle(), which writes REG_DP_STATE_CTRL
while the link clocks are off. The board hung on 3 of 3 boots with the
monitor attached. On the one hung boot with drm.debug, the printk ring
ends at the "128" line, the drm_dbg_dp() just before
msm_dp_ctrl_handle_sink_request(). In the two RAM dumps I could
analyse, CPU0 is still running pmic_glink_altmode_worker, which holds
the encoder's bridge_chain_mutex taken in
drm_bridge_connector_hpd_notify(), and ctrl->link_clks_on is false.

Locally I skip sink requests while the link is down. On this series
alone the check would be on power_on:

--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -400,3 +400,6 @@ static int msm_dp_display_handle_irq_hpd(struct msm_dp_display_private *dp)
 	drm_dbg_dp(dp->drm_dev, "%d\n", sink_request);
 
+	if (!dp->msm_dp_display.power_on)
+		return 0;
+
 	msm_dp_ctrl_handle_sink_request(dp->ctrl, dp->panel);

This matches the !power_on check that already guards
msm_dp_ctrl_push_idle() in msm_dp_display_atomic_disable().

In my tree the MST series replaces power_on with active_stream_cnt.
With the same check on active_stream_cnt, 2 of 2 boots came up on the
monitor; the link is retrained about 1.2 s later, when the stream is
enabled.

A check on ctrl->link_clks_on in msm_dp_ctrl_handle_sink_request()
should also work.

[1] https://lore.kernel.org/all/20260929-msm-dp-mst-v7-0-4b81473185e7@oss.qualcomm.com/

Thanks,
Joonhoe Kim

  parent reply	other threads:[~2026-11-08  1:15 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-24  0:35 [PATCH v8 0/9] drm: handle IRQ_HPD events correctly Dmitry Baryshkov
2026-10-24  0:35 ` Dmitry Baryshkov
2026-10-24  0:35 ` [PATCH v8 1/9] drm/connector: report out-of-band IRQ_HPD events Dmitry Baryshkov
2026-10-24  0:35   ` Dmitry Baryshkov
2026-10-24  0:45   ` sashiko-bot
2026-11-05 11:47   ` Luca Ceresoli
2026-11-05 11:47     ` Luca Ceresoli
2026-10-24  0:35 ` [PATCH v8 2/9] drm/connector: pass down IRQ_HPD to the drivers Dmitry Baryshkov
2026-10-24  0:35   ` Dmitry Baryshkov
2026-10-24  0:41   ` sashiko-bot
2026-11-05 11:47   ` Luca Ceresoli
2026-11-05 11:47     ` Luca Ceresoli
2026-10-24  0:35 ` [PATCH v8 3/9] drm/bridge: " Dmitry Baryshkov
2026-10-24  0:35   ` Dmitry Baryshkov
2026-10-24  0:41   ` sashiko-bot
2026-11-05 11:47   ` Luca Ceresoli
2026-11-05 11:47     ` Luca Ceresoli
2026-10-24  0:35 ` [PATCH v8 4/9] drm/bridge: pass extra events to the HPD callback Dmitry Baryshkov
2026-10-24  0:35   ` Dmitry Baryshkov
2026-10-24  0:41   ` sashiko-bot
2026-11-05 11:47   ` Luca Ceresoli
2026-11-05 11:47     ` Luca Ceresoli
2026-10-24  0:35 ` [PATCH v8 5/9] drm/bridge: aux-hpd: let drivers pass IRQ_HPD events Dmitry Baryshkov
2026-10-24  0:35   ` Dmitry Baryshkov
2026-10-24  0:40   ` sashiko-bot
2026-11-05 11:47   ` Luca Ceresoli
2026-11-05 11:47     ` Luca Ceresoli
2026-11-05 13:35     ` Dmitry Baryshkov
2026-11-05 13:35       ` Dmitry Baryshkov
2026-10-24  0:35 ` [PATCH v8 6/9] drm/msm/dp: don't take extra references on multiple plug events Dmitry Baryshkov
2026-10-24  0:35   ` Dmitry Baryshkov
2026-10-24  0:54   ` sashiko-bot
2026-10-24  0:54     ` sashiko-bot
2026-11-12  2:39   ` Yongxing Mou
2026-11-12  2:39     ` Yongxing Mou
2026-10-24  0:35 ` [PATCH v8 7/9] drm/msm/dp: handle the IRQ_HPD events reported by USB-C Dmitry Baryshkov
2026-10-24  0:35   ` Dmitry Baryshkov
2026-10-24  1:02   ` sashiko-bot
2026-10-24  1:02     ` sashiko-bot
2026-11-08  1:15   ` Joonhoe Kim [this message]
2026-11-08 19:17     ` Dmitry Baryshkov
2026-10-24  0:35 ` [PATCH v8 8/9] soc: qcom: pmic-glink-altmode: pass down HPD_IRQ events Dmitry Baryshkov
2026-10-24  0:35   ` Dmitry Baryshkov
2026-10-24  0:40   ` sashiko-bot
2026-11-05 11:47   ` Luca Ceresoli
2026-11-05 11:47     ` Luca Ceresoli
2026-10-24  0:35 ` [PATCH v8 9/9] usb: typec: ucsi: huawei-gaokun: " Dmitry Baryshkov
2026-10-24  0:35   ` Dmitry Baryshkov
2026-10-24  0:40   ` sashiko-bot
2026-11-05 11:47   ` Luca Ceresoli
2026-11-05 11:47     ` Luca Ceresoli
2026-10-24  0:44 ` ✓ CI.KUnit: success for drm: handle IRQ_HPD events correctly (rev9) Patchwork
2026-10-24  1:21 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-24  1:39 ` ✓ i915.CI.BAT: " Patchwork
2026-10-24 10:26 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-10-24 12:29 ` ✓ i915.CI.Full: success " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261108011501.4466-1-26rote@gmail.com \
    --to=26rote@gmail.com \
    --cc=abhinav.kumar@linux.dev \
    --cc=airlied@gmail.com \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jesszhan0024@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lumag@kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=mitltlatltl@gmail.com \
    --cc=robin.clark@oss.qualcomm.com \
    --cc=sean@poorly.run \
    --cc=simona@ffwll.ch \
    --cc=yongxing.mou@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.