Skip to content

Commit ad791f5

Browse files
Jos Wanggregkh
authored andcommitted
usb: typec: tcpm: PSSourceOffTimer timeout in PR_Swap enters ERROR_RECOVERY
commit 659f5d5 upstream. As PD2.0 spec ("6.5.6.2 PSSourceOffTimer"),the PSSourceOffTimer is used by the Policy Engine in Dual-Role Power device that is currently acting as a Sink to timeout on a PS_RDY Message during a Power Role Swap sequence. This condition leads to a Hard Reset for USB Type-A and Type-B Plugs and Error Recovery for Type-C plugs and return to USB Default Operation. Therefore, after PSSourceOffTimer timeout, the tcpm state machine should switch from PR_SWAP_SNK_SRC_SINK_OFF to ERROR_RECOVERY. This can also solve the test items in the USB power delivery compliance test: TEST.PD.PROT.SNK.12 PR_Swap – PSSourceOffTimer Timeout [1] https://usb.org/document-library/usb-power-delivery-compliance-test-specification-0/USB_PD3_CTS_Q4_2025_OR.zip Fixes: f0690a2 ("staging: typec: USB Type-C Port Manager (tcpm)") Cc: stable <stable@kernel.org> Signed-off-by: Jos Wang <joswang@lenovo.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Tested-by: Amit Sunil Dhamne <amitsd@google.com> Link: https://lore.kernel.org/r/20250213134921.3798-1-joswang1221@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c8c218d commit ad791f5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/usb/typec/tcpm/tcpm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5541,8 +5541,7 @@ static void run_state_machine(struct tcpm_port *port)
55415541
tcpm_set_auto_vbus_discharge_threshold(port, TYPEC_PWR_MODE_USB,
55425542
port->pps_data.active, 0);
55435543
tcpm_set_charge(port, false);
5544-
tcpm_set_state(port, hard_reset_state(port),
5545-
port->timings.ps_src_off_time);
5544+
tcpm_set_state(port, ERROR_RECOVERY, port->timings.ps_src_off_time);
55465545
break;
55475546
case PR_SWAP_SNK_SRC_SOURCE_ON:
55485547
tcpm_enable_auto_vbus_discharge(port, true);

0 commit comments

Comments
 (0)