From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 AF0AE234973 for ; Mon, 24 Aug 2026 03:15:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787541358; cv=none; b=s5dU4Rtc1QP6DHCMxqOColXe5Xg4l6AHgsNTpT8jWrpDtTXVVBUVmxKEVHb4btwOMbcr2uTXIG2jVb+C7icUygqe2ZLlkldNVOSoeZ2W+TdC6C1m7DDepiy69vxl18NmgcD+2p26JZ6zcN5H+hTtLXiO54OhTi6L7mAf5aQoWps= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787541358; c=relaxed/simple; bh=FqjqJeHhxJ6ktuuiVX+hIMeNZ5g0zJ3mPu+ApxRcU2Y=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=gkH6WVDtQJAg7LeyVI3QfRW8Qb5LgFmdXTr/hOYvVESVhHgr0Bp3YQ5GBsOQuO6xsJtqiaVhxgIo+zvtTqKN1xL/HR+vTwe349cfQ3vMvVk1ONbo+msJaGjiv0ktppLQxiDZc/4vaAKGYdbFukLbFkBFPmEfs2ag4uxWPK22xk4= 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=KzjesmQM; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=d1faT1vT; arc=none smtp.client-ip=205.220.180.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="KzjesmQM"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="d1faT1vT" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67O0ksnn268238 for ; Mon, 24 Aug 2026 03:15:55 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= THK3mU3zM4H3WOn2rcZOYc5FkaAY4hnLNpJ+5JYj0P8=; b=KzjesmQM0w9mb9Xo xDdnGhSl0dQLjqZsS8WJU+uIBeqbOXwW4KZ0WlCfzEcjqQ2TUdE0cQdPqE1OAzko Ms8f5LnYiaJOuBLEvkEUlHahLPqLvgICbL+L4rZXGzBRnMzxXd4uA7ioak4V+v51 DeAYeVhijIksa08Cwi0EAIfSf5RgPj8v4+Eof3YE2HCj25GbVGwPTGc7JhFrLKPH pQsmOQwiH9nNpHOKL+rKyj/5GTGfb+Mem6GT27qF/00Bydg6gqXC02biK9oZ0O8g TryLV0BKgh2QMemgcqO3lnGffib3xEy7lHC6vWX06FThH9aPbIxcoaRK5ZKuHW8f RYmI9w== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g744qw3up-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 24 Aug 2026 03:15:55 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-3950b1371a7so4494360a91.2 for ; Sun, 23 Aug 2026 20:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1787541354; x=1788146154; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=THK3mU3zM4H3WOn2rcZOYc5FkaAY4hnLNpJ+5JYj0P8=; b=d1faT1vTmSFudmQGT8bG20r78FBXW9YdEM52xJzH16k8A6Mf58MahF+FsYYbv7mGml MD2LXbUSZ1EpmxZ0cq+xQuN3oczs5ZcBEEeeXKBA2GFuFvEGQSlQ8lKaD7mAD3mSqkn2 hhodsFfsmTdZRHJCGA1ziXIaL2OsoidDd//0S0/BRdS9944ksnvPf3ejQiG2wnanDrUf hWcGxxbJQiqKEj1jWNEivO1wZ3hdbgChL9q90Fcayo/VQktfpSLQYzYeFcdy31Y4WMY+ rkpZHL3OcmSrkG5KIxRdynfPniaprNu+NQjoqh3VIyFvPR/WSgzNN4reVW4s0ALcezzq Kz7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787541354; x=1788146154; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=THK3mU3zM4H3WOn2rcZOYc5FkaAY4hnLNpJ+5JYj0P8=; b=JASzoVeyV2iWbNH+Qp/gBmfXFtzk9cw5nIdpCvGR6P32CcAI9YUP5SPk/TLecYAyMM V1I8kzGtGC4U1rcZA7w72iHb+NfI16hqlU7iB1BvPQEeA48p+JvxwZ4B659PUE85sC3z dl/GHGfYNBVsi15tnxCz4pcTTpHH/oeG+XTa0Jmm8tEjt3dqxOy+0RNCU193Q4HRnN6e /ZShOdlZaajGtpicFq6pN0SrNSXLERahRkmKtPyVcaIdfUkAeJ34Zx5g4NjZ2DEgMgOc YjGczZ7OXZElhycWu/4WEI+hk+5DnxGkkHlb5R9I1MM7NCL128RsRU9+3kVGNyh09Zh1 5FpA== X-Forwarded-Encrypted: i=1; AHgh+Rr40PkzQz3Y073HPnY8RodqBDZVXk4t0QzdMy4h+8Qa1m/H3pgk+r4uMTzqbBY0jWOqulXWem2ra8DViGs=@vger.kernel.org X-Gm-Message-State: AFuF++mHcKQP0v646JVp8W84SezJNixsfLU64Yx5dSAsORiYW+kDphgB tfxikcA6y2H0Qbd2vAw7zxNnu15bqt470FbVFqtMkMK29omqYvVYaiIinRB4aKBZgL+mKGdCbGi UN2GyAQXX2sdQFrLE/N9kawaJDHHJa9oXiAXLl8eGjOoJ4dhuwZVfNHianQGiA98xMvY= X-Gm-Gg: AR+sD13DDZRmRP1HEeZRBrLpuneZrP8xvbHW52cmnR5s7zw+qCIW/L9Fc3Z/mvDz/6f /77Lgvr1mCzImEJCHwv+LJNwt0VGMiU0lGQIHSnbkEqjPn321GcMmAr3kAapY7tDWKhpNviDaEV 5JKSdit4/a4hKMh2LAWE5JnoVI/Ec3Ezc+zmYlTJFBkPP4I9yE2Skp8udQkFJHvSxKiHgEFo86L UI/Rm03LbexLUM6VK5MWvuO8v3w5GxR9dVn1i3LuNfhSE0dCjnq1e+jed7jsSSYjz0yQZQBBkMd 1CXDF6LJ8TRJtBj3Yt49Gxt8/mxQT+rd+Fyd1D0cRPxUl1B33JqQurMOATIvmo47o+w1dXf9bCF nYjqVmAgF/LkmwyO5SB5y64cX8anDvbRbAPlWrvw3WOmfXMxhPSUozt3d5GP52MqaJWXgn9k= X-Received: by 2002:a17:90b:180d:b0:38e:2524:724f with SMTP id 98e67ed59e1d1-395c3733e65mr40833586a91.12.1787541354197; Sun, 23 Aug 2026 20:15:54 -0700 (PDT) X-Received: by 2002:a17:90b:180d:b0:38e:2524:724f with SMTP id 98e67ed59e1d1-395c3733e65mr40833494a91.12.1787541353641; Sun, 23 Aug 2026 20:15:53 -0700 (PDT) Received: from [10.133.33.35] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-395e4b2b9c9sm8056616a91.15.2026.08.23.20.15.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 23 Aug 2026 20:15:53 -0700 (PDT) Message-ID: Date: Mon, 24 Aug 2026 11:15:44 +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 1/5] drm/bridge: allow hpd_notify() to suppress connector hotplug events From: Yongxing Mou To: Dmitry Baryshkov 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@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org References: <20260629-msm-dp-msttypec-v1-0-646a10256233@oss.qualcomm.com> <20260629-msm-dp-msttypec-v1-1-646a10256233@oss.qualcomm.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: ZEgaoa5Tf6i8O2VIrTlZoSE71IHkVfwo X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODI0MDAyNyBTYWx0ZWRfX9OXuhjpvf2AF zSYzOqp+RhCfd7HwzXShWuR+TFyOl/fCRARa6piSDalqOPVaLPubCxo1lerOOyGUcy07SHPgB6/ /jKW0UXWdrlrqVo3Yn/8pZA5leDD8IOi4lFbVy1akNHimQFTvQPxnykeDCKYjz/Ko54vp+BKDD/ xzkU+feCVCWHYLgiFgDgucOgdK8sf6vU4TKBFVrMoKU8g8cLAjVSN9oDn/3C+YK2tsmY/GtXJyK xarqff7En1ZHj1OZ22wN10+xOSADQQZiBg0rCpxindBOymsJE4kTKp+JMTrFUBAJsLPCrw40QOU 7nRmhplI/yYXwlsP4rh2sSCInWlc0MCQY1qXdIKpTdr+FAp57yTZwxGeFuvFe7Xwkvn0znv6wl0 GQBBQP5w0IRbT0VOK5VfV1F0IycaZdgTwfLDZSVd0CBprb/Tju4s5Nxq4/3yR3Cd2FrpxiVxyNc A00ed3TAh0aJdRVHiLQ== X-Proofpoint-GUID: ZEgaoa5Tf6i8O2VIrTlZoSE71IHkVfwo X-Proofpoint-Spam-Info: AW1haW4tMjYwODI0MDAyNyBTYWx0ZWRfX2dmMXaTXfSyN JyYdqZ/ZrIkRaoj7a3VYlpJAiCsMbBowt2l1P1H+sloTeSlglt06qXXTROqg2P4bbGwQo17t3/M HBzwRsRDsSmZuGg/ivFOxh8hQvoOcCs= X-Authority-Analysis: v=2.4 cv=BNuDalQG c=1 sm=1 tr=0 ts=6a8bb76b cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=qQJ8N8Yg66gReXqHpcoA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-24_01,2026-08-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 phishscore=0 adultscore=0 malwarescore=0 clxscore=1015 bulkscore=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608240027 On 8/21/2026 3:20 PM, Yongxing Mou wrote: > > > On 8/18/2026 11:01 AM, Dmitry Baryshkov wrote: >> On Mon, Aug 17, 2026 at 04:01:41PM +0800, Yongxing Mou wrote: >>> >>> >>> On 7/12/2026 6:21 PM, Dmitry Baryshkov wrote: >>>> 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. >>>> >>> Hi, thanks for reviwing those patches. >>> Let me try to explain the motivation. >>> >>> Semantically, IRQ_HPD is just an IRQ notification, not a connection >>> state >>> transition, and shouldn't be turned into a userspace hotplug in the >>> first >>> place. However, drm_bridge_connector_handle_hpd() currently calls >>> drm_kms_helper_connector_hotplug_event() unconditionally after >>> processing >>> the event, so every IRQ_HPD ends up reported as a hotplug. >> >> What if the IRQ_HPD is delivered together with the first HPD event (for >> example because of the TCPM processing those events)? See the mechanism >> in the displayport.c AltMode driver. >> > The DRM API should simply pass both long HPD IRQs and short HPD IRQs to > the driver as they are, and let the driver decide how to handle them. > Based on my review of the implementations from all three vendors, when > long and short HPD IRQs occur simultaneously, the long HPD IRQ is always > handled first, followed by the short HPD IRQ. > > I have another thought regarding the current DRM API. Could we have the > DRM layer pass only the HPD event information (long IRQ and/or short > IRQ) instead of connector status, and leave all handling decisions to > the driver? The DRM core would simply report LONG_HPD | SHORT_HPD, and > each driver could decide how to process the event. This seems like a > pattern that could be shared across different drivers. > > This is just my current understanding. Please let me know if I've missed > anything or got something wrong. Thanks. Sorry, after thinking about it again, this idea is not fundamentally different from your current approach. In the end, we still need to handle HPD state transitions in the driver. It seems my previous suggestion does not really simplify the problem, so I apologize if it has caused any confusion or misled the discussion. >>> Second, MST IRQ_HPD is level-sticky -- as long as the ACK has not been >>> cleared, the IRQ keeps firing repeatedly, and MST bring-up (link >>> training >>> / MST enable handshake) itself generates a burst of IRQ_HPDs. So this is >>> not about "one extra hotplug", but about a burst of them within a short >>> window. >> >> Ok, if it is level-sticky, it should be handled as such. >> >>> >>> Every one of those hotplugs is delivered to userspace via udev and >>> prompts the compositor to re-probe the connector. In the window before >>> mst_active is set, that re-probe walks back into msm_dp_bridge_detect() >>> and performs aux/DPCD accesses, racing with the MST enable flow. >> >> If there is a race, the path needs to have a lock, preventing concurrent >> access. Otherwise, you are just shortening the window instead of solving >> the problem. >> >>> >>> The amplification also isn't limited to a single connector: on Hamoa >>> there are 4 connectors (3x DP + eDP), and we observe that a hotplug on >>> any one connector causes the compositor to re-query all 4. So this burst >> >> Please fix the compositor, it should not need to query all 4 connectors >> if the HPD event came from the single one. >> >>> of spurious IRQ_HPDs during MST enable ends up amplified across the >>> whole card. >> >> How do i915, amdgpu and nouveau respond to IRQ_HPD? When do they send >> the HPD event to the userspace? >> > The driver revalidates the actual connector state, and a hotplug event > is triggered only when an actual connector state change or a link status > change is detected. >>>>> 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... >>>> >>> You are right, I will reorganize the patches in next patchset. >>>>> >>>>> Signed-off-by: Yongxing Mou >>>>> --- >>>>>    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(-) >>>> >>> >> >