Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5457239pxu; Tue, 22 Dec 2020 18:38:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFhGYyz/VP/W0LY2ohy/eWqtF2rMwTMgakR4EP9BDJ0jwlDkCTJiOaLoYGvqj+mLAKWfGg X-Received: by 2002:a17:906:f1c8:: with SMTP id gx8mr22764562ejb.524.1608691080763; Tue, 22 Dec 2020 18:38:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608691080; cv=none; d=google.com; s=arc-20160816; b=lzCQOqMXVV+nbyxgWDcanxxLWA2dQW6N6qD/FbjhnEL2hUZSWYEWYm/mJY/UZLhSJB 71heDe9u8FlX6lCTqMbBXiMJZYsQDklO8ER3vuNr/RvEIYUv06IicKc+sC2JZcwM/9/w /1UAwMZtA/9Sh/+o0RuJ+UoYGQtpU7jzItrpXtlwdvh44OKB2bleenUUxmMHcA7qX8/k IxqNoNj0VE/wS8goevYioSLWSg6gee9wQX/+MoQQ1MU6YmzywDHKEHkn4ZprjNLJ4teo +aY4opx0jxGXx/23sB7jbu2m0qcucTVQKt8L+LqXXCbL76T4ak1/pKx6lAYqMB2noYbY S0pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Y05cvmS+0X0RvcOGGYFqI1ORkl/DAu6jvGAtnWLhG4c=; b=vtE171HL3dCLAeUSjic8x25Gm07d9TxtfC8Zge5cGmlj9t8UcLuXOuLlDFcVDtL9/O sohWhQ9CYaXqo4Ssl3I+6xoZA6Xu1n/EP1jCUWFEQBUHsBuA6cOFqbrUhBPqLt6HrL88 7wCc+z2qT9pthRa2da00DjJ91WwUtBmdLzth+QCx1tMpvW0v8YjAi0r+ojeR9F0k+Awm XfFYcbAZbrGLEFICXASfr8HT7SEPhctvA0rstBa5cbIulB8/d6mY5UW+uPlwB2lfsEgT bp5snYzLpRMmsHC4xek6ZIhqHXErD1Fk1p75crT5mCEKm5A+6Ngx4HOVOTPtLuWk1xSp 7WlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dBZlGNOD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l26si13135874edv.316.2020.12.22.18.37.38; Tue, 22 Dec 2020 18:38:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dBZlGNOD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728687AbgLWChg (ORCPT + 99 others); Tue, 22 Dec 2020 21:37:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:52234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730180AbgLWCYV (ORCPT ); Tue, 22 Dec 2020 21:24:21 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id F3D9022A83; Wed, 23 Dec 2020 02:24:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608690246; bh=UFGOHJZnX8AwPrZdNDlIgkkbhuOJqGlT3OvDbUNJWOQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dBZlGNODG15HCxxAkPTgFSMyDvTw1U20Zy5cVGcJufoHVxUcahL4Wdfz3u0FiMUsD W2MfFc6ZR5HLD6LDGUaCB5RViR4OtevYqCZRFGGH97dJypizchnIuNN05Sq+PFb5Zo qo+6sFpzFXe62dCiwetbKNDzXU8sy8yQyHF66nF15+YVlCplrIVmJvRw1NXWdxcxFO 3Iai92BFhfIeZQ8vRCk/ycWL9Q1m6N7d4qbYmpENWU+joYpvYES8PwlmK3HNacOPpA JrGDtADMxS2O0S2UmSiyD7Icdx3nHVuzD9qZdNixALAiGMJqM4kjbniN78QOxljunq J8XC+CMcwj+NA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Kyle Tso , Guenter Roeck , Heikki Krogerus , Badhri Jagan Sridharan , Will McVicker , Greg Kroah-Hartman , Sasha Levin , devel@driverdev.osuosl.org Subject: [PATCH AUTOSEL 4.14 58/66] USB: typec: tcpm: Add a 30ms room for tPSSourceOn in PR_SWAP Date: Tue, 22 Dec 2020 21:22:44 -0500 Message-Id: <20201223022253.2793452-58-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201223022253.2793452-1-sashal@kernel.org> References: <20201223022253.2793452-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kyle Tso [ Upstream commit fe79d5de77204dd946cfad76a9bec23354b1a500 ] TCPM state machine needs 20-25ms to enter the ErrorRecovery state after tPSSourceOn timer timeouts. Change the timer from max 480ms to 450ms to ensure that the timer complies with the Spec. In order to keep the flexibility for other usecases using tPSSourceOn, add another timer only for PR_SWAP. Cc: Guenter Roeck Cc: Heikki Krogerus Cc: Badhri Jagan Sridharan Reviewed-by: Guenter Roeck Acked-by: Heikki Krogerus Signed-off-by: Kyle Tso Signed-off-by: Will McVicker Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20201210160521.3417426-5-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/typec/pd.h | 1 + drivers/staging/typec/tcpm.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/typec/pd.h b/drivers/staging/typec/pd.h index a18ab898fa668..62766585e2f98 100644 --- a/drivers/staging/typec/pd.h +++ b/drivers/staging/typec/pd.h @@ -270,6 +270,7 @@ static inline unsigned int rdo_max_power(u32 rdo) #define PD_T_DRP_SRC 30 #define PD_T_PS_SOURCE_OFF 920 #define PD_T_PS_SOURCE_ON 480 +#define PD_T_PS_SOURCE_ON_PRS 450 /* 390 - 480ms */ #define PD_T_PS_HARD_RESET 30 #define PD_T_SRC_RECOVER 760 #define PD_T_SRC_RECOVER_MAX 1000 diff --git a/drivers/staging/typec/tcpm.c b/drivers/staging/typec/tcpm.c index 39f99a80daf73..3a2a9d0ba720c 100644 --- a/drivers/staging/typec/tcpm.c +++ b/drivers/staging/typec/tcpm.c @@ -2710,7 +2710,7 @@ static void run_state_machine(struct tcpm_port *port) tcpm_set_state(port, ERROR_RECOVERY, 0); break; } - tcpm_set_state(port, ERROR_RECOVERY, PD_T_PS_SOURCE_ON); + tcpm_set_state(port, ERROR_RECOVERY, PD_T_PS_SOURCE_ON_PRS); break; case PR_SWAP_SRC_SNK_SINK_ON: tcpm_set_state(port, SNK_STARTUP, 0); -- 2.27.0