usb: typec: tcpm: Fix wrong handling in GET_SINK_CAP
Subsystems (3)
PATCH 1/1 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.
--- drivers/usb/typec/tcpm/tcpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/tcpm/tcpm.c +1 -1
@@ -2390,7 +2390,7 @@ static void tcpm_pd_data_request(struct tcpm_port *port, port->nr_sink_caps = cnt; port->sink_cap_done = true;if (port->ams ==GET_SINK_CAPABILITIES ) -tcpm_pd_handle_state (port,ready_state (port),NONE_AMS ,0 ); +tcpm_set_state (port,ready_state (port),0 );/* Unexpected Sink Capabilities */ else tcpm_pd_handle_msg(port,
Signature · 1 line
2.31.1.527.g47e6f16901-goog
Quoted 8 lines · Kyle Tso
After receiving Sink Capabilities Message in
GET_SINK_CAPAMS, it is incorrect to calltcpm_pd_handle_statebecause 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")Signed-off-by Kyle Tso <[email protected]>
Quoted 18 lines
--- drivers/usb/typec/tcpm/tcpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/typec/tcpm/tcpm.c +1
-1@@ -2390,7 +2390,7 @@ static void tcpm_pd_data_request(struct tcpm_port *port, port->nr_sink_caps = cnt; port->sink_cap_done = true;if (port->ams ==GET_SINK_CAPABILITIES ) -tcpm_pd_handle_state (port,ready_state (port),NONE_AMS ,0 ); +tcpm_set_state (port,ready_state (port),0 );/* Unexpected Sink Capabilities */ else tcpm_pd_handle_msg(port,
Quoted 8 lines · Kyle Tso
After receiving Sink Capabilities Message in
GET_SINK_CAPAMS, it is incorrect to calltcpm_pd_handle_statebecause 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")Signed-off-by Kyle Tso <[email protected]>
Quoted 19 lines
--- drivers/usb/typec/tcpm/tcpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/typec/tcpm/tcpm.c +1
-1@@ -2390,7 +2390,7 @@ static void tcpm_pd_data_request(struct tcpm_port *port, port->nr_sink_caps = cnt; port->sink_cap_done = true;if (port->ams ==GET_SINK_CAPABILITIES ) -tcpm_pd_handle_state (port,ready_state (port),NONE_AMS ,0 ); +tcpm_set_state (port,ready_state (port),0 );/* Unexpected Sink Capabilities */ else tcpm_pd_handle_msg(port,Signature · 1 line
2.31.1.527.g47e6f16901-goog
Signature · 1 line
heikki