From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E794414A0B3; Tue, 25 Jun 2024 09:38:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719308307; cv=none; b=sszXCf8Iw0q90ry8AM9myJU+D4O5jfyXC4/uulFvJElpx4rckmu7io5Xw93+YXGPfbmc+L29kxR60Gkt9g4dUfurn2QB6ZynFtmaIBuwc62EXFZDYzFRve/oJ5+rSmhDtEhtUz9OeuMWUIjl9w+ZK2JSA/NP9JhmBHNmQWUE2As= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719308307; c=relaxed/simple; bh=ulreocO1d1ypiPzy7azovcDUZIMtsvUbLvn9PdfrAHQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DdFy9YY1mxcnGVQjXuGdR2JXWr6mIHkB0OE76mJWsQZpBJxYb09psrkBnWn35uXKn8HfYMikZf1aT2d1mt/ryygGIBVkZ+YQ65HbMLg2cA23hEHLIXsOolpoRxxqzRRrUekp4RIErptVlDSshjrDxqGHWv9NyR9ebyT/KpCe2yk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=GSC3w93N; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="GSC3w93N" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23F44C32781; Tue, 25 Jun 2024 09:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1719308306; bh=ulreocO1d1ypiPzy7azovcDUZIMtsvUbLvn9PdfrAHQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GSC3w93NTb+8XZ6AIPk9Feh0NtburUd/Ttm0NvKYU1b9gOaD+zIIzfvE6YMDQluWf oSvseliZbirPOZnvZChvZbHpN4JCbJ57Ur9YoGvCQeQCGrK8c4C6yWOc5GmOxoBP+l DxG8NNdDPhGSgt8AexB/MIrEcobp8t9BEBavNFfM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dmitry Baryshkov , Heikki Krogerus , Sasha Levin Subject: [PATCH 6.9 077/250] usb: typec: ucsi_glink: drop special handling for CCI_BUSY Date: Tue, 25 Jun 2024 11:30:35 +0200 Message-ID: <20240625085551.021683716@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240625085548.033507125@linuxfoundation.org> References: <20240625085548.033507125@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dmitry Baryshkov [ Upstream commit 1a395af9d53c6240bf7799abc43b4dc292ca9dd0 ] 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 Link: https://lore.kernel.org/r/20240408-qcom-ucsi-fixes-bis-v1-3-716c145ca4b1@linaro.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- 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 0e6f837f6c31b..1d0e2d87e9b31 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); } -- 2.43.0