Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1671766pxj; Wed, 19 May 2021 11:06:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxq+vW8pjUHNK+g/dZo/8+/OPHLHrovR+gohtuL/F782SVWJI5PUyJmaMY/Sgjkk+4F/A3w X-Received: by 2002:a17:906:2ed0:: with SMTP id s16mr356297eji.543.1621447617277; Wed, 19 May 2021 11:06:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621447617; cv=none; d=google.com; s=arc-20160816; b=nFwvqBPToecxJ15vgtpzOKt079uss08/GPbM+m6doToBqkKVausWMfBtV4PbFub7lm AFNNiJ3XI/YEvGf8MLd0iuN0S+EVfurqN7ib8tMCgra9Lf15MpIs4p4ZYZp5qwZFYs84 untjoQ0CzbOF1zZZi2yz/O0mS/6V/rm9bCVdfpvUEbcJGNSMvzwbMN9JgVDCVxtLRi5t /FisXIMdUbVq+Ys20miyaPLhPXivStGSy8DMWCfY0bbIbDNPYVcDpvjDw7r0gvKvoJk9 v98WhbYoMdGXJLmTD9sZioiKmpMP/z7m2YV15w5jArWQEm4B1bsrfqoPX5znbQQwqA84 mOgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=LKzb3cEeBhZ6RUhix/n2qV08T62ez8FPfGPKlU6a/fw=; b=TkPHrg2wzsQphCURDjvmiknSkX5ulGDBEGuZs4l+O9BzAaxXOK5Zp134i/QeDodjGN eeVIS3N2Q7cuOoAIVahUjEqnnzUnoInsmQAfw7TCN85P1KRdKpnlQVZ4mM2NWIslqOnd stKB7y2MZY+O6xwtFG/Z9BuFJ8qJXVESMAxDrPYT/8PGH6GJ46p11fQKJn8x2j6VKj7A bG2RcXeZcC+5UkbYM5ymn75csWBJCQLxhkKGgOohP/HW6+VWuRoIG4l6w17QFnQQnX1/ yrrtj/QP/qv92qrj5/AFcHwnuh2vUTnGiBVV/hzi8Rt1YPnCzGBfmXvmGIQ0eO8wSPDX 0Mbg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a6si518523edk.546.2021.05.19.11.06.33; Wed, 19 May 2021 11:06:57 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349051AbhERM2n (ORCPT + 99 others); Tue, 18 May 2021 08:28:43 -0400 Received: from mga07.intel.com ([134.134.136.100]:50359 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234046AbhERM2m (ORCPT ); Tue, 18 May 2021 08:28:42 -0400 IronPort-SDR: MeeiMj8NAYDCbD+Qfwz/P6h4KdaNdPwFBLfsIwq6dbyRw44Q/pBil6ankwR73JxmjOcPPWSorn p7/udPGD03RA== X-IronPort-AV: E=McAfee;i="6200,9189,9987"; a="264612138" X-IronPort-AV: E=Sophos;i="5.82,310,1613462400"; d="scan'208";a="264612138" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2021 05:27:23 -0700 IronPort-SDR: pDdH19FKllWnrGnaztzgLwXBlWUo4VHxEZYVEc7MJE2vTEp49Q8DuHbiPXS++me59mnDWBUpBO LjviaGqTYGCA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,310,1613462400"; d="scan'208";a="541947605" Received: from kuha.fi.intel.com ([10.237.72.162]) by fmsmga001.fm.intel.com with SMTP; 18 May 2021 05:27:21 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 18 May 2021 15:27:20 +0300 Date: Tue, 18 May 2021 15:27:20 +0300 From: Heikki Krogerus To: Badhri Jagan Sridharan Cc: Guenter Roeck , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Kyle Tso , stable@vger.kernel.org Subject: Re: [PATCH v2 1/4] usb: typec: tcpm: Fix up PR_SWAP when vsafe0v is signalled Message-ID: References: <20210517192112.40934-1-badhri@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210517192112.40934-1-badhri@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 17, 2021 at 12:21:09PM -0700, Badhri Jagan Sridharan wrote: > During PR_SWAP, When TCPM is in PR_SWAP_SNK_SRC_SINK_OFF, vbus is > expected to reach VSAFE0V when source turns off vbus. Do not move > to SNK_UNATTACHED state when this happens. > > Fixes: 28b43d3d746b ("usb: typec: tcpm: Introduce vsafe0v for vbus") > Signed-off-by: Badhri Jagan Sridharan > Reviewed-by: Guenter Roeck Acked-by: Heikki Krogerus > --- > Changes since V1: > - Fixed type s/of/off in commit message. > - Added Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/tcpm/tcpm.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c > index c4fdc00a3bc8..b93c4c8d7b15 100644 > --- a/drivers/usb/typec/tcpm/tcpm.c > +++ b/drivers/usb/typec/tcpm/tcpm.c > @@ -5114,6 +5114,9 @@ static void _tcpm_pd_vbus_vsafe0v(struct tcpm_port *port) > tcpm_set_state(port, SNK_UNATTACHED, 0); > } > break; > + case PR_SWAP_SNK_SRC_SINK_OFF: > + /* Do nothing, vsafe0v is expected during transition */ > + break; > default: > if (port->pwr_role == TYPEC_SINK && port->auto_vbus_discharge_enabled) > tcpm_set_state(port, SNK_UNATTACHED, 0); > -- > 2.31.1.751.gd2f1c929bd-goog -- heikki