public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: typec: tcpm: Ignore received Hard Reset in TOGGLING state
@ 2024-05-20 15:48 Kyle Tso
  2024-05-21 13:54 ` Heikki Krogerus
  0 siblings, 1 reply; 2+ messages in thread
From: Kyle Tso @ 2024-05-20 15:48 UTC (permalink / raw)
  To: linux, heikki.krogerus, gregkh
  Cc: badhri, linux-kernel, linux-usb, Kyle Tso, stable

Similar to what fixed in Commit a6fe37f428c1 ("usb: typec: tcpm: Skip
hard reset when in error recovery"), the handling of the received Hard
Reset has to be skipped during TOGGLING state.

[ 4086.021288] VBUS off
[ 4086.021295] pending state change SNK_READY -> SNK_UNATTACHED @ 650 ms [rev2 NONE_AMS]
[ 4086.022113] VBUS VSAFE0V
[ 4086.022117] state change SNK_READY -> SNK_UNATTACHED [rev2 NONE_AMS]
[ 4086.022447] VBUS off
[ 4086.022450] state change SNK_UNATTACHED -> SNK_UNATTACHED [rev2 NONE_AMS]
[ 4086.023060] VBUS VSAFE0V
[ 4086.023064] state change SNK_UNATTACHED -> SNK_UNATTACHED [rev2 NONE_AMS]
[ 4086.023070] disable BIST MODE TESTDATA
[ 4086.023766] disable vbus discharge ret:0
[ 4086.023911] Setting usb_comm capable false
[ 4086.028874] Setting voltage/current limit 0 mV 0 mA
[ 4086.028888] polarity 0
[ 4086.030305] Requesting mux state 0, usb-role 0, orientation 0
[ 4086.033539] Start toggling
[ 4086.038496] state change SNK_UNATTACHED -> TOGGLING [rev2 NONE_AMS]

// This Hard Reset is unexpected
[ 4086.038499] Received hard reset
[ 4086.038501] state change TOGGLING -> HARD_RESET_START [rev2 HARD_RESET]

Fixes: f0690a25a140 ("staging: typec: USB Type-C Port Manager (tcpm)")
Cc: stable@vger.kernel.org
Signed-off-by: Kyle Tso <kyletso@google.com>
---
 drivers/usb/typec/tcpm/tcpm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index 8a1af08f71b6..9c1cb8c11bd6 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -6172,6 +6172,7 @@ static void _tcpm_pd_hard_reset(struct tcpm_port *port)
 		port->tcpc->set_bist_data(port->tcpc, false);
 
 	switch (port->state) {
+	case TOGGLING:
 	case ERROR_RECOVERY:
 	case PORT_RESET:
 	case PORT_RESET_WAIT_OFF:
-- 
2.45.0.rc1.225.g2a3ae87e7f-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb: typec: tcpm: Ignore received Hard Reset in TOGGLING state
  2024-05-20 15:48 [PATCH] usb: typec: tcpm: Ignore received Hard Reset in TOGGLING state Kyle Tso
@ 2024-05-21 13:54 ` Heikki Krogerus
  0 siblings, 0 replies; 2+ messages in thread
From: Heikki Krogerus @ 2024-05-21 13:54 UTC (permalink / raw)
  To: Kyle Tso; +Cc: linux, gregkh, badhri, linux-kernel, linux-usb, stable

On Mon, May 20, 2024 at 11:48:58PM +0800, Kyle Tso wrote:
> Similar to what fixed in Commit a6fe37f428c1 ("usb: typec: tcpm: Skip
> hard reset when in error recovery"), the handling of the received Hard
> Reset has to be skipped during TOGGLING state.
> 
> [ 4086.021288] VBUS off
> [ 4086.021295] pending state change SNK_READY -> SNK_UNATTACHED @ 650 ms [rev2 NONE_AMS]
> [ 4086.022113] VBUS VSAFE0V
> [ 4086.022117] state change SNK_READY -> SNK_UNATTACHED [rev2 NONE_AMS]
> [ 4086.022447] VBUS off
> [ 4086.022450] state change SNK_UNATTACHED -> SNK_UNATTACHED [rev2 NONE_AMS]
> [ 4086.023060] VBUS VSAFE0V
> [ 4086.023064] state change SNK_UNATTACHED -> SNK_UNATTACHED [rev2 NONE_AMS]
> [ 4086.023070] disable BIST MODE TESTDATA
> [ 4086.023766] disable vbus discharge ret:0
> [ 4086.023911] Setting usb_comm capable false
> [ 4086.028874] Setting voltage/current limit 0 mV 0 mA
> [ 4086.028888] polarity 0
> [ 4086.030305] Requesting mux state 0, usb-role 0, orientation 0
> [ 4086.033539] Start toggling
> [ 4086.038496] state change SNK_UNATTACHED -> TOGGLING [rev2 NONE_AMS]
> 
> // This Hard Reset is unexpected
> [ 4086.038499] Received hard reset
> [ 4086.038501] state change TOGGLING -> HARD_RESET_START [rev2 HARD_RESET]
> 
> Fixes: f0690a25a140 ("staging: typec: USB Type-C Port Manager (tcpm)")
> Cc: stable@vger.kernel.org
> Signed-off-by: Kyle Tso <kyletso@google.com>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/tcpm/tcpm.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 8a1af08f71b6..9c1cb8c11bd6 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -6172,6 +6172,7 @@ static void _tcpm_pd_hard_reset(struct tcpm_port *port)
>  		port->tcpc->set_bist_data(port->tcpc, false);
>  
>  	switch (port->state) {
> +	case TOGGLING:
>  	case ERROR_RECOVERY:
>  	case PORT_RESET:
>  	case PORT_RESET_WAIT_OFF:
> -- 
> 2.45.0.rc1.225.g2a3ae87e7f-goog

-- 
heikki

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-21 13:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-20 15:48 [PATCH] usb: typec: tcpm: Ignore received Hard Reset in TOGGLING state Kyle Tso
2024-05-21 13:54 ` Heikki Krogerus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox