From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.181 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795994955; b=DO9u5qVtk6bAFDpE/lgAZkz5lMzDKMn4FUntw2LKoSNatWm3qMI7NDdRIBjAboVip9q3 SufoIXYpe3x1I8XbZoT1hsP/dF921uBS61RlwdXL3geBpL6gYefwg6P6tqX6WbvfhtfTF 40cyoZDfCdFTuxvi4dfU5gN5RG3jHEHpkVFgC539hK8jFcDkoL5P36U/tJGVdpMp6rl+L efquboCnDn1I9Ww3M+odN03FdxwZaR+DfK9k5EcMjyQfYCbvNAT3/VPfm428uj7nCBm6P kslKbupDCQ2X35xdapCVitL3Fw6OUSgl1QMLUAzjpr2X3PNRuyHyCWRYKMxETaAsMiA== 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=mBuMwo/oB5lbubI8ZLoyU8UB6WKI/E6xyYGBmksWkyxFgZAjVqf5fnKYSht4AaX1V04L RWj458mYd02mmNnq6JNw2DCQHf2TPKL9LmC1dCQQe/gsNyF/hOWiV8ToyrqGyK7ubUQFZ exWLdgBdSt4PxtobkVQNZpfyB0eke/8O/OGay6pmBSNxpXLFCfmmY15LkHWqdSvWr/C3F 30J+8hnFAC3JV+at02cXv/wQDi27cghkecx/FeI37JAlF6N4FFcGlVhQ0v+/lqsiIoY5z MMNtCWD5A4A8B7lt+3HeErzknjMXwXYr6N2TlC0IgXezpCQslROpnxNLCy3VNAAzYaw== 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.181 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (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 D2771606A325 for ; Sun, 29 Nov 2026 23:29:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D2771606A325 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-f181.google.com with SMTP id d2e1a72fcca58-8b904d10882so4011159b3a.0 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=AMh7yvcGnG0PgzZJwdPqL6hwtbf76kJi1p/PJLCTBUz2gxmsQ0wVa66x2rvf8tgYpN wkU/tAO1VXy5gXpkOsW+6f9SLA2gD1X4TTZ55R0nfcwYyB5TgOkQbGvQrnTV0U/jp9Vh rEA586ClIHmn897QjWc4LzSecQA0vDEdZ7h4usbWo1CjAwn1VEo9VD9dydFxXfq2fKsz He7p5AVSaPO/kD26SGpGHGjaN8FpbxLSRfkSGnbaxUzLBPlycfCDzlPRf3Ju4nM9e2gZ YTA/neY57Go964exAd+/khEm6B/NbSbGKO7+ekz5giyVD9srNiR5EYiVIjlKoNq8Ixk5 HYfg== X-Forwarded-Encrypted: i=1; AL+hErEDMRKx93mgXUbkihwxKw7R8GrW6q/3jYhG9NrVXvorrbPWE4Am1aJ8KeidZe3+UGJWRQInqoucAZNAUGue@vger.kernel.org X-Gm-Message-State: APuU4Z8NuY0hB5S6YkpFgc7KxM9VakIPj0Xxsv1Luo0lDwrG6uPlOsRv HVcGLgqqkJoJHWmGD3iGYbN62PJ9O9nV2P2WFLghuAFGjS4L5/leKYEJ X-Gm-Gg: AZFdTZcjSpcQrm6RQncWrMm3iPHfBcw40h5qdXrrDjZtbFAsU2GyUgf4ef2FK0uPhr+ Ean3mJKoHPcwHyLUOsKZP6GY1roTv5TByzWcVJA+mOrHVm/30TMUiFUrl9XXgyAMWFKRXq4Da+6 gLEQwtXg1ZeSUXB5M1Fz1diquzcIPBbkNJjN4NsfboxJdeiypqoZQGkVFhZErVNM6R0UpnqnO0n HwGjQ30y3hAswFhSplwScoNVesgUOdz6fgH1ZtdJpP5dUDuR3a7Zvl+Hm8AlnkeHzTT5vMIDt0G Ns0Wkwc0VPWlHroLMNIQq5M3v9BAxXR1aWfD+6kdTW6PBfF0MfhYuuEBoHHlGQ3xfy1UakSxTpG tD5Hi8xZ9A+Iy6A+PBRSu0FrQrQubCUAWnjgX593bWeSFPW8EBHSqQ8hSsysf+waF7Se1kblXGf ZCx2ICNLX/H7Y/aJaDif/CUw/ZyWwMovOk1+euvMpadSVww3axROwW+19IX9e5lelj6/bvYyvjk ksnWNA00YHQHDP4DLI8uPk3LZE9ejHHPQFB4ybzm702lOLwIxkPH+ctGzAZKj/XYiju5mXZIBCm ntfEt/WuS79K+lzI2PMGIr1CiJ0bPfAn6XAk0g== 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-arm-msm@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