From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.180.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796186916; b=cXjX7eEk8gpcJQIlt9LNQQH45oVUUjqqMtzPasQRpLkrb7M7S6zNowvOdv73dHPt2rax RZu8k5P4wC7hFoBbEFtoRDtVXJ0DBKygyRijK2j5ffHjTCeoHyY6DoYnPAzVz12z0JiLe DzBoWSa4zYEevYMPDs1M9Ou7K6SQeH1Q5CGb9tZ8entKhrlHPBrCHWt/C5+ChQyMqVD2w x2kBDaPwt2sPM175ekFa47WHni7W0wSmEGm0pmlyuUUeKFQYL9fCApnSAYy713gFk5g35 KQZCNlPiy2eodWj6YtJnJcL7zcHnvCsenCUj0Qw979SkDEDU0i3QNlYHAS81j9Zbe9w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796186916; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:From:To:Cc: Subject:Date:Message-Id:X-Mailer:MIME-Version: Content-Transfer-Encoding:X-Proofpoint-GUID:X-Proofpoint-ORIG-GUID: X-Authority-Analysis:X-Proofpoint-Spam-Details-Enc: X-Proofpoint-Spam-Info:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=Rl5eRP3/gRvH8RCBy97f6M7gBdgqlqLO1nITyMjzD/E=; b=vvTLYGSmBJpW3zUEC7Y24LckX/dHmh3Yam3EkkhEiu6xskRacrJrEzqTAj6bX+326MRq 4i9kOviwoQGJcgyT09bWqM+irg/GEA6bBAdIz5FICZdFjGGKaRNuUQ0GNqt3zkVptD9Wj +A/na5g1Ifndqzw+M9rQqG/PiGSBemCWxf2QedAfHFTNj3Fu/O2gljEliJce2Pm9xnatX rNnvdK8GOixPzV/6WxaHLXAKvDgPKCtas9wXo0JZlkRgux1YBWe0n/K+waDWGpouCd6CL gc07SEpvi4XtmVw1aWo9a3g9CmhluajcqGXrZdpAnB85OfOhukN18BvdRC+oELwFbyg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=AwyKZ9qr; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=Mmv+4tTN; arc=none smtp.remote-ip=205.220.180.131 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4BFF606A31A for ; Wed, 2 Dec 2026 04:48:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D4BFF606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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.a=rsa-sha256 header.s=qcppdkim1 header.b=AwyKZ9qr; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=Mmv+4tTN 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 6B22uHVF3158808 for ; Wed, 2 Dec 2026 04:48:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=qcppdkim1; bh=Rl5eRP3/gRvH8RCBy97f6M7gBdgqlqLO1nI TyMjzD/E=; b=AwyKZ9qr6QOClqbHoeDvI8T4tLmpSCamTLx8g22TKqHXM8RIaFS 2pbpnqBBKRNoQsaNHaSh1b7x8ADM3VgIYjvbP5MNjNuj0ZEp51Gk+u1PegtScVxF 93hLpI25foRt2pP8PCm7StEuImkcB3xEg+xEpYdKISCOjpt5T9kSbk60tnMkKf+n ZeFBOJNcFdgerLxajkkrgYRHfDGesL5HuY1BwXUsiPyMrTV/iQVUFLwOjHElauLb Kkqmz/v9tELucdfAuxcqQ4RUpFbGtoMIyxLd+o9MRW9DUeFoQQ6A+yvDW7BqjTxk uTZUvFzApAVsocagwxGxbuEDC4WoDBVfbbg== Received: from mail-dy1-f199.google.com (mail-dy1-f199.google.com [74.125.82.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ja4k19rcd-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 02 Dec 2026 04:48:34 +0000 (GMT) Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-33c35f5ca6cso14717043eec.1 for ; Tue, 01 Dec 2026 20:48:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796186914; x=1796791714; 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=Rl5eRP3/gRvH8RCBy97f6M7gBdgqlqLO1nITyMjzD/E=; b=Mmv+4tTNQu3yWYsAv5w9JM/kSggXyYw3cmVt/PNRzwx68VS1KDIyIoGukdTovh06wf X93HgS3GdjFhZTES/pFVBpeLRP3WbJYY2A7JHkW5Ftww93qXhUDcn+QKMTAjGcFneo6J ES5n709iWbyD3VU0EI0thVzuWJxOfMWOhxsF3hzbwKca5GgZ6xF4TUG1A8mcPVcPZtfV SyxUivCb+RN22u2Y9xoxdl9EoJbxbqajBbZcWZ0fToSJKNvePcVldNggIJQzT4HZzG+J v7PjP2zfFs2EARg2vV0MTn0MzDsaHDHjbKO5nw7GzJsNuZrtVDqhZPK8J8xPTSxhRL6C xw1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796186914; x=1796791714; 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=Rl5eRP3/gRvH8RCBy97f6M7gBdgqlqLO1nITyMjzD/E=; b=V1tvLt0jzxB4ZyddXXUNA0RsloLJuaH4qVT3s4Rh4Ro27t9fPPVnClsf63DYRwHaGH F3H76Bxj9UwWA2sJ7so1narN2PbhmTWU3p7V5jCRVkhRlPKtr22C0qPp0u2V2hEtJRgc YWyVakEFviAUmcu3sLDwYyJBmIEAdRZljZlusFnODXRGL+EjpISVICqjoitQEJ4d6OqD o8XoxH8dLpRE6oMN3FN3wKTitr15vhjrhIveVgTHzHZGNbixdBK+sBqo0xzkY8PTaTDd JyYp2hvkZqc87I8wL6DoimVcQhVDDMD90BKwC7Q+YugdNDZZrNx2luPraWPUsll3hPlq duQg== X-Forwarded-Encrypted: i=1; AL+hErHpDqNN2vcpSvxpqBDNHITPwSwHiPAB8T1lrVXpvhbljetjiZREac5ytlU66iAWB1aUjIQuLpiCzb08vrs=@vger.kernel.org X-Gm-Message-State: APuU4Z/CsKYdvfL1ftciGzpG8y+FKRMA5vKgCb4rIcmWhNvgbn6+vVnB 0nk7lrQzvopMEuSx0vHJV/Mhu3TxwQoNDRAYBM1MmQKGnraA68XkSDFcTKFLDEnXg6frx+qNCRp eLMHvfffiesl26JCf61q2ze2MX8s3L4L4z5nPKMhskOrnPkPsiysEFN37wCfpWcrTOxo= X-Gm-Gg: AZFdTZcAW4JlJG6O2H+LeBrf3dZ0eRQvsEx1ShUqDOKbyM3qbPF6jlSJTRDRo54ns1R ZDL15izUJyFc8cFQrWH+V6m4jSVZIUuvcob9ppxg0+A6irFdL6d3d+Vbp/z3TS+vFfDeqMNIrhC dFHrL6if5Qw21Z+0IDHQiI6mk+8k7LCg28Ho/Ng47BKBg6cS2wA2tSOmzOWaharJpwqhmJdSnNS d9/IVvul+3P6pxiwaT0QZUrC8biSDg/t66OSyu5qmeYfYU9VJIbeMutDnYrhUqMwRrlDJw9S6/f fXGF+ZzQKnWZPSkvpThJ8Rt+apBeMci1L7H54x5iLyOyranPXNKzfYgeZGYJeTIOaELyUOc+Im/ 6A349pmWujjVhD2SkjdACPTe2FyQCGgdqNkA/rJuMFkx3Stw4Hxn+AwuFnI0AnMAFkDo56ZWtYp XmHWIXF4eWIYgyQK2BCIJE2nLXpLY= X-Received: by 2002:a05:7301:182d:b0:386:b801:cd06 with SMTP id 5a478bee46e88-386b801cd3bmr26770074eec.40.1796186913649; Tue, 01 Dec 2026 20:48:33 -0800 (PST) X-Received: by 2002:a05:7301:182d:b0:386:b801:cd06 with SMTP id 5a478bee46e88-386b801cd3bmr26770037eec.40.1796186913021; Tue, 01 Dec 2026 20:48:33 -0800 (PST) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-38566cd40c5sm140598726eec.10.2026.12.01.20.48.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 20:48:32 -0800 (PST) From: Elson Serrao To: vkoul@kernel.org, neil.armstrong@linaro.org, mani@kernel.org, abelvesa@kernel.org, konrad.dybcio@oss.qualcomm.com, dmitry.baryshkov@oss.qualcomm.com Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH] phy: qcom: qmp-combo: Fix AON toggle register presence check Date: Tue, 1 Dec 2026 20:48:31 -0800 Message-Id: <20261202044831.3528405-1-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 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 X-Proofpoint-GUID: 782zHm1mwwIu0TXcI_vEYA3zONdwJa23 X-Proofpoint-ORIG-GUID: 782zHm1mwwIu0TXcI_vEYA3zONdwJa23 X-Authority-Analysis: v=2.4 cv=F5DC5ahN c=1 sm=1 tr=0 ts=6b0fa322 cx=c_pps a=cFYjgdjTJScbgFmBucgdfQ==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=en5Wsr_ZPYP0Fusxmy4A:9 a=scEy_gLbYbu1JhEsrz4S:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAyMDAxOCBTYWx0ZWRfX66+eBmPV9x5j 1dsxXQc8Vso/EigrzI5g2NZUrl7Sz2Z+6+z9ap6+OonuTWPe62Ji9mh83z2UL4Qw7Bw/Qg32UYY HShEUP6xhJZgA9tx/mbEUupqhXhnlQMyYcc/bEmgrMwOM9wV3koQ73X76QXaRaBA7GPFCJ3rd0o q8XR+I0S5IX0z8Tf/QZdAXFdowaVGNGFzxPmjFKIDgZJA5rUrM0ZTdNyGEuJ/OomvYoLw831D97 aC4GLbyYkirdJ09cv2W55NciRsm5X99LIDxxsE8ec12+Xvx5hf+AJ5B4OGFWgIZA4tHADMONw7O 7FjflAvAW+a32oBMO4U3wm+ltRL3e6EP/io55PNi7FCJJFcOvW5/gvTG731FIv8aZP4qp9qncxg diwZtGSJ8g7wwX58+jJHuunqEO/e2IHheAZ73uo/g0jijWUhuk4aQKcSKZuQCFJsYWx45h0mo7N oY09rLZpUC8vrODb7ZQ== X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAyMDAxOCBTYWx0ZWRfX1zBI8GpD2rcI cxUhI9///ZSIYTJvk0QtULZVWvotz+tgitJHwY6Xbs6MCGHM7HblYgSb5KHBsbyxJyPLXuDoxvl FunF6pp+6hoLG8k9gbfxJ4z1CTJpbw0= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-02_01,2026-12-01_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 priorityscore=1501 adultscore=0 clxscore=1015 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612020018 The driver decides whether to clear the AON toggle enable bits by using the USB AON toggle enable register offset as a presence indicator. On V10 PHYs, that register resides at offset 0x00 in the COM AON register space, causing the check to evaluate false. As a result, the AON toggle bits are never cleared. Add a dedicated flag to indicate the presence of AON toggle registers and use it to guard the corresponding register accesses. Also rename the aon_toggle mapping and offsets to com_aon, as they represent the COM AON register space rather than a single toggle register. Fixes: eca0e717aab1 ("phy: qualcomm: qmp-combo: Add support for Hawi SoC") Cc: stable@vger.kernel.org Signed-off-by: Elson Serrao --- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 27 +++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c index 3acf28c7d7b2..35fcf8681c62 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c @@ -2513,7 +2513,7 @@ struct qmp_combo_offsets { u16 dp_txa; u16 dp_txb; u16 dp_dp_phy; - u16 aon_toggle; + u16 com_aon; u16 usb4_serdes; u16 usb4_pcs; }; @@ -2592,6 +2592,7 @@ struct qmp_phy_cfg { unsigned int pcs_usb_offset; bool invert_cc_polarity; + bool has_aon_toggle; }; struct qmp_combo { @@ -2600,7 +2601,7 @@ struct qmp_combo { const struct qmp_phy_cfg *cfg; void __iomem *com; - void __iomem *aon_toggle; + void __iomem *com_aon; void __iomem *serdes; void __iomem *tx; @@ -2749,7 +2750,7 @@ static const struct qmp_combo_offsets qmp_combo_offsets_v8 = { static const struct qmp_combo_offsets qmp_combo_offsets_v10 = { .com = 0x0000, - .aon_toggle = 0x0400, + .com_aon = 0x0400, .txa = 0x1400, .rxa = 0x1600, .txb = 0x1800, @@ -3065,6 +3066,7 @@ static const struct qmp_phy_cfg hawi_usb3dpphy_cfg = { .pcs_usb_tbl_num = ARRAY_SIZE(hawi_usb3_pcs_usb_tbl), .regs = qmp_v10_usb3phy_regs_layout, + .has_aon_toggle = true, .reset_list = msm8996_usb3phy_reset_l, .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), .vreg_list = qmp_phy_vreg_l, @@ -3428,6 +3430,7 @@ static const struct qmp_phy_cfg glymur_usb3dpphy_cfg = { .configure_dp_phy = qmp_v8_configure_dp_phy, .regs = qmp_v8_n3_usb43dpphy_regs_layout, + .has_aon_toggle = true, .reset_list = msm8996_usb3phy_reset_l, .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), .vreg_list = qmp_phy_vreg_refgen, @@ -4095,17 +4098,17 @@ static int qmp_combo_com_init(struct qmp_combo *qmp, bool force) void __iomem *pcs_aon = qmp->pcs_aon; void __iomem *pcs = qmp->pcs; void __iomem *com = qmp->com; - void __iomem *aon_toggle; + void __iomem *aon_base; int ret; u32 val; if (!force && qmp->init_count++) return 0; - if (qmp->aon_toggle) - aon_toggle = qmp->aon_toggle; + if (qmp->com_aon) + aon_base = qmp->com_aon; else - aon_toggle = qmp->pcs_aon; + aon_base = qmp->pcs_aon; if (qmp->qmpphy_mode == QMPPHY_MODE_USB4) { pcs = qmp->usb4_pcs; @@ -4155,9 +4158,9 @@ static int qmp_combo_com_init(struct qmp_combo *qmp, bool force) SW_USB4PHY_RESET_MUX | SW_USB4PHY_RESET); /* override hardware control for reset of qmp phy */ - if (aon_toggle && cfg->regs[QPHY_AON_TOGGLE_ENABLE]) { - qphy_clrbits(aon_toggle, cfg->regs[QPHY_AON_TOGGLE_ENABLE], 0x1); - qphy_clrbits(aon_toggle, cfg->regs[QPHY_DP_AON_TOGGLE_ENABLE], 0x1); + if (aon_base && cfg->has_aon_toggle) { + qphy_clrbits(aon_base, cfg->regs[QPHY_AON_TOGGLE_ENABLE], 0x1); + qphy_clrbits(aon_base, cfg->regs[QPHY_DP_AON_TOGGLE_ENABLE], 0x1); } /* Use software based port select and switch on typec orientation */ @@ -5386,8 +5389,8 @@ static int qmp_combo_parse_dt(struct qmp_combo *qmp) } qmp->dp_dp_phy = base + offs->dp_dp_phy; - if (offs->aon_toggle) - qmp->aon_toggle = base + offs->aon_toggle; + if (offs->com_aon) + qmp->com_aon = base + offs->com_aon; qmp->usb4_serdes = base + offs->usb4_serdes; qmp->usb4_pcs = base + offs->usb4_pcs; -- 2.34.1