Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751519AbdH0R1z (ORCPT ); Sun, 27 Aug 2017 13:27:55 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:34119 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751248AbdH0R1y (ORCPT ); Sun, 27 Aug 2017 13:27:54 -0400 Date: Sun, 27 Aug 2017 10:27:52 -0700 From: Guenter Roeck To: Badhri Jagan Sridharan Cc: Greg Kroah-Hartman , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 11/11] staging: typec: tcpm: Switch to PORT_RESET instead of SNK_UNATTACHED Message-ID: <20170827172752.GU22819@roeck-us.net> References: <20170827065233.3524-1-Badhri@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170827065233.3524-1-Badhri@google.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1177 Lines: 33 On Sat, Aug 26, 2017 at 11:52:33PM -0700, Badhri Jagan Sridharan wrote: > When VBUS is not discovered within PD_T_PS_SOURCE_ON although Rp > is detected on CC, TCPM switches the port to SNK_UNATTACHED > state. SNK_UNATTACHED, however does not force TYPEC_CC_OPEN which > makes the partner(source) to think that it is connected. > > To overcome this issue, force the port into PORT_RESET state > to make sure the CC lines are open. > > Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Guenter Roeck > --- > drivers/staging/typec/tcpm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/typec/tcpm.c b/drivers/staging/typec/tcpm.c > index 9e0111dea7c4..47b8fec5ea36 100644 > --- a/drivers/staging/typec/tcpm.c > +++ b/drivers/staging/typec/tcpm.c > @@ -2380,7 +2380,7 @@ static void run_state_machine(struct tcpm_port *port) > 0); > else > /* Wait for VBUS, but not forever */ > - tcpm_set_state(port, SNK_UNATTACHED, PD_T_PS_SOURCE_ON); > + tcpm_set_state(port, PORT_RESET, PD_T_PS_SOURCE_ON); > break; > > case SRC_TRY: > -- > 2.14.1.342.g6490525c54-goog >