From patchwork Mon Apr 8 01:04:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13620353 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D34E07FB for ; Mon, 8 Apr 2024 01:04:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712538262; cv=none; b=cZwb08U8e+Zg2CxxN0M6APWc4yWT3lOePSGy+LSbvqp/+Vb6uVYhzXmyWmU/9F7v+T+Ls7d01tl+f5tgSTN/qmDnTy2SyRT80pyUoUYEJwwHFWa8WfqE73OPz3hiVxN+bkrgKqL9IqYFs3C4QKHOAYnRIoks55g9jJj71rPUHkk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712538262; c=relaxed/simple; bh=s33RZGEgwzC1Gzmvtyej0nFCi4RDWjdOM+NcM4qSbic=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cgpA3zkZWEWqTeSvZWF6rCGB/Fo1QorraWxVPuZ6UIEtG8sVfEh19szoSfzriZCDR1IligKMWmiJ436qx6ZP0xcHXRmqZMgleJayHjW+RAVIJdZDR1zp2a95WNqp+QqFRfcpsWiCFceIulRCkyG0obNmTDbmFIFn/QLu8mX1+3U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=tpAWew1r; arc=none smtp.client-ip=209.85.167.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="tpAWew1r" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-516d3776334so3496826e87.1 for ; Sun, 07 Apr 2024 18:04:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712538259; x=1713143059; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=YTHBa3/xySk1w4WlhRSYrG1ip6R3tbTiUm7wjb7zoMA=; b=tpAWew1rIDKSRcGeTGxN+GPfcGKvELuglzbaciDshzQQNChExeMAzSV5tWYqFsR4ak DxLWHmpRghDcztSPd5rOCWC08UMi7UGsupqf+OpYHObmUKrnKaAvj6j0/kKel9J0ltJZ Z9SDZ2e/kbVZgwEfjEvW4Jrb6+af332Hvw0SIpeELLLfk+YYM7b+9R/n1pSsIT/8bJ8y q274vFcseRYwNl086PU4wbb5dGm7RM++o96+3u/V/UceCe5qrNoECWLz7j17l/KSbrXK BZ7eQcRon+nvuieqGN3V2qkS7NPuIVIRqd/BcRpcB1Xz3WCYWStbDoeFCQs1WgezW8ze vh8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712538259; x=1713143059; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YTHBa3/xySk1w4WlhRSYrG1ip6R3tbTiUm7wjb7zoMA=; b=Tv4uCXReKCP4g/ja63aCFSD2SppsjjgIgfrI4wsKISJ+hjKZK9pDyKY6bg5hmYoFf5 9amQlC7tjls4GkzMMRCNkrSo5+TlKvEKnscrF5+vZ1k8cvbQ1RSRaFpELx05f1OFuTvL BNf/bUVEWxj7w7PmVHoIKrJcywVh5tUXDv5YvS/WxEeXlJd9Se1QX+7gpSE4Qkqwb/3J P7VM5DS8hfqwvEdbmtb+2qHRxRiKaKwQBUljmXrmH0dB0giapr60xFOX8OCZvu2uk6uW NKq552tr8bQGFOplfUgzq1gxXjcmmKd1+Ua5IEESuDDcceuULRNcmbZj1gs1T01jOkeU Zzog== X-Forwarded-Encrypted: i=1; AJvYcCUx/m7Ldv3k1RYSyYTTL+q/mfZLEYRxxWsVusf6iQo5MKKEtZCj0kVTAGrMQ8gVQwFmMbv3ZFYXLWm7Dg3pUG6N1YLecr9NHtB/ X-Gm-Message-State: AOJu0Yz1CDXNfv1Db2s5ELlKwbMSYfFNNNN6rQc8Bj/Xg1zohZHJEjep ZXF7xpXuPwE6dpElJtDacoHJc5Ie9ggpEsHTb6Qm7izfNAScBwG3iHyHiq2vpnI= X-Google-Smtp-Source: AGHT+IH3u3/B0zIlKOQ4GKAMsNk1tEk5PZcdbk/YMayNB5gDSCrQerWl4ZS9DMtinyQHyAq2WQrpzA== X-Received: by 2002:ac2:4db2:0:b0:515:d31f:ce2b with SMTP id h18-20020ac24db2000000b00515d31fce2bmr5347091lfe.15.1712538259082; Sun, 07 Apr 2024 18:04:19 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id m29-20020a19435d000000b00516dc765e00sm674034lfj.7.2024.04.07.18.04.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Apr 2024 18:04:18 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 08 Apr 2024 04:04:15 +0300 Subject: [PATCH 1/3] usb: typec: ucsi_glink: enable the UCSI_DELAY_DEVICE_PDOS quirk on qcm6490 Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240408-qcom-ucsi-fixes-bis-v1-1-716c145ca4b1@linaro.org> References: <20240408-qcom-ucsi-fixes-bis-v1-0-716c145ca4b1@linaro.org> In-Reply-To: <20240408-qcom-ucsi-fixes-bis-v1-0-716c145ca4b1@linaro.org> To: Heikki Krogerus , Greg Kroah-Hartman Cc: Neil Armstrong , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1248; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=s33RZGEgwzC1Gzmvtyej0nFCi4RDWjdOM+NcM4qSbic=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmE0KRQyOhFT8nKM/JhWE4LGLevh22hkfK04kTP +vTscL+29yJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZhNCkQAKCRCLPIo+Aiko 1UvCB/9066B/QSH+M7g/mfZocsMcOrqBmesJjVaxV9PD7qYSB2X2/8gsXpJTu9VA/AlOlJkjoOu SToK54Oot+nOCU0OJq/aHXjg/t3iZZ1qmfM5N/HQVouMfyy3Uze4ubPQ6aus9KSADxbBUpl+u6K QOPbxc2LaEAjYfaqKYwrzHHCzDfL2tbuSyqWhhac1pSi71VqvfrOZCVTP5iFIV4g19aqp9awDAd 1pW9gEP9e2fnyt9bXeSYe0itvqfKBiYYbvll0P1VqiE8VlYfpsbHFTf+a/RF06UeQ7cpNo5cI8A 1Amszwfqi5CUD3PpEZ10NnKM/64lUNeEa8u8OuTb+HdQyh1Q X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Enable the UCSI_DELAY_DEVICE_PDOS quirk on Qualcomm QCM6490. This platform also doesn't correctly handle reading PD capabilities until PD partner is connected. Fixes: 5da727f75823 ("usb: typec: ucsi_glink: enable the UCSI_DELAY_DEVICE_PDOS quirk") Signed-off-by: Dmitry Baryshkov Reviewed-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi_glink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c index ef00a6563c88..9bd80a2218e4 100644 --- a/drivers/usb/typec/ucsi/ucsi_glink.c +++ b/drivers/usb/typec/ucsi/ucsi_glink.c @@ -316,7 +316,7 @@ static unsigned long quirk_sc8280xp = UCSI_NO_PARTNER_PDOS | UCSI_DELAY_DEVICE_P static unsigned long quirk_sm8450 = UCSI_DELAY_DEVICE_PDOS; static const struct of_device_id pmic_glink_ucsi_of_quirks[] = { - { .compatible = "qcom,qcm6490-pmic-glink", .data = &quirk_sc8180x, }, + { .compatible = "qcom,qcm6490-pmic-glink", .data = &quirk_sc8280xp, }, { .compatible = "qcom,sc8180x-pmic-glink", .data = &quirk_sc8180x, }, { .compatible = "qcom,sc8280xp-pmic-glink", .data = &quirk_sc8280xp, }, { .compatible = "qcom,sm8350-pmic-glink", .data = &quirk_sc8180x, }, From patchwork Mon Apr 8 01:04:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13620354 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2EACEBB for ; Mon, 8 Apr 2024 01:04:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712538263; cv=none; b=B3LTck9CqS/2osqvy6N5xlHV1uO8/uap0UG98IJhWXhCBeF2Xx9K2ylYv+IdB/upxYuMN96QEG6nKNlKrMHBfHwQ7puxIuNKbkYCHeV2FJ9JGZUFCdx32Bm1vS4b22tJ2X4cqAtW8gEimJqnPNsvKMtyrxBUbC/UnzU2nbSRx0k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712538263; c=relaxed/simple; bh=12T0foa9TpAG3Uf1Tp0wQx8JMYcT/6X8Xh9Ou+tRPFU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=M2FgfqAunPFeZQrGOUwiCqEgdpTEJkuuYJhIlu9V47opXi82xNcfx/H0ZLYl11x9Q3qk5ShZN/WmD6Qgg6AVokAJUR787W8A0f0YF6Gqy/y0ZjAg8cZGB2BHyd0tXys59dZV7biGkoeCeIjTCZit7Oh1SFaMizCVsyS3kao1C0A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=BibJ47Gu; arc=none smtp.client-ip=209.85.167.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BibJ47Gu" Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-516cdb21b34so4879530e87.1 for ; Sun, 07 Apr 2024 18:04:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712538260; x=1713143060; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=+80ujqs2n4MhvbTeh1pKk29DikjMVcufqK0a2xgB6AY=; b=BibJ47GuvuvKnCqbBmdhqa0vjuQPPB8/yIgIp8dHTBe5lhNbWCg5WfF4slzD6CxN6E xygsEu8hqXohPNtYsYNhRplUq5MndWN1IQYNn5x0B63igmQdbva4MHS66EOjkEGBLp2X kdK0zlFPQu6syi4KT/X8lN/twiph8pEQXOdEq6HQBRyx7zIoqLYGqEQt1equFs7Xy8Kc 0rNO0mKE39WLKFrIrwFltqGK/6Ffc5YGzb1zPzwA0x0oSl7Y1agYHJOTp/3Lg/lkl4Tk zT343dOfyd63m8PaQ1DMTdHbqZqZgixua7hbRJTkDlovWSsFvF4uAgKfL1zeGSM+qKqI GvVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712538260; x=1713143060; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+80ujqs2n4MhvbTeh1pKk29DikjMVcufqK0a2xgB6AY=; b=gGjHvACSBpZbw76fKA/zPprnXsI5VIKKpxsK4chPMONbOm8ZrdZBAJC9sOI8D4qXJl 8yzpDCpiLAb7oIn01wYIShU4aSM8JnKicLrXb753TtuN6q3T+04C5DvqjwxQq5BDxvp5 agZmR7gvZSiiOYGyQMoyPKLMwklSmXnqUeloE6vWw0+GjEANtoI7PaTlygSR/a1oDblV Aq0tm7zk/04kyIoBIuoHpJIcfmrN9A+PEIA+79zguHaQ75Oa7sQZlN2qFQkbe8xvk/Ks tRVYd7KUy6Iwsf5Q5n3UjJ/x/sX6Fx4NoXC/gbgpnc24oXiYchT3lhi8VfHnAi7YAuMu JDvQ== X-Forwarded-Encrypted: i=1; AJvYcCXaah8zinjwiBw3UEGpJ7CIKZdrABPzNCNZznd43ZI0okLqjFzcwxFZ/bF3sqTAKcjYgSuOpn0+YbaemutQS5PfpLsnlKIiecD+ X-Gm-Message-State: AOJu0YwdoDXRsr6Z4R6CBq8Bo6zqSUxlUL+C62hXxyv9p8oJOP2M4a9y sEkGNZPvr9kPqFKDIrEWp7FiXWxs3wdIV1Ok3e7KxsPxF/pPT+8SVAMFT1tDj28= X-Google-Smtp-Source: AGHT+IFPI9ElZoAigAzDwykeRoQWoOIRMt2gfxcdCfQYNY3kJcBMqUetR2u2JGuOOcNTwYY3kv2Txg== X-Received: by 2002:ac2:47f3:0:b0:516:d187:8e3a with SMTP id b19-20020ac247f3000000b00516d1878e3amr4330331lfp.55.1712538259768; Sun, 07 Apr 2024 18:04:19 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id m29-20020a19435d000000b00516dc765e00sm674034lfj.7.2024.04.07.18.04.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Apr 2024 18:04:19 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 08 Apr 2024 04:04:16 +0300 Subject: [PATCH 2/3] usb: typec: ucsi_glink: drop NO_PARTNER_PDOS quirk for sm8550 / sm8650 Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240408-qcom-ucsi-fixes-bis-v1-2-716c145ca4b1@linaro.org> References: <20240408-qcom-ucsi-fixes-bis-v1-0-716c145ca4b1@linaro.org> In-Reply-To: <20240408-qcom-ucsi-fixes-bis-v1-0-716c145ca4b1@linaro.org> To: Heikki Krogerus , Greg Kroah-Hartman Cc: Neil Armstrong , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1100; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=12T0foa9TpAG3Uf1Tp0wQx8JMYcT/6X8Xh9Ou+tRPFU=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmE0KRmutE73haDGp2zGC66J4lAtn6A/RjUlYX3 hu58hfeYLCJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZhNCkQAKCRCLPIo+Aiko 1ZcgB/4iy5BKTnES0i1JSytr7sCptdD4nu1yE92kXxHGWQHGwE0pBFU4BevsFlOwQb68LFzeJ74 hSTpkW6pdgObo/rAaAzJrSlxVrHU88oe4Hyez61KRPf8RfZ146EnVhGyBU03f0Fah3Rya+8AoUU UL9SQjKIjTJkSXst8KZs7detqABiWlmCIKiVbnTu79OlZUqZMLcEZcrtXhLEf/x5lK/WU4pVCkr Teyptzn5gRANVQ0JN3XNKmZVNKgAQTA0F8EVZcapHgP7bWsCjNq3mC8zyn7PJrQcOySalZkbZ/D euJcCbzfNc8AHGHk6PAB602xiMWpmBib2CuecYB/jCb6aUyr X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A The Qualcomm SM8550 (and via a fallback compat SM8650) firmware properly handles the GET_PDOS command, it sends the CCI_BUSY notification, and then follows with the CCI_COMMAND_COMPLETE event. Stop using the quirk for those two platforms. Signed-off-by: Dmitry Baryshkov Reviewed-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi_glink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c index 9bd80a2218e4..9ffea20020e7 100644 --- a/drivers/usb/typec/ucsi/ucsi_glink.c +++ b/drivers/usb/typec/ucsi/ucsi_glink.c @@ -321,7 +321,7 @@ static const struct of_device_id pmic_glink_ucsi_of_quirks[] = { { .compatible = "qcom,sc8280xp-pmic-glink", .data = &quirk_sc8280xp, }, { .compatible = "qcom,sm8350-pmic-glink", .data = &quirk_sc8180x, }, { .compatible = "qcom,sm8450-pmic-glink", .data = &quirk_sm8450, }, - { .compatible = "qcom,sm8550-pmic-glink", .data = &quirk_sc8280xp, }, + { .compatible = "qcom,sm8550-pmic-glink", .data = &quirk_sm8450, }, {} }; From patchwork Mon Apr 8 01:04:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13620356 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61A5C10E9 for ; Mon, 8 Apr 2024 01:04:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712538264; cv=none; b=rlcRJggJibuWwDSitj2kf40XJ4Xr2kCh+lTCGBARDhk/WTIXqvtmcSmeLAAh2tB0kddCcD4baZ95IkGYfBbCTy82L/z+B5SRwDrmhoUvYKV8H5jwIkpS/H9dmWn87N9CxBuWvPQDyfXP5A0mxnH4Zn5z4vSfccFGrks/t0zz+0E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712538264; c=relaxed/simple; bh=8hCT59UUlPeFnsMSjNM7ogTa6Z0LB8n7G6EmCFREqF8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=t5zTRAbIeKLQgIYUYoYjwLfyr293GeFFHy0eQs3XfYAFZbd8N+2qt3mPrCO3HvrSaWJ4XrEaNExcoaCauMak56piRGo8FewPdBOj+4DMwcAFKzVmjw72qpxLEDaz3FqzGxnht4Di9AaKzlayK4OBQ0l0SOOuAfip0LbkO9pf/i4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=cDEAyx3y; arc=none smtp.client-ip=209.85.167.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="cDEAyx3y" Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-516d727074eso2466112e87.0 for ; Sun, 07 Apr 2024 18:04:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712538260; x=1713143060; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=zKpZdrheuhj7yjl3RKCCkKC9ZeZ2qLZs4tSK1uWLKBs=; b=cDEAyx3yYjOvZuNmo7G0liXICcku2ZUBC3OtwM7qlRPRMyS4uhMVM08a0Cxoy48/5D 2EpHoaohpgYTnUBVl33vb4Hdr3JVoD9vrZIN8JPM4xcZVuVN109L1pY/Kt35b7Vjk4eB w6aaAJSTM/SrtBvywEporD2Tr5HjkSmWjIQKzndveWCaSFxgzWJuoBwoKR5Ik/RuvuiO wy2IF5H+8IMLWMR8FGmmgiWQrvCQFpvxLe0q7UMJvRHgUK+du/FhNIuNzgzYJR1hWVgH INH/zV6qTgPpz8XS2TBY9qXHGdeT8tIKUXjzrMmxgfVWQnvOJx/aUED8Be528xTiziZZ RxiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712538260; x=1713143060; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zKpZdrheuhj7yjl3RKCCkKC9ZeZ2qLZs4tSK1uWLKBs=; b=rXRaHkFG7EUYJgnOsJ4mo/1GzM18xt1HwROnSWVRUE1VEtnZc3j6OPxYQD2LFpG2lv Mkthaju5Fy49FMZO3LD6AanwCSD+uXREl5Uj2Vnp7Omca+oReza1HVisdFax06DEDaQk tHoJH9HLGCytImP5KT16Icdde0+lQu7YeUZBRCadzAyq5l+SShWMaH3Zk/YMehgnY6fq ssbNbCAkQO5YvKRIvyMluOhVWZoJs5P2kwPsihf07C3DN86zwMc4CVSlW7JbEvUlmyQh dEVxDRD8GQ+SewUxnRsAkUYRhQj3QoZaY4W+rR2n6X87yZwG8emJrZfvXytt+/hXYKHE J0JQ== X-Forwarded-Encrypted: i=1; AJvYcCW66NdnU6+F7aAG0ITOrMNy8PvZ8vjAjNnTq4/YFKKgFZn5ZiIETJcq2r4o+j4Vsb0FT/6+W/iltGHhm+Q50+0m9OT9h1efMz6n X-Gm-Message-State: AOJu0YxrOCZ90tHkMQ3RlFJfpdffwpFhCbJTALoRhheHXnFAcAi1JzpX n6M4xWw1DE3tz3NNowfnvWEvwJf3ty3hcSnvLkwqHclDNuIRWWdYb1mnkc8y0XY= X-Google-Smtp-Source: AGHT+IEknDaX8du7Q/ssV1kvpZL88uAGkrW8svlqZLvtfsXHUFPZG3+pXiRJUvXuQ7gv5TLHrtJG+Q== X-Received: by 2002:a19:6457:0:b0:516:d17f:3c30 with SMTP id b23-20020a196457000000b00516d17f3c30mr5109276lfj.3.1712538260577; Sun, 07 Apr 2024 18:04:20 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id m29-20020a19435d000000b00516dc765e00sm674034lfj.7.2024.04.07.18.04.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Apr 2024 18:04:20 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 08 Apr 2024 04:04:17 +0300 Subject: [PATCH 3/3] usb: typec: ucsi_glink: drop special handling for CCI_BUSY Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240408-qcom-ucsi-fixes-bis-v1-3-716c145ca4b1@linaro.org> References: <20240408-qcom-ucsi-fixes-bis-v1-0-716c145ca4b1@linaro.org> In-Reply-To: <20240408-qcom-ucsi-fixes-bis-v1-0-716c145ca4b1@linaro.org> To: Heikki Krogerus , Greg Kroah-Hartman Cc: Neil Armstrong , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1725; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=8hCT59UUlPeFnsMSjNM7ogTa6Z0LB8n7G6EmCFREqF8=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmE0KR4Gv/bun7J1cWPuf9wHOsVk2HdV1AGd3A7 cqPq072Nv+JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZhNCkQAKCRCLPIo+Aiko 1UpfB/0U28BzqJs4QovjkmxtwMMgp8xDjJ1Tc6s5lcvnNZ5HwoiJwJLd/GfMuesG58RWjaA0mPX vvbROwnV9HiJK/mQBsG1qa33rN2FXw7++puWyiRNBg4YK6LJ1KsAy1q5yrw2CvuotGshdJPOUcx R7eNVEowzEpBCkTsaaH5/Xpi0dpRmWn+EM+ae/5QWEm6yEFPgEKYWoRgARPRqSaRZDB6Jgzw19O m4lhAX5zvyh5Pm4AWrDeHB8II+2P1CIq1BjRkoovzb+NgHjByXFgxNvbzhgUVMnGdXzZA40Ldwz eDHs0xi+sFbZDzHj/melI+w71Drvs7HiJCDaMr7OQjHGJo2U X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Newer Qualcomm platforms (sm8450+) successfully handle busy state and send the Command Completion after sending the Busy state. Older devices have firmware bug and can not continue after sending the CCI_BUSY state, but the command that leads to CCI_BUSY is already forbidden by the NO_PARTNER_PDOS quirk. Follow other UCSI glue drivers and drop special handling for CCI_BUSY event. Let the UCSI core properly handle this state. Signed-off-by: Dmitry Baryshkov Reviewed-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi_glink.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c index 9ffea20020e7..b91d2d15d7d9 100644 --- a/drivers/usb/typec/ucsi/ucsi_glink.c +++ b/drivers/usb/typec/ucsi/ucsi_glink.c @@ -176,7 +176,8 @@ static int pmic_glink_ucsi_sync_write(struct ucsi *__ucsi, unsigned int offset, left = wait_for_completion_timeout(&ucsi->sync_ack, 5 * HZ); if (!left) { dev_err(ucsi->dev, "timeout waiting for UCSI sync write response\n"); - ret = -ETIMEDOUT; + /* return 0 here and let core UCSI code handle the CCI_BUSY */ + ret = 0; } else if (ucsi->sync_val) { dev_err(ucsi->dev, "sync write returned: %d\n", ucsi->sync_val); } @@ -243,10 +244,7 @@ static void pmic_glink_ucsi_notify(struct work_struct *work) ucsi_connector_change(ucsi->ucsi, con_num); } - if (ucsi->sync_pending && cci & UCSI_CCI_BUSY) { - ucsi->sync_val = -EBUSY; - complete(&ucsi->sync_ack); - } else if (ucsi->sync_pending && + if (ucsi->sync_pending && (cci & (UCSI_CCI_ACK_COMPLETE | UCSI_CCI_COMMAND_COMPLETE))) { complete(&ucsi->sync_ack); }