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: 787634 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 D35047FE for ; Mon, 8 Apr 2024 01:04:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712538263; cv=none; b=UZaVeYmbyv3SIvHJQYKJML7KfIQr6B5jQ8Sj91fVZ64EmZmeXW6KtqJMQwkcXRDw284CketHUk5yQZ6yT7X5wv6TKFJ+zSEo6JnLrL8VKXmjyz5XmAEk2bD/DGzgIBfMJBQdkVF2cqYvbn1t/Mav+tRbsm9kIB3pHxRXQHaHIfs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712538263; c=relaxed/simple; bh=s33RZGEgwzC1Gzmvtyej0nFCi4RDWjdOM+NcM4qSbic=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CLPx4ngNK0XgSDIZ8YqN0Gd1dsMVD8g0qb0yZeXjBtgOak8s8jBgV+pgXr4y2vBNa4r44mAAmdaEwrXUocElgrQQir4HeDAsHdaWcHybDF9BQJSwenAgjnqvILxHWZjU9uKk5XuQpLQZ+myanCB7qy3LOCj7hZ9nghW7Cv4Rl3A= 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.43 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-f43.google.com with SMTP id 2adb3069b0e04-516d0161e13so4186780e87.3 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=Qfygu4BHNYyeByg4ZeQGzjeiAP3X+OVPUyeLtjhtjCMRBG11ato3mRXlvDap9Kpukc mfYtvLxF1pxpigLKaXRcjnQkIz/41l5TgKftKrFCmii3kjEKd39oJcqX3Ul1DWAMBGMz Z4I9RXzjyd+av7pUILztlJ7P88Y2v0DT+BEK0ohEg/Dwv393Zg/nwPiU5ORD0QR4bIrE RNcLT8oO8Z0rPXSerDWzQZeynJE4iofVwafJRDo9UREbS6LIoLFWNCI7tKQTpPv2t0WV UEgZ5YSZTjztjSTghgN+g4LlLj55zlh1SHxGHy0Kb48CCiTpBPP3pLolmUu/s7TRaodn SoZw== X-Forwarded-Encrypted: i=1; AJvYcCUBls7PKD39q/t24gQUu+hkAgs0JaXWGBP3nLevlq3Nc2QTLB3e0WGXwnm5TVuUKgZE6l4FNgXVn9AizAHFwfguzo/6PZQg0iRqLus3VQ== X-Gm-Message-State: AOJu0Yzhck1xz5KYqKX8CwHs+QZvpJ3v8MrM2a1csBV8ZYLvt3DSAzHu o6R2Q/tyQXg/WJN3ZIhlRW9GuaYhuZww1ZDB3Z5EzsTVI4S0YCFs4sVJQk9tN80= 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-arm-msm@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 --- 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: 787027 Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (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 97DECA40 for ; Mon, 8 Apr 2024 01:04:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712538263; cv=none; b=PYT/GWgfFBOyDcsvboiF7b4mEq9BeEVWKDVKVbpHh8Uvju5vadRkp4l85g48Ig3dPlBRqv/t+eIBbMLaakwoBv6AA3dW8XknS7yyFi6UYY1nAtRpU5PDtOnnBsmzYrcZpU3/x9Y2b0ZLtN+o0zD6ZjYvwebQ2GafC35qcJgHI2k= 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.53 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-f53.google.com with SMTP id 2adb3069b0e04-516cdb21b34so4879531e87.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=IJ+Ty+YpfwBvhV+SuWLyIP4JZRP8J4J3Is85+UDgmBYLBybVyaeLrPQByuGbVX++3s muTpZBV9YggEXC/PQRYpcLdICBgkDqEh7l5fbPpb8I/Ts5Z6JCMjfVmUTboWDMPGxyp1 DRv2FQU9jyYEL7oclla6ZtjSevCH9KB0NTPvDKMk+de2gUkEctdQ7/952Z1G8qe7UD9N F0HP3yIQrSmKiXC6qB/Z9WhB4OamtiovLpApWsM1wOz/6022lWngpNJ4iOEeukC8av2m 3Bk3vF2VR6wDqWMXApNWBKi1nDfHpHNgOtmA8rkXw9pNvr1eqegyU5/IprUacr3qauQO Iggg== X-Forwarded-Encrypted: i=1; AJvYcCWYuw4OZHoyoezVPEy5ZyWhlq3avbcQxjjvZ2DnUGPJaXInBInFmcbdMLHh0quXQzMoMgNjXfFwajU9O1OsbnN7IPhM4G2GiEwZEel4zw== X-Gm-Message-State: AOJu0YzGvXyZ+gVgQ7cv4Bn4CvH+Pt2WazNi75+MB//7scGKmaoZleTu Vn3TcXebQ10pNBPsiZJlKok/0L8aU5rVKxlvf8yXX27i1Uc+0/8aBJMOAYefg3Q= 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-arm-msm@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: 787026 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (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 697771366 for ; Mon, 8 Apr 2024 01:04:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712538264; cv=none; b=YsYJsMqA/x4H98FWSw9ouGDiO5CQtA16Ce1egQxaT7BSGsHT5n0vg6rIVJfUPYxKDqSz2e2x2B4neU3Nkq0FjJWocUs47wuUGK54nuHov8rdj07+6bMYQ3Q7Se9wns1ClSmOFtnBhej4cf3RVwpzmaPIOBTkQ5Sc+RegpYgpWqw= 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.49 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-f49.google.com with SMTP id 2adb3069b0e04-516f2e0edb7so912201e87.1 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=EKfzeaHUKDtDIa+Xm3haTg3SHosrivwHWM+/WEPkbS725jtGi4PNWQUuZ8Ria/k49l jsSxqbK1JmR/kbBpx+LJy4kEyDEYJKz1BtBMvX0y7Elx1Pzll6LwoHrt+qQR0eqEeweL inGDMWlhNGS5gVhgfbsM/a2bb84LiE5eCNJ7Is4mN0hZHUDolXQynNMUGG7cHyMA0cly DeY7hpNBSaqywKnilki9NQXTXhTI5unlmLdjORJN3g98ys6DvKKJ276XxAm7QTCMdJa7 I6eN58ZxV9cUReQ9ERBXiJvjPyEZ2aFM9AXXjqL6dGtorHDwvlJ1qVUJ4yIo5DwHEUTV fEUA== X-Forwarded-Encrypted: i=1; AJvYcCXpPhkWDNQ/jczALe5gdFdTIGZahple/WPX3KAhg/c4+0R0h3ODAFkftuO1OyJM3BXgBIX5xjV6HuxCJmRH4ux59fZvSv++I9Fq+GpW3Q== X-Gm-Message-State: AOJu0Yz0sXEzLfSmKwLRzVRHiq03xZgzGGqDCS1xmUZHqyO3O6Ci3Pug vbX4oZUTlxVZiFP8ry/lel3E9cVD39qfyrOFNLfIVHcskDnybVtIzZCby7x6DFp3oSLePwyltc7 o 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-arm-msm@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); }