From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B550322C6D for ; Wed, 15 Apr 2026 10:32:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776249158; cv=none; b=JrrGuS14PO5W1bpRRIOvVtOXnDVrDHZ7Ar3GiJ01MoRCce/zim/eCdV/D1pqa5RcfSZn5uXlS4jxg9wQ1NWr+pKxzWrwfkICrRi7ziSGPjw4p7CL9VVw4NLtiMvMa9lWFHJnq+xQd7yntRvEo9OPSev1JRAGPNWwzR9w7A4omr8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776249158; c=relaxed/simple; bh=VrbY8IJ8qKrtxYPCAsMomdMj/1nnc7voyF0npuYzbCo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=KUTy2ZSm3ebDiMFOJ1t5Gt0UbwWAMlyRMsih5zieYlSmqRXLRv1eNR2oMnOCkMwcUhgHDTtj/+m/jLkuulMSlbYDOubm2Augt0C5a849Xe0Aq9R/29DhV0BwH7o9HAo9gxku8HFEn8UnO03K0p5Rni3+Txt6D6IATm/T4QpjLsE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=VNSkvZfN; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=UKG9oXTe; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="VNSkvZfN"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="UKG9oXTe" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63F8aWXu3937170 for ; Wed, 15 Apr 2026 10:32:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= p9jj7L8wvKQnNDkm+0wvgGPXEISw7cX3mQx1BrSdKfw=; b=VNSkvZfN5GzDa+ie /29MhpRMW8KOOCoAPd0Bbj640OBWloKVIYprqLzAP+rgAqOxKl9F0TvVtqIzrP4C LEuVsqBRW4b2aHsZcSQx3/Lmnct3hV9qpxMdft/9S7XwooE9MsJr+HsXwSTTMFf+ vXiiJIqkuhOdVrYnE2bdmoxgySsH0qpQIh7eUK19jfKPcb8embP0YY5P7qAEZnRl Xr/yiC2bO48gjfv4zW9oDKQQoFwcBTh16DCODK1qXBNyHtXEJC9Z4rzoqEKvXKv1 4MYpLF6BGIr/1ENkJpypfcod1U8+RDnysSJmH9mBAy5pPU4VmBfWobNdoWXFqyXk YaA16Q== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dhrbf3d8h-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 15 Apr 2026 10:32:36 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-35d9f68d00fso13114234a91.2 for ; Wed, 15 Apr 2026 03:32:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776249156; x=1776853956; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=p9jj7L8wvKQnNDkm+0wvgGPXEISw7cX3mQx1BrSdKfw=; b=UKG9oXTemYH6YdNpMOa1s8GWOiexzFyWlMGOuxYEs3v7K5pEPEzbWh0iClabGADZdh B1cMekLXipr5JhFIMO2QsXcYYnVdmA3M8Fd4poyLm+PCQgf9iiSOBGOfylMtcI3SPleJ aWMEE7vLvyTL9nZJ93assTAzw3JLTa1kUcD+KpeBg1wBEBa4yQfwTiQNFD77mMhJ89JN rFec4HzyfmZbDnrwpjgU1TxHqUqdT3Pi23mA6uCHxuJX9C9sG2WbC2JW6BBnhsmhvgl+ UUUUsDmq2Y2B1znBfeQvwSrBMMo9xa28/PSfE5Q0w4VXi0A5FNNZSPI/uWJdZ1QFmpzL 1QvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776249156; x=1776853956; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=p9jj7L8wvKQnNDkm+0wvgGPXEISw7cX3mQx1BrSdKfw=; b=Ks3MJ8yafM08OwMjDmRj5Y4kOgO2+oZxipaYOUwn4Ju/9JYYowgoRfiaKplcFHWinU PqCgemKNTKKUfU1wE618/r6teOsdRWQwEdQCaOGOUeq6Df4zkY/D3IyqudknHUao6TlP JUSiGs7ibnIII9UZwNNnja4zdBYugyvz2MlumEBv8WYOIozH2jL/NpcMvFPdpwsmjLYM 7gIZDm3gtIT8XReoZb1SZlZCumNgQjQS9oEFxtL+RE79H5wUHD8/lwXEMm9GqluzBVw1 Q7RxhK9FfEKm0nL7Gfw5DieKrUTpN40SuvMbZ/9DQqjH+R0VFvvsx/UMPK8Th7Hd1hZW ONEA== X-Forwarded-Encrypted: i=1; AFNElJ+Eg8y2XEPE0QJTc5xfKuQaH/QBZxJBUAnINmHsNrLEsXxLLxXdn7Iu3m7OeJKomVm+xs/9hT56BdPCPSw=@vger.kernel.org X-Gm-Message-State: AOJu0YxSfHHum5TIB7O+cDpNXxMZrFniDD3J73n6i9r2AmZ9JaO8xETR Dqn4HYHPfDEfIv1qfUxIhDtOZp4i0BwOylQ4gbgCLxsuoj/pVX3MeszWXaaGzkCRrJY3lsBfAqL kPvqV9c8RDdqdm6/fWqyrDqV3+8dBIF7+DiRuoI4ycBuExlGTutI05l8KfMMh6HwMFRg= X-Gm-Gg: AeBDieuwkPaTJPnO8jnPI1E/WLgrp+9yFmZHcg5+ohAPk1BUPdF7jXYIyIM0RaGTuXo mZEkZdBwekuRtcHQtyGdDlwj7ATftjBScHG2viGXI2U/vWjGV19JjbRtYeD3HBelMxNCLX7OYTe KMwLMXE98Fv2yAHKJt6/ueuEkhxcvXrQdJpRnLxlEdSORo8Dn6odUfK699kf9xFiESQbAciCQwJ FOecDLUiJ6IrdGXG2cNfjiqePUhYDx8WdBRFtYgtnVR8CF0BqBBzgIc0cix1cPjEgWrj3oU8RvP yk0N59Glui3DN4VgPw00mkquicuXyBZK0UHUBSW06aDzWwVlQiMEuA+j6NILWFKhA4l1ehR8acr b2xYAsu4QhgjKLmTe/03CLSr0stEvxmJoVOIObHFYRWd/B7kwCDK8zO0IAzSUMbRNoY00d5GNKJ MjbE0mjffpUFupyrtTOziKDafSGSs0 X-Received: by 2002:a05:6a20:7345:b0:39f:ebf7:5ba6 with SMTP id adf61e73a8af0-39febf768e8mr22537035637.25.1776249155847; Wed, 15 Apr 2026 03:32:35 -0700 (PDT) X-Received: by 2002:a05:6a20:7345:b0:39f:ebf7:5ba6 with SMTP id adf61e73a8af0-39febf768e8mr22537004637.25.1776249155405; Wed, 15 Apr 2026 03:32:35 -0700 (PDT) Received: from [10.133.33.152] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c7957efce3asm1399524a12.14.2026.04.15.03.32.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Apr 2026 03:32:35 -0700 (PDT) Message-ID: <4b18f14f-d485-4b9c-a75c-ead6f7c80f95@oss.qualcomm.com> Date: Wed, 15 Apr 2026 18:32:29 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 31/38] drm/msm/dp: add HPD callback for dp MST To: Dmitry Baryshkov Cc: Rob Clark , Dmitry Baryshkov , Abhinav Kumar , Jessica Zhang , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Abhinav Kumar References: <20250825-msm-dp-mst-v3-0-01faacfcdedd@oss.qualcomm.com> <20250825-msm-dp-mst-v3-31-01faacfcdedd@oss.qualcomm.com> <07ff4730-2efd-4e9d-b632-9fbb517179f9@oss.qualcomm.com> Content-Language: en-US From: Yongxing Mou In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: EO-OACaEQueW0xgzYYNkRPM99JTjn2vS X-Authority-Analysis: v=2.4 cv=X8Ji7mTe c=1 sm=1 tr=0 ts=69df6944 cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=COk6AnOGAAAA:8 a=EUspDBNiAAAA:8 a=lshNY4iLFTa4dCOtUIEA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-GUID: EO-OACaEQueW0xgzYYNkRPM99JTjn2vS X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDE1MDA5NiBTYWx0ZWRfX2FpSHl1PPYNR fOCPtBkljfjdJQw019kDiZlMqlt+FoYi5VxKMPGgpGLAO28/G0FZYMoZN9hsz1yu4JBicthDUex IPRD9qRIf1JqHXmiXb7/5XmrU88ZeWBqZ/vPlchW+CoyTZmXWhgs6bE/Nih4AklJmBRIoQRExNE FKFNRDgiEZTsoGZsn+e5th5AqpM/gM079DJD5rqMuQ7Quk29vXZqO9rFTU0WKZ1JQt4oIxcx3oo N+JBolbkwfo6aYKZ846HzKFX5NVEn1Fu2S2KiDyE71AOloX0Ga2n3qoAuKKwBvZ95MystDObbvx weesk5wadSPS+b2rCv5IrrBwskw5ufJ58rwdsQAAlr95GIBR7mRRChi+hPIVENf8TCnFZ1LLyto 89/NEmnKS2ZO3kU2K9VBcbL6VfGYZcEAeKOuYE9aujMBqnVvyCnlxQoUrH82nKojWrvfY1Vp3FH 2xDZYnxfIP5TF7hUmlw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-14_04,2026-04-13_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 spamscore=0 priorityscore=1501 lowpriorityscore=0 bulkscore=0 suspectscore=0 malwarescore=0 impostorscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604150096 On 4/15/2026 2:43 AM, Dmitry Baryshkov wrote: > On Tue, Apr 14, 2026 at 05:51:51PM +0800, Yongxing Mou wrote: >> >> >> On 3/25/2026 3:30 AM, Dmitry Baryshkov wrote: >>> On Tue, Mar 24, 2026 at 09:04:24PM +0800, Yongxing Mou wrote: >>>> >>>> >>>> On 8/27/2025 2:40 AM, Dmitry Baryshkov wrote: >>>>> On Mon, Aug 25, 2025 at 10:16:17PM +0800, Yongxing Mou wrote: >>>>>> From: Abhinav Kumar >>>>>> >>>>>> Add HPD callback for the MST module which shall be invoked from the >>>>>> dp_display's HPD handler to perform MST specific operations in case >>>>>> of HPD. In MST case, route the HPD messages to MST module. >>>>>> >>>>>> Signed-off-by: Abhinav Kumar >>>>>> Signed-off-by: Yongxing Mou >>>>>> --- >>>>>> drivers/gpu/drm/msm/dp/dp_display.c | 15 ++++++++++++--- >>>>>> drivers/gpu/drm/msm/dp/dp_mst_drm.c | 34 ++++++++++++++++++++++++++++++++++ >>>>>> drivers/gpu/drm/msm/dp/dp_mst_drm.h | 2 ++ >>>>>> 3 files changed, 48 insertions(+), 3 deletions(-) >>>>>> >>>>>> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c >>>>>> index abcab3ed43b6da5ef898355cf9b7561cd9fe0404..59720e1ad4b1193e33a4fc6aad0c401eaf9cbec8 100644 >>>>>> --- a/drivers/gpu/drm/msm/dp/dp_display.c >>>>>> +++ b/drivers/gpu/drm/msm/dp/dp_display.c >>>>>> @@ -500,9 +500,16 @@ static int msm_dp_display_handle_irq_hpd(struct msm_dp_display_private *dp) >>>>>> static int msm_dp_display_usbpd_attention_cb(struct device *dev) >>>>>> { >>>>>> - int rc = 0; >>>>>> - u32 sink_request; >>>>>> struct msm_dp_display_private *dp = dev_get_dp_display_private(dev); >>>>>> + struct msm_dp *msm_dp_display = &dp->msm_dp_display; >>>>>> + u32 sink_request; >>>>>> + int rc = 0; >>>>>> + >>>>>> + if (msm_dp_display->mst_active) { >>>>>> + if (msm_dp_aux_is_link_connected(dp->aux) != ISR_DISCONNECTED) >>>>>> + msm_dp_mst_display_hpd_irq(&dp->msm_dp_display); >>>>>> + return 0; >>>>>> + } >>>>>> /* check for any test request issued by sink */ >>>>>> rc = msm_dp_link_process_request(dp->link); >>>>>> @@ -1129,8 +1136,10 @@ static irqreturn_t msm_dp_display_irq_thread(int irq, void *dev_id) >>>>>> if (hpd_isr_status & DP_DP_HPD_UNPLUG_INT_MASK) >>>>>> msm_dp_display_send_hpd_notification(dp, false); >>>>>> - if (hpd_isr_status & DP_DP_IRQ_HPD_INT_MASK) >>>>>> + if (hpd_isr_status & DP_DP_IRQ_HPD_INT_MASK) { >>>>>> msm_dp_display_send_hpd_notification(dp, true); >>>>>> + msm_dp_irq_hpd_handle(dp, 0); >>>>> >>>>> Why is it a part of this patch?? It has nothing to do with MST. >>>>> >>>> Emm ... maybe here we can directly call msm_dp_mst_display_hpd_irq.. >>>> I tried an alternative approach by calling the MST IRQ handler from >>>> msm_dp_bridge_hpd_notify(). I expected that when hpd_isr_status == >>>> DP_DP_IRQ_HPD_INT_MASK, the hpd_link_status read in >>>> msm_dp_bridge_hpd_notify() would be ISR_IRQ_HPD_PULSE_COUNT. That way, we >>>> could handle both SST and MST interrupt paths in msm_dp_irq_hpd_handle(). >>>> However, hpd_link_status only reports ISR_CONNECTED. So I had to move the >>>> MST IRQ handling into the IRQ thread. Do you have any suggestions on this? >>> >>> When are the link status bits updated? Please remember, we need to >>> support all three cases: >>> >>> - Native DP, native DP HPD pin handling >>> - Native DP, DP HPD pin not handled by the controller >>> - DP AltMode, DP HPD pin not used at all >>> >>> In the second and the third cases we will not be getting the IRQs. >>> Instead one of the next bridges (connector, EC, AltMode, etc.) will send >>> the HPD event, which lands in the .hpd_notify() callback. >>> >> I added some logs and did some testing. I think >> msm_dp_aux_is_link_connected() only shows the current HPD state. Since IRQ >> HPD Pulse Count is very short, by the time we read REG_DP_DP_HPD_INT_STATUS >> in the IRQ flow, the HPD state machine has usually already finished pulse >> classification and returned to Connected. > > But the IRQ should be sticky and it should be readable from the status > bits. > Yes... I’m not sure how this is handled on other platforms, but on LeMans can not get IRQ status from msm_dp_aux_is_link_connected(). > Note, in the USB-C AltMode case the HPD machine is not used at all. > >> >> Because of that, the condition hpd_link_status == ISR_IRQ_HPD_PULSE_COUNT >> will usually not be hit. >> >> do you have any suggestion that in how to distinguish between an IRQ event >> and a plug event in .hpd_notify() better? We probably don’t want to >> introduce another state machine. > > Then, I assume, currently there is no way to actually distinguish those. > The easiest way to handle the replug would be to store the current > "connected" status and verify if we are receiving "connected" while > being connected or if it is a disconnected -> connected change. > Emm.. Currently, regardless of whether it is the native DP HPD (on LeMans) or DP over Type‑C Alt Mode(test on Hamoa), a single plug event always results in two or more identical .hpd_notify() callbacks. In other words, after the transition from disconnected → connected is completed, there is still one more .hpd_notify() with connected → connected. So it still can store "connected" to distinguish between an IRQ event and a plug event from .hpd_notify()? This is my current understanding. If this is incorrect, please feel free to correct me. Thanks. As an additional note, msm_dp_hpd_plug_handle runs through its full flow twice for a single plug event. Also, the behavior I described above does not include any MST-specific filtering codes. > For a longer term (and granted that HDMI also has a notion of HPD pulse > events) we might want to extend the DRM HPD API to pass through the "IRQ > pulse" events as is (instead of converting those to > connected-whilec-connected events). > > Let me sketch a draft for that. >