Skip to content

Commit f2865c6

Browse files
amitsd2gregkh
authored andcommitted
usb: typec: tcpm: fix state transition for SNK_WAIT_CAPABILITIES state in run_state_machine()
A subtle error got introduced while manually fixing merge conflict in tcpm.c for commit 85c4efb ("Merge v6.12-rc6 into usb-next"). As a result of this error, the next state is unconditionally set to SNK_WAIT_CAPABILITIES_TIMEOUT while handling SNK_WAIT_CAPABILITIES state in run_state_machine(...). Fix this by setting new state of TCPM state machine to `upcoming_state` (that is set to different values based on conditions). Cc: stable@vger.kernel.org Fixes: 85c4efb ("Merge v6.12-rc6 into usb-next") Signed-off-by: Amit Sunil Dhamne <amitsd@google.com> Reviewed-by: Badhri Jagan Sridharan <badhri@google.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20250310-fix-snk-wait-timeout-v6-14-rc6-v1-1-5db14475798f@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c44e3d3 commit f2865c6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/usb/typec/tcpm/tcpm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5117,16 +5117,16 @@ static void run_state_machine(struct tcpm_port *port)
51175117
*/
51185118
if (port->vbus_never_low) {
51195119
port->vbus_never_low = false;
5120-
tcpm_set_state(port, SNK_SOFT_RESET,
5121-
port->timings.sink_wait_cap_time);
5120+
upcoming_state = SNK_SOFT_RESET;
51225121
} else {
51235122
if (!port->self_powered)
51245123
upcoming_state = SNK_WAIT_CAPABILITIES_TIMEOUT;
51255124
else
51265125
upcoming_state = hard_reset_state(port);
5127-
tcpm_set_state(port, SNK_WAIT_CAPABILITIES_TIMEOUT,
5128-
port->timings.sink_wait_cap_time);
51295126
}
5127+
5128+
tcpm_set_state(port, upcoming_state,
5129+
port->timings.sink_wait_cap_time);
51305130
break;
51315131
case SNK_WAIT_CAPABILITIES_TIMEOUT:
51325132
/*

0 commit comments

Comments
 (0)