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 C9CF5375ADD for ; Fri, 21 Aug 2026 07:20:52 +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=1787296854; cv=none; b=Eis204J8klsval/x77AoFzhCFzrCvV+Ov3OP04g/btryhM8bRtgtMHIVMeTFNzRhiBsgAnHO0aI+DCx5EFewFJ1YwJova6qQ5cfC0cYcdP8+7Z+uB2LAwTLI1Z8c5T3JpezCeigeQCk2NbCO9UzmvSpjEBXpq6K1A9CoTjVdGBk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787296854; c=relaxed/simple; bh=gzh/jw0JDKpZjYqzizCPf+wC405JLsqQgp+Bb3tg/6M=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=m8YGVaSuecwNA3WxwRe26wRTsuUBG1E+kHgXNaZlb/uM2yhb8KcIKuY4bj1yg/JglWnSLlxURpD55D6pGlKt+/ScYRQUpkG0QCsM6/5a+pVtFQYFvzVZ0clgaT1chs2G6h65Ou0jhJGFXwxgh0WXxe387JQaz+A/UpNv4oD4+/4= 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=cVEICEyT; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Q+sHhtQt; 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="cVEICEyT"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Q+sHhtQt" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67L5Ta9T1042217 for ; Fri, 21 Aug 2026 07:20:51 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= U4hIfsztrJ5/Bunzr0Zeq8RzRG+Rg+6qQ9vg35INQbw=; b=cVEICEyT5E6nAFNG 2Se+uBa/wtqan+H2cfzDMIjfK/vHT20R4YCL7+6CmHUk/xTgmLdIEcbsWA+fZpvj H9hmGhLFwPdMSB6dwQIHtYbPn55bNV4pHFpMcQ79UuXwjor6DwP8UF6ojhZBXS6x nArFj66KhIREoTlJ8PYKiPJrUzRaM3GAHo3AJngR0U7G3unrKjiUaS4lS10BY/8j 1Es2j3Zra1sskBdl5A5+C0Z7nRT+hrpygT29ulNtRlah95iKzEgLM0M3iW06WGlP IaIinyWQUjPApye+jlGeBb28spz6yqZrChTZZN8MsM4IM1lDG5Wj10OTYlVnzNSW r+Ef5w== 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 4g6fue0fvx-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 21 Aug 2026 07:20:51 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-38ecc48b3c2so1152000a91.1 for ; Fri, 21 Aug 2026 00:20:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1787296851; x=1787901651; darn=vger.kernel.org; h=content-transfer-encoding:content-type: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 :content-type; bh=U4hIfsztrJ5/Bunzr0Zeq8RzRG+Rg+6qQ9vg35INQbw=; b=Q+sHhtQtm7bEtonMgx63YUP81P/VpC+tP7/KEQpjeo9SCb0VcS3qHjwDhRUk5zRQW1 vZQ620xb97j+/WoPNrt+y9LEQ59LYtyFx/0CWsI/XtZMrmYab2ORumBW2HXxFLEp4ADR Cv/M7R6hCNc+WONon9o+KurBDwew1C1XtZ9mbAHP5WsJNO9GOhIYcMtdwOySvjBg3YMm pgCNYPO556DZIuszmNJnmR0BqqPgs8aBEsUO5tFCEwRbi1ctYn0F8cl/Brnzbic5eE4P mg6Hdewx+5AorH0FLH19WMVE/gSL8Qr3UmFb6aMoLB2wBPlDrdE7q8R08jz67p1QniAE o8+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787296851; x=1787901651; h=content-transfer-encoding:content-type: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:content-type; bh=U4hIfsztrJ5/Bunzr0Zeq8RzRG+Rg+6qQ9vg35INQbw=; b=KeCrE+yZwMT9Jq06LMMkcRWHqroMQe9hFcQsyCB/RpJblmKxBvgEWXvDMfb6aam1W+ HZa8yD0kUBDn8x49BbEngye7q+SKg3pS0QV4nmcV6lF0YpPE0NbdWiY6uGh47sjbk8lE BVm/hc0xmrAO9w3NhKfhIC/4K9oLHZrPAmE50wbn8EwIscJdUXY6LMygGMKgwv6fNAXx KvuqzUoGx9HpNylEd6VhLCBV9IPd4Eh+G74oQXSvvoZPdOomOv0uLunDXeHA6/RfUrrM jyxwMG6IFPC2xC3jDQOd7anpbRGCal9ZnBFXqxvx4Y6rH/Vu52JRV1h8WIPD+r6r/yQ/ 7Drw== X-Forwarded-Encrypted: i=1; AHgh+Ro7/oMXQFYeEuD+lGxSK4kSRdTPwUvLrU5jqnup0yA1td063IZ7hdxV1uz6rVOfMZNGnrdXBJlQ4AKr9n4=@vger.kernel.org X-Gm-Message-State: AFuF++lqk6R/Uz/drnKwZGQIWg8Iz+mo+yKr6jB3Uk6dMAag55sgyS1Z 2mWBNdO1fV1KHl6femNsV07sOgyQp/PmqwF5rmTx8uuGRtNkh6T802HDs1zyAJLAA4TW0oZ/VtH dBCC5PMCpH39qBoPpIRuU5HNVuVgdJbLHK4iwNph72HFuuObIBZfN9WyYB4z2L4m3bnM= X-Gm-Gg: AR+sD12HNIr9vPrv+lFGA9IJome6NliFSUiArHaDe5Ak/O/jTspEJ11ggBRep70eO6r +pHGH8g91EXna3N42Us0Tl2ypZDD5UlcmiVr2zcz0Kui9fbSXqVgFha21MtCZpLlajYqSZzAPar VqF3ZnZ4wuPJLZj9dwm7K0B+9iIr3oawdest6J9H52LlzmBQn2Qm3/dE0gZOkfg1rkk7DdXq3Q0 hJjakqp/DyTOWYigrMjDuL+Jh1nEvu+ISBY/ZUv+3mLfQlqyxw3CIdK1lsJ0by11PLihcfR5YQW ik5u26Z7TmTkJGbFLxlBkvQGKxIHNthD/aPLNzEtYPDd2AngrSX8he6jiItYK/2W2rH1H/Fmv4y z0Ttvt+nNg36QZZ+PQNzFLUoAf2D4maZkp5P9wtRYEVgyDHMT0iX3keWx19Ye/5xlAe/HRNk= X-Received: by 2002:a17:90b:2ccb:b0:36b:bec8:94c5 with SMTP id 98e67ed59e1d1-395c35ba5aemr8334027a91.10.1787296850328; Fri, 21 Aug 2026 00:20:50 -0700 (PDT) X-Received: by 2002:a17:90b:2ccb:b0:36b:bec8:94c5 with SMTP id 98e67ed59e1d1-395c35ba5aemr8333915a91.10.1787296849773; Fri, 21 Aug 2026 00:20:49 -0700 (PDT) Received: from [10.133.33.40] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-395c46b88e9sm1995751a91.7.2026.08.21.00.20.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Aug 2026 00:20:49 -0700 (PDT) Message-ID: Date: Fri, 21 Aug 2026 15:20:38 +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 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 From: Yongxing Mou In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Info: AW1haW4tMjYwODIxMDA1MSBTYWx0ZWRfX7scXf1odEo6I GzQf4Ykty7gSXTNk4WSSBew132IuOoX178PHOP07qLEBVzIH+qmWWH7PdZzOxLL3URkqwe6rvHo Yet4wkbD0SOA1aLOOONZRrEJWmUCj58= X-Authority-Analysis: v=2.4 cv=U9+iy+ru c=1 sm=1 tr=0 ts=6a87fc53 cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=h0lqEGe5wbmRA1m2260A:9 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 X-Proofpoint-GUID: lCz7VthSSxGTKvY81N7euEKDSnNLpfgn X-Proofpoint-ORIG-GUID: lCz7VthSSxGTKvY81N7euEKDSnNLpfgn X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODIxMDA1MSBTYWx0ZWRfX/6klzXz+4oTh 3dihkqD9stWk25yzHejCKXIFZWdY6acTXp2LCzfnBVq+jXszAXsTB2tjp8EWToP3gBYVNASweN2 r7gE1FalWe3IaFXNyXOacEznDJS4xZr907GdrBwnHAjdB3caPXsRzGTBdJmKw5rpRWJjbWaytvN aYgTrWeHmnShrzLlSn8a0zlrS08UmMW4z3LR5/Komp0IpzxE7TrtrZMbX+uYTV9yIBahuZEPcYv XEgnJ6yLo1VyCwf5Ik9n+MyOcmTLPBj/X/LLujpzULfKybIqT0sTFBxToxHwYH8kBZKpS3CHauk rDHCEn8FUxcKxNQwASnc23iHT9Gsm0zWFqk2jfwV4PMR9iqYjAj1p6TEZoZxnt4r2fgRVSsQREl Er5T76p5BQTePrT/cEXvux61oUSe1YADe3J7YrbtiwhCpDt9suF89xv97oGWMdRqUn4B8lH4ssN n6wFUZ7IIK4RqqdABjQ== 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-21_02,2026-08-20_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 malwarescore=0 phishscore=0 suspectscore=0 spamscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608210051 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. >> 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(-) >>> >> >