Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp240965lqr; Wed, 5 Jun 2024 04:59:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVRNvAej+WwSy7Qvdn4EZwhDr7PWXV4K7ZcJjc8qNmnbEx1YPQRx+kyocKYBKDfgivGqjuPz3rvCjbcK10kQ8R8HQg0jh7Vp0j0WW3Pcg== X-Google-Smtp-Source: AGHT+IEk3aeQASNlqIleV0nxogmJjb7ldUpaC7XC/YsSMld7rldFb1gnxa8u30+J56G9+On1hP8l X-Received: by 2002:a05:6820:16a9:b0:5b2:ff69:97c3 with SMTP id 006d021491bc7-5ba78f2338bmr2937299eaf.2.1717588799471; Wed, 05 Jun 2024 04:59:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717588799; cv=pass; d=google.com; s=arc-20160816; b=MZAuejTKaZpnglKtDzmn5F9rPaXmKr/3zm85fANyuA3S40E/F81+O9dfVZjA4jdADU k1kM32Q2mC6Zk0gZi6QIstkz0YnMsQhxEBkd2PvY2rJwbGO76Vf9qAt9tiHa6TJ+DMZ5 pgxgXWEd8nVCsIsNYantTgnAXDAo+z2JT/mmwF1laIb7Mk6TyilIM3neFFuEbHDBAScu 7TdQF/29hk5G8JXiNC3NwdaAbiHP3Ob/O+tgbxVerzEWuj7u+NrB+nP+4Vp3S/y3g0cY D3iK0g2/0zXfRzdpkwYr4eH4V9O5zgmS48BKuiS6a8YASueV8j2f1GfJpn1esel/lncg 5MWA== 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=kDCHsYP7zkqV84jWkXJ22GUyUJ7tlFlPwgsmJsH2k20=; fh=QBHr+rvUWaOulanyzblILFhC3Ah8DD7Bm1ehSh5QaSE=; b=GM/8RM7QkROfHZelKuxVRPqqL6/jLaIPCFc505ZwQXHYVeEx5ZHJ+X11abCIruR+c+ LBdOPAnrVNTMjsLUgJiBocZo2abcL9b/0qRjTYBE2jJroe7APBLmb/Enx/495k0syvhz 5gya7+hV8QwJLzG2+3shaoJhHjlmdALIyuJWW+gFfxj5xQpob0XNGe0081EVLnoTDqmw njYMTTMYoepDXHARY7f3F5w8b60DfASufUxOzQ9S6d9wjJw6x3omXDVfx4rMQ98M3zbC LWXgQoKY4nKPYuOX4ZGcIBr6F3j/YDiXMWt0OU3fAJuFWjwytWhIGzgtwfG9/qDAvz+1 B1IA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="V/sxMjPY"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202338-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202338-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43ff25b2dc4si138479591cf.717.2024.06.05.04.59.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 04:59:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202338-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="V/sxMjPY"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202338-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202338-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2FDC41C2338A for ; Wed, 5 Jun 2024 11:59:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F240E196420; Wed, 5 Jun 2024 11:51:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="V/sxMjPY" 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 1949819EEDE; Wed, 5 Jun 2024 11:51:17 +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=1717588278; cv=none; b=ZToUYGvMR73IPaz7NsWOG88flIM/7J2awgxiIRwdra0s8CzSCNzpp1DLX7hK+KBoOSm47esJLnf6XSxKxlOsGHUJbjbuZRP+QE+0Ig2AatDCdxyCSDL2koG7S5P2qoSMsPMRlu+alKan3iAuXDD7J+Yrs4AbQqoebZVkhJwHkY8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588278; c=relaxed/simple; bh=t0vokvuIvTAMl4gK58qFsQK8Hj3e1FRkIYK+llSr3UA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kzmKm8MO7hNnQzIHZVzkgfDma6ypz+urrZulQKZltipzOX2ZMxr8rLIOOKV8/QeJLnUMef3l5qt+KbwDcRC2XYWEiXBY2kK7YRqzyPGQ0MXgVJjdTBg4p9ysu6J+Q/N0JdT6Vzk9ANc6LqcURSZI3b3MpEEIOta0gRismEyIBH0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=V/sxMjPY; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A56BC3277B; Wed, 5 Jun 2024 11:51:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717588277; bh=t0vokvuIvTAMl4gK58qFsQK8Hj3e1FRkIYK+llSr3UA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V/sxMjPYncHTgm3SsljT3Hb+g9r79N9f2jgJjYaNLym+02950tcFPujOvifew2unR FVrzTc3WDa5Ofx3+ww7kof1VXnZRycdAS98aaHKEeJwQujm4zMpIJk5k2HHJjSr/Gu EawNYUuFMXp5MjzjaN3Qz0dDTvGDWAlwe2vM+66iAfiLa8Z0KSUMA7nXqFXj956Okb uGOTbsGJq7iLhkdmODY/8wFb8JU4/39D3pyNoi1QBdcvPr+/AIWKunyLmDgtK+qGZp IoZwNB7rqWnlGuY64t+6oX2nJ0ueuTHAdnxAFe2M2gfXBoafISlcDQf3AnSQrl0g9S bPl+0ACRtjF8Q== 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, johan+linaro@kernel.org, robh@kernel.org, luca.weiss@fairphone.com, quic_kriskura@quicinc.com, linux-usb@vger.kernel.org Subject: [PATCH AUTOSEL 6.8 07/24] usb: typec: ucsi_glink: drop special handling for CCI_BUSY Date: Wed, 5 Jun 2024 07:50:17 -0400 Message-ID: <20240605115101.2962372-7-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240605115101.2962372-1-sashal@kernel.org> References: <20240605115101.2962372-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.8.12 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 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