Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp245571lqr; Wed, 5 Jun 2024 05:05:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVaIYBP4CORh2/nuv0GsM1woGhs4IpN4zeuiydnFbMaeEYg0KTHE7sG/ABetnOWLcAvloEvQB2zZQdGiqnqhGxRzX3bzrtfArlLyIuSQQ== X-Google-Smtp-Source: AGHT+IEyhTCYy1HQwYt9niAadpzSI2En9BS0LDBQi5ByyKoW4qQEOWozl6Vbkj8W2Fz4k/DQpY1v X-Received: by 2002:a17:907:c00b:b0:a67:907f:e68a with SMTP id a640c23a62f3a-a699d63f4c3mr274794066b.27.1717589156322; Wed, 05 Jun 2024 05:05:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717589156; cv=pass; d=google.com; s=arc-20160816; b=oPv3cSUtL7L372YGl0ztzTRTt7nzL4MxSZdnXAB7tmtJDNEQl+N9TaTgI1rVZ3VqWr SrcO/wrL3mI3sNvJXRnaCnkE+Sr6gmdEVNaloKtD8IIG2pf75kd1Xd14/NNusIva+IA9 Gcxh0s5EId8Kg4zBi9zM6ymq7P5gEgaXS93h4GwMMScnMdazIckSAFBEf79I6lpRVuXt 2TFADLEWVmPWy7CRgufm7+0EGKYBYInsTleWODItr5AyXEfBG/z7MQHQdIYt62XlAj2A HgP/YaUN3g7pDSPs2X0N17LM0PAAGdePC7wiyF+1XKOA9lRbZAbSdik621wXOA8n18vP 8BxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=LnrnUURWYlyfqbInh6oRjNmB9/895mN3bBRUgvXUwlI=; fh=pRhFSAo042dlJ47GCG3fS5rcvhd3C1MhuLg1xLEnZZw=; b=NhnXHK1Kotsb36JIQnEfBgIIVcSBGx2p4BpYTdkEH7qYhobYC7IWa+245iXjoJmw9N kjYF/kK6CyRechS8T6VLMA495SLSUBfKbbQK9W/qH+K8DWrcH0DskH8qPyqS9tN6MnOE ZWvbsqxyaw+TyBJBXcejLhEjLQoek7fMPvj/qqqR2tIlwGhgpe+4BaFZY3msI9TEkjGX hGs2lS4J75WUTe1jXzgynGw0HrtFFqk7ZzlNxWbVNSPmuunysAMlVwnKYLsB3/RY/44M loRXx5iTDuR+6eTzzA0KALAQPR47zropSqXuHmMgDVaMGkOo09gh5F8KeQeV5eAmtuJi b2sg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="K4hGva/k"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202361-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202361-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c71df820csi5645466b.447.2024.06.05.05.05.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 05:05:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202361-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="K4hGva/k"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202361-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202361-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 113571F24CB1 for ; Wed, 5 Jun 2024 12:05:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 210D5188CC2; Wed, 5 Jun 2024 11:52:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="K4hGva/k" 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 481AD1ABCD4; Wed, 5 Jun 2024 11:52:38 +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=1717588358; cv=none; b=JGo7oEWGNECT/33ot07+Q/Jm9tStGFX7vP1TeX7Qak7y+es47C3gubngtutYcfGUJOu6oE2ZGRkNIidbT1NjW12M9bmXfsANu4UCpmWMAMX9LPY9lgJiRX1rU1tlPRJZPs0zaix8/2DTd/xi8U6niNw65DpE+K85slWkeXyDA5A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588358; c=relaxed/simple; bh=OsickX/htmlX0C8mCIZ80mo7em2WxoqTyOV3m747KWQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WsNWex2bGtZYy+qXAnkX1FsTxK8RKEKjouWvfeoSvePWCDwBbxlQesAVQDrco5z68KDACXblkD8XbrrRfOb3H+UVet3K6EbqhBapc+h0LXdtPdUIG++GoF+3KIC/uZzxqzMn7QieyBA0GMhtuLeMDjV3sR3iKsyVIFmdIrVY0jg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=K4hGva/k; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEE16C3277B; Wed, 5 Jun 2024 11:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717588358; bh=OsickX/htmlX0C8mCIZ80mo7em2WxoqTyOV3m747KWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K4hGva/kQnHcakpQ+3yAMVqby3j4qQ3WQ3yVB2X6HWAieLRQ424hDX7pl7lA+/Wyd GUJaXOKvKOjk4I+t2lD79HsCmlH5yAmSrEaHUpNXJAA0fqp+GjMnDmM5LM42lxih9Q KqG1W0mSGFmsVzfyf7MzV/UPAitWeX7TgmKa4t7Ru500iKYG6CeWhh8EEeg9kNC1b1 +1ggWzvQQ8Jbhf1imUaUXbP1HygE4FLa1ivLLWZJSgVQ1dL4FwM3KBXcVuY0JZRTmP BRNEPyLzSOQxVfk0tfd2uLenc3g7G4tLn6T/hYgUEn88V7IQ+13eGgTfXsKiJirqjm NPK3B6SEzeR1g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dmitry Baryshkov , Heikki Krogerus , Greg Kroah-Hartman , Sasha Levin , neil.armstrong@linaro.org, robh@kernel.org, johan+linaro@kernel.org, quic_kriskura@quicinc.com, linux-usb@vger.kernel.org Subject: [PATCH AUTOSEL 6.6 06/20] usb: typec: ucsi_glink: drop special handling for CCI_BUSY Date: Wed, 5 Jun 2024 07:51:49 -0400 Message-ID: <20240605115225.2963242-6-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240605115225.2963242-1-sashal@kernel.org> References: <20240605115225.2963242-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.32 Content-Transfer-Encoding: 8bit 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 894622b6556a6..ee239a6b8f61a 100644 --- a/drivers/usb/typec/ucsi/ucsi_glink.c +++ b/drivers/usb/typec/ucsi/ucsi_glink.c @@ -175,7 +175,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); } @@ -242,10 +243,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