Commit 2b8c956e authored by Badhri Jagan Sridharan's avatar Badhri Jagan Sridharan Committed by Greg Kroah-Hartman

usb: typec: tcpm: Skip sink_cap query only when VDM sm is busy

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: 8dc4bd07 ("usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)")
Acked-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: default avatarBadhri Jagan Sridharan <badhri@google.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210318064805.3747831-1-badhri@google.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f09ddcfc
...@@ -5173,7 +5173,7 @@ static void tcpm_enable_frs_work(struct kthread_work *work) ...@@ -5173,7 +5173,7 @@ static void tcpm_enable_frs_work(struct kthread_work *work)
goto unlock; goto unlock;
/* Send when the state machine is idle */ /* 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; goto resched;
port->upcoming_state = GET_SINK_CAP; port->upcoming_state = GET_SINK_CAP;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment