Skip to content

Commit 2e2b8d1

Browse files
kyletsoadlgregkh
authored andcommitted
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: 8dea75e ("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>
1 parent e89baeb commit 2e2b8d1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/usb/typec/tcpm/tcpm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2390,7 +2390,7 @@ static void tcpm_pd_data_request(struct tcpm_port *port,
23902390
port->nr_sink_caps = cnt;
23912391
port->sink_cap_done = true;
23922392
if (port->ams == GET_SINK_CAPABILITIES)
2393-
tcpm_pd_handle_state(port, ready_state(port), NONE_AMS, 0);
2393+
tcpm_set_state(port, ready_state(port), 0);
23942394
/* Unexpected Sink Capabilities */
23952395
else
23962396
tcpm_pd_handle_msg(port,

0 commit comments

Comments
 (0)