usb: typec: tcpm: Skip hard reset when in error recovery
Subsystems (4)
Badhri Jagan Sridharan
maintainerPATCH 1/1 usb: typec: tcpm: Skip hard reset when in error recovery
Hard reset queued prior to error recovery (or) received during error recovery will make TCPM to prematurely exit error recovery sequence. Ignore hard resets received during error recovery (or) port reset sequence.
``` [46505.459688] state change SNK_READY -> ERROR_RECOVERY [rev3 NONE_AMS] [46505.459706] state change ERROR_RECOVERY -> PORT_RESET [rev3 NONE_AMS] [46505.460433] disable vbus discharge ret:0 [46505.461226] Setting usb_comm capable false [46505.467244] Setting voltage/current limit 0 mV 0 mA [46505.467262] polarity 0 [46505.470695] Requesting mux state 0, usb-role 0, orientation 0 [46505.475621] cc:=0 [46505.476012] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms [rev3 NONE_AMS] [46505.476020] Received hard reset [46505.476024] state change PORT_RESET -> HARD_RESET_START [rev3 HARD_RESET] ```
--- drivers/usb/typec/tcpm/tcpm.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/usb/typec/tcpm/tcpm.c +9 -0
@@ -5391,6 +5391,15 @@ static void _tcpm_pd_hard_reset(struct tcpm_port *port)if (port->bist_request ==BDO_MODE_TESTDATA && port->tcpc->set_bist_data) port->tcpc->set_bist_data (port->tcpc, false); +switch (port->state) { +case ERROR_RECOVERY : +case PORT_RESET : +case PORT_RESET_WAIT_OFF : +return ; +default : +break ; + } +if (port->ams !=NONE_AMS ) port->ams =NONE_AMS ;if (port->hard_reset_count <PD_N_HARD_RESET_COUNT )
base-commit: c70793fb7632a153862ee9060e6d48131469a29c
Signature · 1 line
2.42.0.820.g83a721a137-goog
Quoted 19 lines · Badhri Jagan Sridharan
Hard reset queued prior to error recovery (or) received during error recovery will make TCPM to prematurely exit error recovery sequence. Ignore hard resets received during error recovery (or) port reset sequence.
``` [46505.459688] state change SNK_READY -> ERROR_RECOVERY [rev3 NONE_AMS] [46505.459706] state change ERROR_RECOVERY -> PORT_RESET [rev3 NONE_AMS] [46505.460433] disable vbus discharge ret:0 [46505.461226] Setting usb_comm capable false [46505.467244] Setting voltage/current limit 0 mV 0 mA [46505.467262] polarity 0 [46505.470695] Requesting mux state 0, usb-role 0, orientation 0 [46505.475621] cc:=0 [46505.476012] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms [rev3 NONE_AMS] [46505.476020] Received hard reset [46505.476024] state change PORT_RESET -> HARD_RESET_START [rev3 HARD_RESET] ```
Quoted 3 lines
Fixes f0690a25a140 ("staging: typec: USB Type-C Port Manager (tcpm)")Signed-off-by Badhri Jagan Sridharan <[email protected]>
Quoted 28 lines
--- drivers/usb/typec/tcpm/tcpm.c | 9 +++++++++ 1 file changed, 9 insertions(+)drivers/usb/typec/tcpm/tcpm.c +9
-0@@ -5391,6 +5391,15 @@ static void _tcpm_pd_hard_reset(struct tcpm_port *port)if (port->bist_request ==BDO_MODE_TESTDATA && port->tcpc->set_bist_data) port->tcpc->set_bist_data (port->tcpc, false); +switch (port->state) { +case ERROR_RECOVERY : +case PORT_RESET : +case PORT_RESET_WAIT_OFF : +return ; +default : +break ; + } +if (port->ams !=NONE_AMS ) port->ams =NONE_AMS ;if (port->hard_reset_count <PD_N_HARD_RESET_COUNT )base-commit:
c70793fb7632a153862ee9060e6d48131469a29cSignature · 1 line
2.42.0.820.g83a721a137-goog
Signature · 1 line
heikki
Quoted 19 lines · Badhri Jagan Sridharan
Hard reset queued prior to error recovery (or) received during error recovery will make TCPM to prematurely exit error recovery sequence. Ignore hard resets received during error recovery (or) port reset sequence.
``` [46505.459688] state change SNK_READY -> ERROR_RECOVERY [rev3 NONE_AMS] [46505.459706] state change ERROR_RECOVERY -> PORT_RESET [rev3 NONE_AMS] [46505.460433] disable vbus discharge ret:0 [46505.461226] Setting usb_comm capable false [46505.467244] Setting voltage/current limit 0 mV 0 mA [46505.467262] polarity 0 [46505.470695] Requesting mux state 0, usb-role 0, orientation 0 [46505.475621] cc:=0 [46505.476012] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms [rev3 NONE_AMS] [46505.476020] Received hard reset [46505.476024] state change PORT_RESET -> HARD_RESET_START [rev3 HARD_RESET] ```
Quoted 3 lines
Fixes f0690a25a140 ("staging: typec: USB Type-C Port Manager (tcpm)")Signed-off-by Badhri Jagan Sridharan <[email protected]>
Quoted 26 lines
--- drivers/usb/typec/tcpm/tcpm.c | 9 +++++++++ 1 file changed, 9 insertions(+)drivers/usb/typec/tcpm/tcpm.c +9
-0@@ -5391,6 +5391,15 @@ static void _tcpm_pd_hard_reset(struct tcpm_port *port)if (port->bist_request ==BDO_MODE_TESTDATA && port->tcpc->set_bist_data) port->tcpc->set_bist_data (port->tcpc, false); +switch (port->state) { +case ERROR_RECOVERY : +case PORT_RESET : +case PORT_RESET_WAIT_OFF : +return ; +default : +break ; + } +if (port->ams !=NONE_AMS ) port->ams =NONE_AMS ;if (port->hard_reset_count <PD_N_HARD_RESET_COUNT )base-commit:
c70793fb7632a153862ee9060e6d48131469a29c