From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.169 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795994955; b=Lf3FbPVbgbu6rd+1fAxPqHa/szZy6eajw6w93Gf/0YFNmBuh+utBmJfs8IqHg13jsbRy /YXFsSpWVYshFIXzv1F4u+2WU5SKpi4WNwAilp6P+1ZFgAJ52ASQHyeGVxfkSepmlz61W TpAC2o2CjgrvYCM27PCQ7uKD82TUs7pJ/kPnL+fZRCbXmRdpVmePRZnnSGDh1yIZBSd/a gy4toMET8N5k40/14UTX7I+zYXF7wmAUCFzCINB7XNJgFA3Jfyf5AijAYFzL0SGrGgPlP 0hoDzyzn4oUeuwVsZQQoNPhR1J5kUh0SYDIvKCJ9ttvo2ZNGIqHiX77GW3WOL4uGSGg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795994955; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=l7AXjcLpfmoTzSYGY+LQzu+xmRMNIKFcMVkFyrsCvj0=; b=SupIv38comIQSEWHgB6KRZKUqNU/Yj7ydIdkuxT4hIdKnsRM9zCvD0NCtAY4oLaFwkCi 4/F1MUa3tV0rxFmCP/mB+Lwy/mANk6nJ2ng1nl26jOMzv8MvWEKaVtdnEpM6rgcmvC8VU +U194DVY8qtPz0VoyOcAABje6EZnAaUSzGi0IQcmEoX1eHWvqy0HtR8+64bZLVPn+5UTC g8Zg4R3PVBECsb59X8R7o5KtPzM1TaB2GjYHqAgzKteDh/A9K2vjSrEgOMIRthHSKU86r 1JwvWu4TrRk4R2H2qdGhLTTbF+AS2+jxVK80fQlc4VOUbzdmNWBzBWQah5q1gArNFfw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=TyAz0Fko; arc=none smtp.remote-ip=209.85.210.169 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7727606A31C for ; Sun, 29 Nov 2026 23:29:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B7727606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=TyAz0Fko Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-8b5c3288e6cso3837044b3a.3 for ; Sun, 29 Nov 2026 15:29:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1795994954; x=1796599754; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=l7AXjcLpfmoTzSYGY+LQzu+xmRMNIKFcMVkFyrsCvj0=; b=TyAz0FkoWtbmjsmSn+ct5QN3XW0Asnz9iL7aFylDcySsDbtTtvS/Nk+vUzAFpeOQIW 84GhAuSD2bB3ZmO2Fq3FL7zIKms+4gSuiBKjEpbA4Cvm+BvSZzePVe/PtnVBPFcUKA9O VNRrFZ/80LpiSP6fRb6rk2tCJFPWxH4gPXxUcE5nd18RT5EXdySie/YsLU83F4t7C4De Oa+vwASPqMFDD4+alGsxFlpFMh1IJYg9A3FaLfKAJyYGqE8ozO18/5hxnnkIbjKhMJWO DCe7AnG2lPZWk8vEeF9I4/Wry5AgBlTuv59EwO97G3/XAhbyfin3K/NAq/jDEaffH/8l 8xkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795994954; x=1796599754; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=l7AXjcLpfmoTzSYGY+LQzu+xmRMNIKFcMVkFyrsCvj0=; b=M3x1evyNMWeEf1K1U/N3xMd4HS+8Bq4TZ9LyvkM6r02YpKn+AH3MRLrP36bX1IFHaR 3LM+akYx4k68oeqARP/sSAbYcfzix5JN0mn62Tw0LvgUiNAIlfA4aCXSuYCv9EtztVv3 YBkzOd/tkrISXdV3BqlCTx0V5ew5SAlQMftcY32VCD4rcxmrYWp6ZkTWDObTjUgk2JDS 9fm18oGzcc9Nnqfx7GiWf1Q6FkLiRhWRP4QOsMkVjZKzVOICUuQGnkaD6IUYpQJhfb4t aKe3tJlnNRsMH5wEU6g8vuRg3UAP0NOW9eYM3oX9UGdRBcWMzb8Vp5j7w6nak4xsfupa QiIg== X-Forwarded-Encrypted: i=1; AL+hErHwIVaw+LizF5gqpj8rupdP4miKxz1+ivnMEJ3sMEUNVS7PWtghHQRxG4LIuuBaXHEEBeS4+60MkC+vwuc=@vger.kernel.org X-Gm-Message-State: APuU4Z/nYI2k+8dLYd2R2AxLt5zFOphDiOq4AUzwId+VraKUzXP+d48U fipdgrfrHafpPP0qH/kjKMBt6OOAbq/kUUrjMdejigZ45SdycGQCW88cP8bNl5W0 X-Gm-Gg: AZFdTZdqF6HhJTEKhee1krtFTu4b5OB0kCwchHV7oFAy/s//6xxrReA4eit8HrBMOu+ jhXD8JQ8r/sHK/XNwijGQ45V6WVa7RCR5nHLeJ5UBdQ21uqQFZnHqEQSg/xT/GBi95NXZsMsQ7e DaExy5Qpv4PfxiQgSU5031jox09cRlEwZF7iM6x1Ks5erMJMtXJK3onDIeEMPijreuI4Fba1Dy1 hoy1bDnk8VZcuESA4WtrJZ4gPZX3hYyOzG8O2DlSQzprsEx19l5oG5pkk680eLgx7XskGD5Jene hUZPhySoGZM+IdoObhDdsQDJt5jM0bOkn2fVB12SGwTrMjmiIYrzozALqoKjhvCcotECfbEpmDB Im1ha3cDgnfCYiy6lTMW8XHw8o61oFAW60BHEMa2DHd05WyZMX8eEmws99w3Ich4P8CH56asQgz JkpqhNIz4t7HTtn+q9rYZjLXspSwT7vjDZxOV6rIc2GGwwoLEKMbaAbHMvMG7CDBmEgTRk7z81P O/ocU17dZQEk8Yv72h92p+YheH6/MAnntUxEjfXtzHz19a4ixFWYnrTGoxw2JiqtqZG/qBE4vfe ta7dV3KLPz1J1D7w86mhMY1Z5MfDEVGwaojukg== X-Received: by 2002:a05:6a00:94d8:b0:8a3:7425:9095 with SMTP id d2e1a72fcca58-8c8794b8c2bmr30249184b3a.7.1795994954117; Sun, 29 Nov 2026 15:29:14 -0800 (PST) Received: from DESKTOP-NM9EKIA ([2001:e60:8508:45d6:1d71:59c3:f3cb:3c30]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8cdfd2d2fc4sm10750924b3a.49.2026.11.29.15.29.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 15:29:13 -0800 (PST) From: Joonhoe Kim <26rote@gmail.com> To: andersson@kernel.org, konradybcio@kernel.org Cc: abelvesa@kernel.org, johan@kernel.org, lumag@kernel.org, yongxing.mou@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] soc: qcom: pmic_glink_altmode: Report HPD low when leaving DP alt mode Date: Mon, 30 Nov 2026 08:29:15 +0900 Message-ID: <20261129232915.468-1-26rote@gmail.com> X-Mailer: git-send-email 2.55.0.windows.5 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Since commit 5090ac9191a1 ("soc: qcom: pmic_glink_altmode: fix spurious DP hotplug events"), the HPD state is passed to the DP bridge only for notifications with the DisplayPort SVID, so an unplug is reported only if the firmware sends a DisplayPort notification with HPD low. When a DP sink is unplugged during suspend-to-idle, the firmware on the Lenovo Y700 Gen 5 (TB323FU, Kaanapali) sends only a notification with the USB SVID and the mux disconnected. Neither the bridge nor the DP driver is told that the sink is gone, so the connector stays connected and a later detect tries to read the DPCD of the missing sink over AUX. With the replay of the last HPD state on HPD enable proposed in [1], that happens again on every resume. Report HPD low once when a notification moves the port out of DisplayPort mode after HPD was reported high. Such a notification already switches the mux away from DisplayPort, so the HPD state now follows the mux. Ports that never reported HPD high still get no hotplug events. Fixes: 5090ac9191a1 ("soc: qcom: pmic_glink_altmode: fix spurious DP hotplug events") Link: https://lore.kernel.org/all/20260803-drm-usbdp-preboot-v1-1-2539b362be00@oss.qualcomm.com/ [1] Signed-off-by: Joonhoe Kim <26rote@gmail.com> --- Tested on a Lenovo Y700 Gen 5 (TB323FU, Kaanapali), with this change on a v7.3-based tree that replays the last HPD state directly from .hpd_enable: after a USB-C DP monitor was unplugged during s2idle, the resume of the following suspend spent 6 ms in dpm_complete instead of 33 s. This conflicts in context with "soc: qcom: pmic-glink-altmode: pass down HPD_IRQ events" from Dmitry's hpd-irq-events series [2], which replaces the drm_aux_hpd_bridge_notify() call in the DP branch. The added lines are the same on either base; I can rebase if that lands first. [2] https://lore.kernel.org/all/20261024-hpd-irq-events-v8-8-6ee949e7a384@oss.qualcomm.com/ drivers/soc/qcom/pmic_glink_altmode.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/soc/qcom/pmic_glink_altmode.c b/drivers/soc/qcom/pmic_glink_altmode.c index 9e8e103ef859..efcc722b50ed 100644 --- a/drivers/soc/qcom/pmic_glink_altmode.c +++ b/drivers/soc/qcom/pmic_glink_altmode.c @@ -121,6 +121,7 @@ struct pmic_glink_altmode_port { u8 hpd_state; u8 hpd_irq; u8 mux_ctrl; + bool hpd_connected; }; #define work_to_altmode(w) container_of((w), struct pmic_glink_altmode, enable_work) @@ -375,6 +376,7 @@ static void pmic_glink_altmode_worker(struct work_struct *work) conn_status = connector_status_disconnected; drm_aux_hpd_bridge_notify(&alt_port->bridge->dev, conn_status); + alt_port->hpd_connected = conn_status == connector_status_connected; } 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); @@ -390,6 +392,12 @@ static void pmic_glink_altmode_worker(struct work_struct *work) pmic_glink_altmode_safe(altmode, alt_port); } + if (alt_port->svid != USB_TYPEC_DP_SID && alt_port->hpd_connected) { + drm_aux_hpd_bridge_notify(&alt_port->bridge->dev, + connector_status_disconnected); + alt_port->hpd_connected = false; + } + pmic_glink_altmode_request(altmode, ALTMODE_PAN_ACK, alt_port->index); } -- 2.53.0