usb: typec: tcpm: Fix wrong handling in GET_SINK_CAP
authorKyle Tso <kyletso@google.com>
Mon, 3 May 2021 17:18:49 +0000 (01:18 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 May 2021 13:00:03 +0000 (15:00 +0200)
commit2e2b8d15adc2f6ab2d4aa0550e241b9742a436a0
tree04fcf42647f1abf1a8ce88cd7449e2f4d6cf1dd0
parente89baeba4f64bab679618b3330cdcda5929fb8d5
usb: typec: tcpm: Fix wrong handling in GET_SINK_CAP

After receiving Sink Capabilities Message in GET_SINK_CAP AMS, it is
incorrect to call tcpm_pd_handle_state because the Message is expected
and the current state is not Ready states. The result of this incorrect
operation ends in Soft Reset which is definitely wrong. Simply
forwarding to Ready States is enough to finish the AMS.

Fixes: 8dea75e11380 ("usb: typec: tcpm: Protocol Error handling")
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>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210503171849.2605302-1-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpm.c