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 E71EC418373 for ; Mon, 10 Aug 2026 15:42:22 +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=1786376545; cv=none; b=uL2PWXnUsC0j4slV8zyBZgoPOfRcjHpCqcFjPtIfedX6HUb8o17uddc2bXlM8ehA2Zt28QJ+xvJa2XvA4U7PLjQfTG6RpN7t6ovlS4DTyZBI4lTcdLxXgFAkBbp+m2pg0LFX2z+GTnh37qf4HWIURanxB9gQZVT3f63KFBiHIi8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786376545; c=relaxed/simple; bh=TkrMMSM5qDrBbFDzv/+VaChi5RjS9zkmjtBE4vr35Do=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SZ1WVnlcVbOgkRK8cHuhipP/V9peTWrhMW/ulQAiO+5tAPbtJoACXZSOW1KmqGksvjiuiDJ/waaugVRZRpyqelDyLnr/2hg/c0/brDQHa3as3Q00gS6iWLXa/lkowlSgvhBYhZLX7iMteU9kN+qJ+VntupjkflPQyEomPjYvFCw= 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=AeS01/Ct; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=OIpjQuXD; 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="AeS01/Ct"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="OIpjQuXD" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67AFWGeF2034929 for ; Mon, 10 Aug 2026 15:42:21 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= /Ol8WpcEjj06q3ha1b2ZdRY+l9xpEFrE+uyJaWfhLJI=; b=AeS01/Ct5gaVVxuL BGhfFfceoK4d/rRNfiK6ZSBPbIpCmCzbID+VKl8ITCe0wUSneI9auDdnRDDCCxnL qWwlYHDL5E9bwviIOlH0k/YWs17jIxRilWjf7FFiABa5ps70gB3DNSl6kqjyICT0 42xgyUXtCx19u+YkHhjfC/+SiHf6UQJmCQ2yGgwUuCsrQ2ACF1pxLEna9abtBIMC fWV/IyyDRRiI5M0aZgOb0HaYD/J7lIK2aha2Dik8zf3jWDjf27XBW0bmDFH3mMmP r4la1VhTPJ53QWl8P6mgI+hRNBfeM02sX5PPWpygAtInFV94rLSqqAgBHRHhryZ/ UaF/PQ== Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fy8vhjb1p-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 10 Aug 2026 15:42:21 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-51c1d137a68so46201121cf.3 for ; Mon, 10 Aug 2026 08:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786376541; x=1786981341; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/Ol8WpcEjj06q3ha1b2ZdRY+l9xpEFrE+uyJaWfhLJI=; b=OIpjQuXD2oVjibNDNjZb5aFeg7LEYm5UJY3rdPzMLNIBDQoHv51y4up3cQkw3q3NDF fhbciJ6c8jV9HzU79dHaVu1Bw1dTEvEEGTR5guvkCGNaI4bsvhrGd8qF93NNHkWbImzj uMFHpOwncS10JOSCHywRct5zAhNL/PZpQpa6WEKcDdWjOcuo9bLfO6wc0yxnFjqfqUVP ODrVgzl5pxrNkPFireImN8JgArLlUviIHGTIjYH5tR9WBvDOh4AV2ihrjvvAX5aYV1oP vPGctcfbkQe5CcoE0gqUbyRKMayq2QE93tZtCnZmRUBEfLOYPAKGD6iPwchyu2mnbAXw l7Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786376541; x=1786981341; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=/Ol8WpcEjj06q3ha1b2ZdRY+l9xpEFrE+uyJaWfhLJI=; b=ezbzAUKZui0D/Xey8H4bK6csIrdZAPxawJqRe9g/OtnkzEHDjplwHbdi9BcrkDRH8H qBLfMgbFIiXn15xrkSQtgYPUO4uM/x7KL1uhX0y8GoNSWfyqGfvvZwLLFo0Yux0LaYUF E6VDaxvLIdT4yuzDGHkwxjrpzXjLj3bXLo0S8NYAhnk7B8mvIKffDxJx0wsiYXa6rDdu X46N954XGldbgtPVoVmcsiMV4MZsxuuydRxz5g2qgBtP3Kr8O0MB77lBnUO9aFJ6odcQ U6TXuOivcEPZaaegFq8mJwaVLQP9o7cYpIsBwcn1DwYCm7pzb6p7fYfx/8yVgIFdtlwA H9Rw== X-Forwarded-Encrypted: i=1; AHgh+RqUhITiuHQC5aA3+80fp/OajJtplIEledotU2yAUBDIr/jZUZm+NMXturVJ/w8z0eVUKO274TarCuSr9l0=@vger.kernel.org X-Gm-Message-State: AOJu0YwcCEZ2BDysUwE2KS4sFLnlz3jABRpOWGy9MHz7U1BVoMAfyCvj rPLOAeHM+JVEtOfy7clN6Sd/xzpPFcPtHba8JdbXmh8YZkqPBrt2YM/OfOZZzVGDpd7ZMivM6EB UGa25xqnuQxyBYtkZvCgP0gqEopKorFbk4RjewXwqZcv5kupFVojGBVOfxhv0J/XbGNQ= X-Gm-Gg: AR+sD12LmEamhmaW/oqWDw8T6u5HcqAYiQ9/T3exaBsSMXbKlQnMf6Gyjdj5u4QSDPd na0CXQMFjMnOYe6oYVrg+FxKMj4n/WGrVM2Khs9Dknkx4FnYHoFllmGu8H5niMEdbToRpvUuNt3 R6JHcuErkyhuXvuNyEb98oKw/TjccrTmJ1S9ltVjigX3RY+6WNAqeOkwVSFhtHNu0AQVw+Uoaaz mkCILMxRvtd2dQIwA/pxyrBEn4qhKXH/CUxz2sZNz+eTssiz2u0J4MJoXfgXGQxwMnl0OC+Zycx BMRGvlEibjnzVYrsFdua+PVwb7cp4SxtaGYx0gNNpbr1jjw/2dD7nMcMZm3azpAgCVHSqxWp0n+ PqWcZtMjqWpHwldvf4KrnV1wgFIOuQ1VRKyxWF4cchxCOAfqmAxr1HeLML8iUsQRgTPWQXBhhau hCEQJTAo9etgmGVg== X-Received: by 2002:a05:622a:1f1a:b0:528:3142:d466 with SMTP id d75a77b69052e-52d20a920d3mr252033661cf.41.1786376540809; Mon, 10 Aug 2026 08:42:20 -0700 (PDT) X-Received: by 2002:a05:622a:1f1a:b0:528:3142:d466 with SMTP id d75a77b69052e-52d20a920d3mr252032531cf.41.1786376540166; Mon, 10 Aug 2026 08:42:20 -0700 (PDT) Received: from umbar.lan (2001-14ba-a073-af00-264b-feff-fe8b-be8a.rev.dnainternet.fi. [2001:14ba:a073:af00:264b:feff:fe8b:be8a]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5b3056f1bbdsm2071673e87.82.2026.08.10.08.42.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Aug 2026 08:42:18 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 10 Aug 2026 18:42:08 +0300 Subject: [PATCH 04/10] phy: qcom-usb-hsic: engage HSIC mode from phy_calibrate() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260810-msm8974-usb-hsic-v1-4-e5f93ea76ffa@oss.qualcomm.com> References: <20260810-msm8974-usb-hsic-v1-0-e5f93ea76ffa@oss.qualcomm.com> In-Reply-To: <20260810-msm8974-usb-hsic-v1-0-e5f93ea76ffa@oss.qualcomm.com> To: Bartosz Golaszewski , Bjorn Andersson , Linus Walleij , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Greg Kroah-Hartman , Xu Yang , Peng Fan , Vinod Koul , Neil Armstrong , Peter Chen , Pavankumar Kondeti , Stephen Boyd , Konrad Dybcio Cc: Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-phy@lists.infradead.org, Greg Kroah-Hartman , Peter Chen X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2853; i=dmitry.baryshkov@oss.qualcomm.com; h=from:subject:message-id; bh=TkrMMSM5qDrBbFDzv/+VaChi5RjS9zkmjtBE4vr35Do=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBqefFQhLz1oU44aOjR1xi5aFB9HrDQMTdOWypAd O9oOzFRa32JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCannxUAAKCRCLPIo+Aiko 1WzIB/wPUZAdSQaPXXJvH1bFmntgi2oxFK1T9jsaAfhtC18IWwtDkzXwfNlhfk3AR0XZmGY5UiP jjQmoXwuwt/VtjrilmmUZx+u6hDAXj0Zr9EXcb9Fo3CzLGNTgRNxoXu6V3Z+7f95saFMXWBPRS1 iFeT+5aDaRKCydJtyiI83UIVsC5DaW4p12w/1A8f3yxDD3KZayrQ57H5az4GkXml707CRQxLm4W pJ2Wp+9PXIMGEA9EuoqvAdtxrvhMdgmAz7JqCU2sd/YbFJO0ls1bXVkQOmqcuno1MxGNGc6qfXa nyCZ/v/i0ylhMp2Z/RBbFkaPoFNGFX930//CM7CRhxNKITVX X-Developer-Key: i=dmitry.baryshkov@oss.qualcomm.com; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-Authority-Analysis: v=2.4 cv=MMtQXsZl c=1 sm=1 tr=0 ts=6a79f15d cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=0xrA-bSJ-g1zX4FYa4YA:9 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22 X-Proofpoint-ORIG-GUID: 35_2yOrdPXe6S1L53Gd-qlv8A-yLU9dI X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODEwMDEzNSBTYWx0ZWRfX0YJ6jfbdb9sH HvqWHhLlamegmQbJiq4FtCnCxWBVVtn+GkJD4RONdagjpRocIAU3B3p2P62L2gb6yQY2dBdH2MC vMsVpmLPKqCc/dokvPxnUJbzCUG5aoS6TCZbFELO2r/Cm3RoeP2HkjxSdw/j5EsHZ+qlYAn88oZ /IZCw5xDDRgg2pi2PqFJ6QV8CkZatynmI/pv134j8jTmuzNoPqvUOjMp3hq81F+XXhQXhB5R2hf xizL3m/KMsqDjE4HTTrCQW1Sp8++HtQGaQUU7zE0W0qIdZ8zD4mhZPKciZXtvL3iXM5TK36sCPd 19l+mwf1nRERi99hQJiob9pUKCF0JeGjUqu8PMkE+yt+A9K08k1MplI06D1E1Agueiiw0g2IstK TJ5bw9B0T/JAB0IrlTq0LRISQZZoEySov0u8iQLH81gjfu8NXtKbAAjpXsSAQYAM75N/LkMianW 9VqtOpmYrZ1jxYwkjbg== X-Proofpoint-GUID: 35_2yOrdPXe6S1L53Gd-qlv8A-yLU9dI X-Proofpoint-Spam-Info: AW1haW4tMjYwODEwMDEzNSBTYWx0ZWRfXwrf6v7CGTJjx QSmlB32pYHcDB7v4+9JFCZXAbydTt8YyK6OczGxuOoKkNFob3btz1tHFkpUY2PWK8VGAdkdvCq5 Zi3FLPeaPEKtVbi/Rf2L/2UzaQ9qukc= 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-10_03,2026-08-10_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 suspectscore=0 spamscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 lowpriorityscore=0 phishscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608100135 The PHY power-on sequence ends by engaging HSIC mode. With chipidea, power-on runs before the host is started, and the HSIC connect of an already-present device is latched at the moment HSIC mode is engaged: performed before the host runs (and before an onboard hub is taken out of reset), the connect is lost and the device is never seen. This is why the APQ8074 dragonboard USB4604 hub never enumerated on mainline while the vendor kernel - which performs the whole PHY sequence after usb_add_hcd() - sees it on every boot. Keep the calibration setup and the pad mux in power-on, and move the HSIC mode enable (and the auto-resume disable) into the calibrate op, which the chipidea host now invokes after the host is up and the onboard device reset has been released. Assisted-by: Claude:claude-fable-5 Signed-off-by: Dmitry Baryshkov --- drivers/phy/qualcomm/phy-qcom-usb-hsic.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-usb-hsic.c b/drivers/phy/qualcomm/phy-qcom-usb-hsic.c index b670ec364a2d..e0637522eb82 100644 --- a/drivers/phy/qualcomm/phy-qcom-usb-hsic.c +++ b/drivers/phy/qualcomm/phy-qcom-usb-hsic.c @@ -63,17 +63,6 @@ static int qcom_usb_hsic_phy_power_on(struct phy *phy) } ret = pinctrl_select_state(uphy->pctl, pins_default); - if (ret) - goto err_ulpi; - - /* Enable HSIC mode in HSIC_CFG register */ - ret = ulpi_write(ulpi, ULPI_SET(ULPI_HSIC_CFG), 0x01); - if (ret) - goto err_ulpi; - - /* Disable auto-resume */ - ret = ulpi_write(ulpi, ULPI_CLR(ULPI_IFC_CTRL), - ULPI_IFC_CTRL_AUTORESUME); if (ret) goto err_ulpi; @@ -85,6 +74,26 @@ static int qcom_usb_hsic_phy_power_on(struct phy *phy) return ret; } +static int qcom_usb_hsic_phy_calibrate(struct phy *phy) +{ + struct qcom_usb_hsic_phy *uphy = phy_get_drvdata(phy); + struct ulpi *ulpi = uphy->ulpi; + int ret; + + /* + * Engage HSIC mode only now, with the host running and the + * downstream device out of reset: the connect is latched at this + * point, and a hub that has already booted asserts it right away. + */ + ret = ulpi_write(ulpi, ULPI_SET(ULPI_HSIC_CFG), 0x01); + if (ret) + return ret; + + /* Disable auto-resume */ + return ulpi_write(ulpi, ULPI_CLR(ULPI_IFC_CTRL), + ULPI_IFC_CTRL_AUTORESUME); +} + static int qcom_usb_hsic_phy_power_off(struct phy *phy) { struct qcom_usb_hsic_phy *uphy = phy_get_drvdata(phy); @@ -97,6 +106,7 @@ static int qcom_usb_hsic_phy_power_off(struct phy *phy) static const struct phy_ops qcom_usb_hsic_phy_ops = { .power_on = qcom_usb_hsic_phy_power_on, + .calibrate = qcom_usb_hsic_phy_calibrate, .power_off = qcom_usb_hsic_phy_power_off, .owner = THIS_MODULE, }; -- 2.47.3