]> git.itanic.dy.fi Git - linux-stable/commit
usb: typec: tcpm: Fix wrong handling for Not_Supported in VDM AMS
authorKyle Tso <kyletso@google.com>
Fri, 7 May 2021 06:23:00 +0000 (14:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 May 2021 13:52:06 +0000 (15:52 +0200)
commitf1fbd950b59b67bc5c202216c8e1c6ca8c99a3b4
tree2cfc82e491826a66a0a85ddf72d01732be7f7845
parentc34e85fa69b9f4568f19da3af06c3870dd8fcc50
usb: typec: tcpm: Fix wrong handling for Not_Supported in VDM AMS

Not_Supported Message is acceptable in VDM AMS. Redirect the VDM state
machine to VDM_STATE_DONE when receiving Not_Supported and finish the
VDM AMS.

Also, after the loop in vdm_state_machine_work, add more conditions of
VDM states to clear the vdm_sm_running flag because those are all
stopping states when leaving the loop.

In addition, finish the VDM AMS if the port partner responds BUSY.

Fixes: 8dea75e11380 ("usb: typec: tcpm: Protocol Error handling")
Fixes: 8d3a0578ad1a ("usb: typec: tcpm: Respond Wait if VDM state machine is running")
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Kyle Tso <kyletso@google.com>
Link: https://lore.kernel.org/r/20210507062300.1945009-3-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpm.c