Linux USB
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Guan-Yu Lin <guanyulin@google.com>
Cc: linux@roeck-us.net, gregkh@linuxfoundation.org,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	badhri@google.com, kyletso@google.com, albertccwang@google.com
Subject: Re: [PATCH] usb: typec: tcpm: skip checking port->send_discover in PD3.0
Date: Tue, 21 Nov 2023 16:15:53 +0200	[thread overview]
Message-ID: <ZVy7mW1tJVifh/65@kuha.fi.intel.com> (raw)
In-Reply-To: <20231116083221.1201892-1-guanyulin@google.com>

On Thu, Nov 16, 2023 at 04:32:16PM +0800, Guan-Yu Lin wrote:
> The original Collison Avoidance mechanism, port->send_discover, avoids
> the conflict when port partners start AMS almost the same time. However,
> this mechanism is replaced by SINK_TX_OK and SINK_TX_NG. Skip the check
> in PD3.0 to avoid the deadlock when source is requesting DR_SWAP where
> sink is requesting DISCOVER_IDENTITY.
> 
> Signed-off-by: Guan-Yu Lin <guanyulin@google.com>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/tcpm/tcpm.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 058d5b853b57..ff3c171a3a75 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -2847,7 +2847,7 @@ static void tcpm_pd_ctrl_request(struct tcpm_port *port,
>  					   PD_MSG_CTRL_NOT_SUPP,
>  					   NONE_AMS);
>  		} else {
> -			if (port->send_discover) {
> +			if (port->send_discover && port->negotiated_rev < PD_REV30) {
>  				tcpm_queue_message(port, PD_MSG_CTRL_WAIT);
>  				break;
>  			}
> @@ -2863,7 +2863,7 @@ static void tcpm_pd_ctrl_request(struct tcpm_port *port,
>  					   PD_MSG_CTRL_NOT_SUPP,
>  					   NONE_AMS);
>  		} else {
> -			if (port->send_discover) {
> +			if (port->send_discover && port->negotiated_rev < PD_REV30) {
>  				tcpm_queue_message(port, PD_MSG_CTRL_WAIT);
>  				break;
>  			}
> @@ -2872,7 +2872,7 @@ static void tcpm_pd_ctrl_request(struct tcpm_port *port,
>  		}
>  		break;
>  	case PD_CTRL_VCONN_SWAP:
> -		if (port->send_discover) {
> +		if (port->send_discover && port->negotiated_rev < PD_REV30) {
>  			tcpm_queue_message(port, PD_MSG_CTRL_WAIT);
>  			break;
>  		}
> -- 
> 2.43.0.rc0.421.g78406f8d94-goog

-- 
heikki

  reply	other threads:[~2023-11-21 14:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-16  8:32 [PATCH] usb: typec: tcpm: skip checking port->send_discover in PD3.0 Guan-Yu Lin
2023-11-21 14:15 ` Heikki Krogerus [this message]
2023-11-21 14:47 ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZVy7mW1tJVifh/65@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=albertccwang@google.com \
    --cc=badhri@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=guanyulin@google.com \
    --cc=kyletso@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox