usb: typec: tcpm: Respond Wait if VDM state machine is running
authorKyle Tso <kyletso@google.com>
Thu, 14 Jan 2021 14:50:53 +0000 (22:50 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jan 2021 11:23:33 +0000 (12:23 +0100)
commit8d3a0578ad1aaadb1c2a2fcc4c51454cbbce2eca
tree408d6efdcf05bcd2846d62c7c1bc3be9b3ec3c2e
parent8dea75e11380fc59656fe965766ac192a831455f
usb: typec: tcpm: Respond Wait if VDM state machine is running

Port partner could send PR_SWAP/DR_SWAP/VCONN_SWAP/Request just after it
enters Ready states. This will cause conficts if the port is going to
send DISC_IDENT in the Ready states of TCPM. Set a flag indicating that
the state machine is processing VDM and respond Wait messages until the
VDM state machine stops.

Tested-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Kyle Tso <kyletso@google.com>
Link: https://lore.kernel.org/r/20210114145053.1952756-4-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpm.c