stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Badhri Jagan Sridharan <badhri@google.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v1] usb: typec: tcpm: Skip sink_cap query only when VDM sm is busy
Date: Thu, 18 Mar 2021 07:54:30 -0700	[thread overview]
Message-ID: <771d9847-6e0b-0aa1-e514-2558b4a59637@roeck-us.net> (raw)
In-Reply-To: <20210318064805.3747831-1-badhri@google.com>

On 3/17/21 11:48 PM, Badhri Jagan Sridharan wrote:
> When port partner responds "Not supported" to the DiscIdentity command,
> VDM state machine can remain in NVDM_STATE_ERR_TMOUT and this causes
> querying sink cap to be skipped indefinitely. Hence check for
> vdm_sm_running instead of checking for VDM_STATE_DONE.
> 
> Fixes: 8dc4bd073663f ("usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)")
> Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/usb/typec/tcpm/tcpm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 11d0c40bc47d..39e068d60755 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -5219,7 +5219,7 @@ static void tcpm_enable_frs_work(struct kthread_work *work)
>  		goto unlock;
>  
>  	/* Send when the state machine is idle */
> -	if (port->state != SNK_READY || port->vdm_state != VDM_STATE_DONE || port->send_discover)
> +	if (port->state != SNK_READY || port->vdm_sm_running || port->send_discover)
>  		goto resched;
>  
>  	port->upcoming_state = GET_SINK_CAP;
> 


      parent reply	other threads:[~2021-03-18 14:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18  6:48 [PATCH v1] usb: typec: tcpm: Skip sink_cap query only when VDM sm is busy Badhri Jagan Sridharan
2021-03-18  7:46 ` Heikki Krogerus
2021-03-18 14:54 ` Guenter Roeck [this message]

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=771d9847-6e0b-0aa1-e514-2558b4a59637@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=badhri@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).