[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <771d9847-6e0b-0aa1-e514-2558b4a59637@roeck-us.net>
Date: Thu, 18 Mar 2021 07:54:30 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Badhri Jagan Sridharan <badhri@...gle.com>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH v1] usb: typec: tcpm: Skip sink_cap query only when VDM sm
is busy
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@...gle.com>
Reviewed-by: Guenter Roeck <linux@...ck-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;
>
Powered by blists - more mailing lists