Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4974588pxu; Thu, 10 Dec 2020 09:47:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJwkboMNJtv11AZeZtpBrV29gXl1x1rcizVad5VyYKnhfjgwL/cip6nrOftNc9NqW3hGb+oZ X-Received: by 2002:a17:906:6c8b:: with SMTP id s11mr7378738ejr.187.1607622476539; Thu, 10 Dec 2020 09:47:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607622476; cv=none; d=google.com; s=arc-20160816; b=BDOs0+gF4TALJuYFq9XiAqHZqQUKvzaW3i9L1ObL2FqeTy+VVhs0oq+VGgBoFMi0T4 ImeXCbC6mJFE/lokRpjw3neLninMUTBwBclQXQiR+E5z2CaaRyF/HfGgU5nA1gi+WUtd /dNTe0FJgjEhbHXUGMa/LZwUCsEMf9HpFJXwUuCKSewDwwDf0PDabZu2Ha8KoxIYVInb QHstcEGlVLg9QrA9Ci/0RE8ydfIMGOlAIp4tz3MbOIwPtt64taLONaPew5of1iuMwztz VIIpbVDPy1R21n3IC20h9zL2R4N7G2d+k2fMJEHJe5RB8O0KZQon7Rwhrs5ULB9oVlvv INvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=fa7+K/xpNSS5LcaiVBLzSNpxCsT90qLMzDg/wyKeclQ=; b=Ged/4sI/XALFGLlFbngkprNA7GVmmHaHU0yYojW/FIcAZfCnE2jwJICM2isnzW52YN qYVM03pGuZmZqXQjBt3fE84oIuaZGRcbhJcuCvtfRzt8wwThAdDZ7nV4/5mQ/NlDsqTx JTgelN3364GRDFobhkkhXMUojMvtCA4LapcBEkLIPhY9MpMmcy7gMSmLvZReVVCxJwVk ZMrz4tENN1t06HpLIIrSawcODqUS1Xr9b3b9rFygoLuzwX3lu8QTEGMJWjKVgjE+nNke PnpCZfOfELi5R76IfQGux/fpMId8Gg6ySzWo/W/+SWdCgLxyXFvFZT43aTwZfb3q6wog fmEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@roeck-us.net header.s=default header.b=VxoT0IGB; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y13si2960467ejw.564.2020.12.10.09.47.31; Thu, 10 Dec 2020 09:47:56 -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=fail header.i=@roeck-us.net header.s=default header.b=VxoT0IGB; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392801AbgLJRoW (ORCPT + 99 others); Thu, 10 Dec 2020 12:44:22 -0500 Received: from gproxy7-pub.mail.unifiedlayer.com ([70.40.196.235]:33331 "EHLO gproxy7-pub.mail.unifiedlayer.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392468AbgLJRoK (ORCPT ); Thu, 10 Dec 2020 12:44:10 -0500 Received: from cmgw14.unifiedlayer.com (unknown [10.9.0.14]) by gproxy7.mail.unifiedlayer.com (Postfix) with ESMTP id C5C23215CC4 for ; Thu, 10 Dec 2020 10:43:27 -0700 (MST) Received: from bh-25.webhostbox.net ([208.91.199.152]) by cmsmtp with ESMTP id nPyRkkkpZwNNlnPyRkvWD8; Thu, 10 Dec 2020 10:43:27 -0700 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.3 cv=A7FCwZeG c=1 sm=1 tr=0 a=QNED+QcLUkoL9qulTODnwA==:117 a=2cfIYNtKkjgZNaOwnGXpGw==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=kj9zAlcOel0A:10:nop_charset_1 a=zTNgK-yGK50A:10:nop_rcvd_month_year a=evQFzbml-YQA:10:endurance_base64_authed_username_1 a=1XWaLZrsAAAA:8 a=_jlGtV7tAAAA:8 a=QyXUC8HyAAAA:8 a=ag1SF4gXAAAA:8 a=dVhFLFTkof1kBHoGy50A:9 a=CjuIK1q_8ugA:10:nop_charset_2 a=nlm17XC03S6CtCLSeiRr:22 a=Yupwre4RP9_Eg_Bd0iYG:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=In-Reply-To:Content-Type:MIME-Version:References :Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding :Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=fa7+K/xpNSS5LcaiVBLzSNpxCsT90qLMzDg/wyKeclQ=; b=VxoT0IGBZU1F9+JVvP2nGv942n snkKMNWW1yf9ohs4AZCdZI/YM5Q+WGX08KSAWRxxSZLyJdIHxSTGhgWN9NCvpvO+SuO3fi0KpIMxB /D22V3MNWpKhBjldXh4RSYfRqVy3IIlooRisVoHttrb6jLJSVCe+HaRgXSM9oNe8W2oFFTYeCiXP/ 2u36Pmuqcnfuts7Wi4/JFsjZYHGIbNBK/rDy5l7iQvC/JE/HCK95jhk4Xjr3Q6zGtzOVzv2uKhTla d+X6ZstbY3xUDeQ76U1y4L4pvnEZL2o64iaQNUYJPNza9aNI3Vgv+vM4Tp6a3KXsBi6Vye+jgrNip U/84MDnA==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:60452 helo=localhost) by bh-25.webhostbox.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1knPyQ-001SPp-Rn; Thu, 10 Dec 2020 17:43:26 +0000 Date: Thu, 10 Dec 2020 09:43:26 -0800 From: Guenter Roeck To: Greg Kroah-Hartman Cc: heikki.krogerus@linux.intel.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, pumahsu , Badhri Jagan Sridharan , Kyle Tso , Will McVicker Subject: Re: [PATCH 2/5] USB: typec: tcpm: Hard Reset after not receiving a Request Message-ID: <20201210174326.GC107395@roeck-us.net> References: <20201210160521.3417426-1-gregkh@linuxfoundation.org> <20201210160521.3417426-3-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201210160521.3417426-3-gregkh@linuxfoundation.org> User-Agent: Mutt/1.9.4 (2018-02-28) 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-BWhitelist: no X-Source-IP: 108.223.40.66 X-Source-L: No X-Exim-ID: 1knPyQ-001SPp-Rn X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 108-223-40-66.lightspeed.sntcca.sbcglobal.net (localhost) [108.223.40.66]:60452 X-Source-Auth: guenter@roeck-us.net X-Email-Count: 12 X-Source-Cap: cm9lY2s7YWN0aXZzdG07YmgtMjUud2ViaG9zdGJveC5uZXQ= X-Local-Domain: yes Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 10, 2020 at 05:05:18PM +0100, Greg Kroah-Hartman wrote: > From: pumahsu > > PD 3.0 spec 8.3.3.2.3, A Get_Source_Cap message is sent > to a UUT that is in the PE_SRC_Ready state. After sending > a Source_Capabilities message, the UUT should then expect > a Request message in response. When one is not received, > the UUT should timeout to PE_SRC_Hard_Reset. > > Cc: Guenter Roeck > Cc: Heikki Krogerus > Cc: Badhri Jagan Sridharan > Signed-off-by: pumahsu > Signed-off-by: Kyle Tso > Signed-off-by: Will McVicker > Signed-off-by: Greg Kroah-Hartman Reviewed-by: Guenter Roeck > --- > drivers/usb/typec/tcpm/tcpm.c | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c > index 0ceeab50ed64..0efda59bb104 100644 > --- a/drivers/usb/typec/tcpm/tcpm.c > +++ b/drivers/usb/typec/tcpm/tcpm.c > @@ -2218,6 +2218,7 @@ static int tcpm_pd_send_control(struct tcpm_port *port, > static bool tcpm_send_queued_message(struct tcpm_port *port) > { > enum pd_msg_request queued_message; > + int ret; > > do { > queued_message = port->queued_message; > @@ -2237,7 +2238,16 @@ static bool tcpm_send_queued_message(struct tcpm_port *port) > tcpm_pd_send_sink_caps(port); > break; > case PD_MSG_DATA_SOURCE_CAP: > - tcpm_pd_send_source_caps(port); > + ret = tcpm_pd_send_source_caps(port); > + if (ret < 0) { > + tcpm_log(port, > + "Unable to send src caps, ret=%d", > + ret); > + tcpm_set_state(port, SOFT_RESET_SEND, 0); > + } else if (port->pwr_role == TYPEC_SOURCE) { > + tcpm_set_state(port, HARD_RESET_SEND, > + PD_T_SENDER_RESPONSE); > + } > break; > default: > break; > -- > 2.29.2 >