From patchwork Tue Apr 9 15:29: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: 787604 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 A902C13B5BE for ; Tue, 9 Apr 2024 15:29:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712676564; cv=none; b=VoODU2kjNYjTYaolMuQjpCHegAl0ITZ/dSgEHt7Yn6CeuHzZw8SRi0x7mmfSsvxasO9DjOjiqxVbYKpPT39LXOXX6pXJbt66O4EW7V9HLcdhP9c81L4hNnOXSe5d/gPxMnzVlx3s2sB5Zamx8OcKXgaOcGwez6+HdQu5uGqLU9E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712676564; c=relaxed/simple; bh=Qii41m4WQHeAZjiOSBCpdD4P8rWOw8ayDA/3aiWLd8s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FHLjhke0mskr7aTFSxhJaGIZ20Stj9+XaAj7XgHW1OX8RU5ipgO3Cv1SxOS1SeC8Gkz2AaLQKi7OQtM0Bz94BnFm7NyIDiS6usaUhic/ZeVC5XiN2TTsAopVn7WWr3FaCGFc8xYafjrhy29pvdAiH4prSjSeDC95DZtBF5Rk0JY= 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=QOUEkWKC; arc=none smtp.client-ip=209.85.167.45 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="QOUEkWKC" Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-516d2b9cd69so5206586e87.2 for ; Tue, 09 Apr 2024 08:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712676560; x=1713281360; 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=+rK4J26zOCM/IkzvRWeb9dI3/SvLzqKWXafwI1/aF88=; b=QOUEkWKCmCxIBAP5sY/uH9inDRSXrPTOt/86djQ89oKg5GEwGwK0aFQIAXkYIjhbEd GKAOSzY2BY2wE/bYWqdnRtw8bAEEaK+Kf4yuufgkB37+1rFM1ztK6AoGrx66/2EpVvqT 2AdgHeie864URa9l3NaDXNUbDwf8OE27jI+YAswRg551hUo/xqaLO7Vg3cgZo7Pu2sNl OrG+AV7dQoirxDx8P7Wec24fJQvS2Nl+50lLFXYREw1QF9H3Hh6Dp8zZ/1syiqkRz1L1 BuxZ66qxI+zUJ2lUNUM7ug3GCD25uYWGy8OaPP83+oBIysc8mGZiGRTfjivi4oFgdNVm +1Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712676560; x=1713281360; 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=+rK4J26zOCM/IkzvRWeb9dI3/SvLzqKWXafwI1/aF88=; b=gUJI446dPezMIJQz3Hh/6jOBgHhTdanq3lGlS0fL3tSgBsKQkMsm/Cc/WVSE9GlGma CyOfIUdOJM7OkgegPIIZzBOODCamo7rq8oxH5wNOvcH+8Vf2VBzYp3Uhe8DMoVLJWbdC WoPZpnW6ohUY069RM1xAct5svkFGsZCXbJA6PS8/9N+e6veROaommYrz4bBJdmjHfNkJ SdJLAH1/KoOLsYL30JMVP5GcJyYufsj4aFH+A9ghHuTPu737v5uBxbC5Cit6s3vsv2bH ztHzHReMJKSsehcLw72TuUC7eBnVhUUtg2rwB5LsiUL+czrRVltK2VOKSfxWRusqPE39 IFsQ== X-Forwarded-Encrypted: i=1; AJvYcCV+zmSYD6O3Kkj22NRvfNIb54e7vOOponDvU44oAteCV4Ab2eRzQLKzmkXwdpUChVD1L6upRBRdcmGWUwlDRRkbnoEjC1s/SgmkRdM9zg== X-Gm-Message-State: AOJu0YzTn3H8qS71YG7+zyFOzLGzhgEY42C+venIFay5kf+/VFutNWfs rABqWf92LmFp2jXYpuSLQyWfD0Rqd9sUZrVsmMDkWd5TbLL9Vb+J70kVpmzEyx4OqJdegTnfQUG r X-Google-Smtp-Source: AGHT+IGMKent0y5+d712rV157ro50tteaT7iALlT9p6G6N21wZ5FvY8p31VZWC1tP1MhiFwnv7+z+g== X-Received: by 2002:a05:6512:4dd:b0:516:d029:b51e with SMTP id w29-20020a05651204dd00b00516d029b51emr8019855lfq.60.1712676560602; Tue, 09 Apr 2024 08:29:20 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id a16-20020ac25e70000000b005159412ab81sm1579990lfr.216.2024.04.09.08.29.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 08:29:19 -0700 (PDT) From: Dmitry Baryshkov Date: Tue, 09 Apr 2024 18:29:16 +0300 Subject: [PATCH v2 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: <20240409-qcom-ucsi-fixes-bis-v2-1-6d3a09faec90@linaro.org> References: <20240409-qcom-ucsi-fixes-bis-v2-0-6d3a09faec90@linaro.org> In-Reply-To: <20240409-qcom-ucsi-fixes-bis-v2-0-6d3a09faec90@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=1312; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=Qii41m4WQHeAZjiOSBCpdD4P8rWOw8ayDA/3aiWLd8s=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmFV7NfOogr91/8Kf+FoWNU3eahnqt2+8+GmUBf 1bZb1X99uiJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZhVezQAKCRCLPIo+Aiko 1foKCACKFkuLgNblvsbMUbIOPyJPkyBv80SJal1FZyJm7wAjvXqbqKaNM40PqGlByQHjZ3zcFuq KCpCQw03UbOYRvhnRSNNFptDsnxLdtFXTrp9hhcfNioicXaw22I3GL0UxcYNNCQDQjvjnM+UAm7 rU4d4GlcxbtlWV2oi/WrUlSFYuDC8pm8VAz5qPC/ZPSAAinWlkjLPm769thDt/W1zfYzO1m2tDp 8kVfTxwg7hYrvcEUsbq4huiQnxtPTBvFI3rB4NmNoPYqTd5wr2xqkQPdHfFz4ZKSZdw2txDvm3s HKdx2E0KR7QCgFoORL4mtqKvGAue+efT4KC/y4aNXNHNTy8A 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") Reviewed-by: Heikki Krogerus 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 Tue Apr 9 15:29: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: 787273 Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (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 B63D413BC0F for ; Tue, 9 Apr 2024 15:29:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712676565; cv=none; b=q2XTWZfBKBtcuyCxuJdw1WpyqaylPf/oxxa66J5O4YPUubCH47RaHoV0eHNmQletwC2YTjjd8um5JPDmO9YM6g6QxzSbZ/3NKfjW8nTJS3ouOZKM2rFtNuGhhEivHDLZGO37MAEYZoLY4yRjW6249zDqUakiQrP4FQIuXvstkLc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712676565; c=relaxed/simple; bh=BNm8ROtwyDTiLNn0p6MCrlMzrWYQbz+nw3m8owL6V+Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=q/VJuYQexlGsp/yDoArjnSY+EDiH69xanr+0tW2lxb7js6M6A9x69oPOSu9WEUcXrHUBbxX1Suqb/gu10NVTdXURqgEgJuXEzKJE2sOHLYnhlhhrBUG1kdhm+doISyvUSiOhdtJRn9td9YSjwjcKHBvcoT0PoExiYdpmTlfW7ok= 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=vk+TOy4R; arc=none smtp.client-ip=209.85.167.46 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="vk+TOy4R" Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-516a01c8490so5636295e87.1 for ; Tue, 09 Apr 2024 08:29:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712676561; x=1713281361; 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=zFKPCK/kCcXWFoB49FvlrDe+DKAuZG+D+gWim+ikCqY=; b=vk+TOy4ROsaimM1gH/mpDCbKtfYy+g9QRuxCK+n9ay2UNcxoDQgWGjW7/cBqu1BGTx sOdF0s9Ao28CKZ0zW9MXojwj3ciiXDwYlIXL1xsMqtbmB0Oai6zehBal+r7mDVlyECTk /r0c5Q/G4/WdJTFlUqXwFLWnuTxK4sll6c72ETg6rDlHDgECPu6r2VliAXvmmBeXxPjl qt5w5E9PqiwwrRritesv8+eyAB03YSTGJK5lNMsy8ZSfQOzz1dY0OzTXZQJFEYkELEAy /hj8cae11fk9xr6sG1TqMNvdSCmZjiBh87+H8uWKiGuQC84jQPDzuIw14KzzN63o/g0o desA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712676561; x=1713281361; 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=zFKPCK/kCcXWFoB49FvlrDe+DKAuZG+D+gWim+ikCqY=; b=wwS/p9EOg0mvw7uoQC9T5z5HDLUIY/u+2aVtnfqU66K0HVee6QJthhlJ/d3gobXpLT VNXKStccZjaKhuTsgUNb7mMiHqvK61z4ld9tZhNc+07DbrN1xHJQuK9OCz0F6qBSPh4y thwPhMAkC3jbBRwxyZh65WyS0AnGBeap6LX+3tGLErU7vJ8AXgKWEe7hsd36WlhyZcMw FM5cU0pvwpBVHEZHDZQpHIsUWytS6ozMSfy456TdHj8wfC58Gun1GEtha9agPbN3U5/9 plGRH5uRspmk7ahp3jlAjoM3B0unAMGkIQ2bbPOJ0WmrvCf3xIC0Qz5YDDCY0WTUetI4 Peyw== X-Forwarded-Encrypted: i=1; AJvYcCUKPokIz73DuQrZv41MOUt1kGxzCWuxRfREKCV1Zahd2qhRwNrF2e3JTDHyZDdyBvr+hjSclzH07iKLFdcsrkQMrpwSiS6PyPQzUmZW1g== X-Gm-Message-State: AOJu0Yw/nU1+2ui1QOIHU/L25YlIf1rpYu/ayIV5wKdGihenca6EcJT5 3pGvpxSW1mJNblVclwSW56Q6w7RdNX4t+HBGQdezIh0y2KsDEJDLNeX3Su5FrgTAUAel7z3+JjS I X-Google-Smtp-Source: AGHT+IGrN5NpwE63/zWrefF7zvceQfErmZ+uxtO0K+Lg3qtbyaNLSZqS/NwrpoaR8fhAE2ihAqZfKQ== X-Received: by 2002:ac2:5333:0:b0:515:c0cb:3ca2 with SMTP id f19-20020ac25333000000b00515c0cb3ca2mr1064006lfh.16.1712676561626; Tue, 09 Apr 2024 08:29:21 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id a16-20020ac25e70000000b005159412ab81sm1579990lfr.216.2024.04.09.08.29.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 08:29:20 -0700 (PDT) From: Dmitry Baryshkov Date: Tue, 09 Apr 2024 18:29:17 +0300 Subject: [PATCH v2 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: <20240409-qcom-ucsi-fixes-bis-v2-2-6d3a09faec90@linaro.org> References: <20240409-qcom-ucsi-fixes-bis-v2-0-6d3a09faec90@linaro.org> In-Reply-To: <20240409-qcom-ucsi-fixes-bis-v2-0-6d3a09faec90@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=1164; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=BNm8ROtwyDTiLNn0p6MCrlMzrWYQbz+nw3m8owL6V+Q=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmFV7N79gbDsQrhnblF1gIzFA8DE+OueeVX7arc QxngILwJl2JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZhVezQAKCRCLPIo+Aiko 1YTxB/4wikeUBRV/sSCWxse4ontdcdTMuUnGlUlsd5NfDvVUE2jvv5jRtZdQsDnfyZNsmuTX2OR IgSIN8GZvCuflCgugL+gGdP6dP351w6MwoXNIMqCdpp360+3fK5FEIHzaR9ncRCf3TGbRTGQk6I p98t2sp81jLx2wOTwlj0WyPC+XMRbBUxPFprHuew4zieaoWH2IAFSJYfQt8JuZA/vIdN3jx92zZ /lxlTqFeD71oslhtZtfA92CB3DfPcP9eiwzwlhih71fYW8Ll8g9rOIlc7Jujh0hLkOKV7gqTx8r +LdtBFjNWbMtAmgK7CGBw6cWPxO7iM68kK808wdwE8X9kCOa 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. Reviewed-by: Heikki Krogerus 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 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 Tue Apr 9 15:29:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 787603 Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (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 694F613C813 for ; Tue, 9 Apr 2024 15:29:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712676566; cv=none; b=s0TWfgHERLx5drXW6Llr93e3AxkWNPCOwZHo03IhF9hG6NfA43dc8cd4wpyd2rQzrClNgKh9WyFTyS/zi2oCJTcrvMdLkm2PJR/WLtcQV68kd6Y4+hlkVf8o1pLpMG+J/8CD7aCaGIlKdy3pmEbAUlyRRz4aQKEB8SGjIqXeyCs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712676566; c=relaxed/simple; bh=oepvaY2/VOteNy8Xi3leUDDFpbyZF3Ik3OJOE9wvk9o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EIgq02Kp1OIPneIzw8zBHsxGSaEVKiWpx736K2g8TsoY2xP5XdyP/kL9IqCeyEDQ+TKKYbTEh7aRzLSW4+EJrzmCYgMQW3cbe40P/hFDS+O44BYHdNJE1BUG/vqXBthJ2qJx0MPIxSX3q3qe0LcreROefdDOVR2/U8LzMpqUNk4= 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=SuRiQqa9; arc=none smtp.client-ip=209.85.208.176 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="SuRiQqa9" Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2d8863d8a6eso41061331fa.3 for ; Tue, 09 Apr 2024 08:29:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712676562; x=1713281362; 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=oFHcZaaVDW076N+4Kkfs0Y536W5JnS9HZUoI18BuVEQ=; b=SuRiQqa95RRH/pWHHHoUC42pIZH90G6SDAT4Y2FiQDSMnHhGZjHkFkrqVNwna+zUOJ /EW6LdZpiKtPaCaPhtz7g02BAtieoFeBRenHX6TGiXA/s/HBkzdQFultp/eG+E9HgreN OgkTPtm+0s19gQE49pAAZiRh/YzkMNBB+XyZa6+pZcxV54gc7xeCpu2js/MKHx+LwnG5 Nh1j77FCNRUjFVd66PU87ww998QI4R4H2Zp5vo8gdotv0sCw24x5hQIKNcmF2jPGBwYq snZP4sWRzVQkII6fpfBKDc0uesYQXy02BNH1NDyIuv6v+ZwH/BwXEtG5MLSRft5e9Krl vlAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712676562; x=1713281362; 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=oFHcZaaVDW076N+4Kkfs0Y536W5JnS9HZUoI18BuVEQ=; b=r6GyDiNYeUtXf1zF+uRBUCQT26ApUGPOtuc3mFWuJB1EMgrNvoUSO9J6gNwNyAuPEi SB825BIvKBwkUy6Ig8hES1fFKeiqFUqEtuOeRFTvLHLY3FuRLDAiwq7nhcOAM3AJE4RY d+RLhSqmsa61AV3tNzVQynbCNHJ/BMCVCCHltGB35LBAZsbaK+3Siiu6hYMG91MTPxrt WPrFFc6lG1hGqMNlCGns0AgyzTiAklfHrB3mibl1qou1VjKR4+iBhSasP84EfzIbiw7m he5yZlXuh7064OPB2cQBuHCzK+vKhSDB82sGNE1mckM4RC33sYAxJAjLvee5bvubN7RY l0EQ== X-Forwarded-Encrypted: i=1; AJvYcCWZOTpFzUV8Q3OtWNkPFiLWmTDy9wwyQoYVfPIWMnp+5xYI4b7Po8V+6vnfm0uRb4S0Fz+LN2wrNEtvwZFVkSEGmfchZ0YBl7v/Y8vD8w== X-Gm-Message-State: AOJu0YzPBsPI345Hz7tQKWvOiMxjqrfBsGkMelpHe5PQK1MW9ud/GUmD YLuMW/h0OdOf0d+bulXydmIjjYXhu04Stp/5xYc4uyYtJKkIUXPOzH2vDymOQzeWsIs6g3oALKm K X-Google-Smtp-Source: AGHT+IG3J5+oTY8k82U26bGqhj0qhc6r1PMbTssB72gqdqfofcyL2lFLRihn120L0oVWy1CZVyRT/Q== X-Received: by 2002:a19:8c09:0:b0:513:da24:19ff with SMTP id o9-20020a198c09000000b00513da2419ffmr8284672lfd.38.1712676562383; Tue, 09 Apr 2024 08:29:22 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id a16-20020ac25e70000000b005159412ab81sm1579990lfr.216.2024.04.09.08.29.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 08:29:21 -0700 (PDT) From: Dmitry Baryshkov Date: Tue, 09 Apr 2024 18:29:18 +0300 Subject: [PATCH v2 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: <20240409-qcom-ucsi-fixes-bis-v2-3-6d3a09faec90@linaro.org> References: <20240409-qcom-ucsi-fixes-bis-v2-0-6d3a09faec90@linaro.org> In-Reply-To: <20240409-qcom-ucsi-fixes-bis-v2-0-6d3a09faec90@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=1866; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=oepvaY2/VOteNy8Xi3leUDDFpbyZF3Ik3OJOE9wvk9o=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQ5po3Fld0cp+TSFbtrecTsLtOenWejWJ81UPxTGpy2/+n RX1MqGT0ZiFgZGLQVZMkcWnoGVqzKbksA87ptbDDGJlApnCwMUpABNRm8T+m8XBodAtJUb5A5O3 cGcAx7oD2oa33ir/fvL+8SEHPQO5po9T22MtmGz1Gy4/nqrflP1Cn91qznwvp8tTd1g9nqNTU1X iYV50ROjrzlkism26Wbu9P34RPlYxe3nzz1+9CzZPSdS9ejxAi39N4u6PKu51nvcT/Ng4rqjHb3 dynLy+/fqWMyyyx3hYrr9/tdrKfFtJzhOzkwlm2/s82/+L9/26z21YdWm39P+9E624V/9dxujos Typ46NPcs2B+Q18gVvrVhVvYU+XTV/zWiUpPkQo01xK1rxNLvaSTez/D5IxzrXmPK1l4vPY2JQU t3+03fA2edZsP1G7yBVLD6RkhtbrSN99u+ZEnOzTbVMB 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. Reviewed-by: Heikki Krogerus Signed-off-by: Dmitry Baryshkov --- drivers/usb/typec/ucsi/ucsi_glink.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c index 9ffea20020e7..fe9b951f5228 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,11 +244,8 @@ 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 && - (cci & (UCSI_CCI_ACK_COMPLETE | UCSI_CCI_COMMAND_COMPLETE))) { + if (ucsi->sync_pending && + (cci & (UCSI_CCI_ACK_COMPLETE | UCSI_CCI_COMMAND_COMPLETE))) { complete(&ucsi->sync_ack); } }