usb: typec: tcpm: Send DISCOVER_IDENTITY from dedicated work
authorKyle Tso <kyletso@google.com>
Fri, 7 May 2021 06:22:59 +0000 (14:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 May 2021 13:52:06 +0000 (15:52 +0200)
commitc34e85fa69b9f4568f19da3af06c3870dd8fcc50
tree525016440edfb9a52f45e58e4427d400984fda16
parent1f4642b72be79757f050924a9b9673b6a02034bc
usb: typec: tcpm: Send DISCOVER_IDENTITY from dedicated work

In current design, DISCOVER_IDENTITY is queued to VDM state machine
immediately in Ready states and never retries if it fails in the AMS.
Move the process to a delayed work so that when it fails for some
reasons (e.g. Sink Tx No Go), it can be retried by queueing the work
again. Also fix a problem that the vdm_state is not set to a proper
state if it is blocked by Collision Avoidance mechanism.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Kyle Tso <kyletso@google.com>
Link: https://lore.kernel.org/r/20210507062300.1945009-2-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpm.c