Skip to content

Commit a6fe37f

Browse files
Badhri Jagan Sridharangregkh
authored andcommitted
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] ``` Cc: stable@vger.kernel.org Fixes: f0690a2 ("staging: typec: USB Type-C Port Manager (tcpm)") Signed-off-by: Badhri Jagan Sridharan <badhri@google.com> Acked-by: Heikki Krogeus <heikki.krogerus@linux.intel.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20231101021909.2962679-1-badhri@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4105870 commit a6fe37f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

drivers/usb/typec/tcpm/tcpm.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5391,6 +5391,15 @@ static void _tcpm_pd_hard_reset(struct tcpm_port *port)
53915391
if (port->bist_request == BDO_MODE_TESTDATA && port->tcpc->set_bist_data)
53925392
port->tcpc->set_bist_data(port->tcpc, false);
53935393

5394+
switch (port->state) {
5395+
case ERROR_RECOVERY:
5396+
case PORT_RESET:
5397+
case PORT_RESET_WAIT_OFF:
5398+
return;
5399+
default:
5400+
break;
5401+
}
5402+
53945403
if (port->ams != NONE_AMS)
53955404
port->ams = NONE_AMS;
53965405
if (port->hard_reset_count < PD_N_HARD_RESET_COUNT)

0 commit comments

Comments
 (0)