[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201210174326.GC107395@roeck-us.net>
Date: Thu, 10 Dec 2020 09:43:26 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: heikki.krogerus@...ux.intel.com, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org, pumahsu <pumahsu@...gle.com>,
Badhri Jagan Sridharan <badhri@...gle.com>,
Kyle Tso <kyletso@...gle.com>,
Will McVicker <willmcvicker@...gle.com>
Subject: Re: [PATCH 2/5] USB: typec: tcpm: Hard Reset after not receiving a
Request
On Thu, Dec 10, 2020 at 05:05:18PM +0100, Greg Kroah-Hartman wrote:
> From: pumahsu <pumahsu@...gle.com>
>
> 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 <linux@...ck-us.net>
> Cc: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
> Cc: Badhri Jagan Sridharan <badhri@...gle.com>
> Signed-off-by: pumahsu <pumahsu@...gle.com>
> Signed-off-by: Kyle Tso <kyletso@...gle.com>
> Signed-off-by: Will McVicker <willmcvicker@...gle.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Reviewed-by: Guenter Roeck <linux@...ck-us.net>
> ---
> 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
>
Powered by blists - more mailing lists