Badhri Jagan Sridharan
fbcd13df1e
usb: typec: tcpm: Wait in SNK_DEBOUNCED until disconnect
Stub from the spec:
"4.5.2.2.4.2 Exiting from AttachWait.SNK State
A Sink shall transition to Unattached.SNK when the state of both
the CC1 and CC2 pins is SNK.Open for at least tPDDebounce.
A DRP shall transition to Unattached.SRC when the state of both
the CC1 and CC2 pins is SNK.Open for at least tPDDebounce."
This change makes TCPM to wait in SNK_DEBOUNCED state until
CC1 and CC2 pins is SNK.Open for at least tPDDebounce. Previously,
TCPM resets the port if vbus is not present in PD_T_PS_SOURCE_ON.
This causes TCPM to loop continuously when connected to a
faulty power source that does not present vbus. Waiting in
SNK_DEBOUNCED also ensures that TCPM is adherant to
"4.5.2.2.4.2 Exiting from AttachWait.SNK State" requirements.
[ 6169.280751] CC1: 0 -> 0, CC2: 0 -> 5 [state TOGGLING, polarity 0, connected]
[ 6169.280759] state change TOGGLING -> SNK_ATTACH_WAIT [rev2 NONE_AMS]
[ 6169.280771] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 170 ms [rev2 NONE_AMS]
[ 6169.282427] CC1: 0 -> 0, CC2: 5 -> 5 [state SNK_ATTACH_WAIT, polarity 0, connected]
[ 6169.450825] state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 170 ms]
[ 6169.450834] pending state change SNK_DEBOUNCED -> PORT_RESET @ 480 ms [rev2 NONE_AMS]
[ 6169.930892] state change SNK_DEBOUNCED -> PORT_RESET [delayed 480 ms]
[ 6169.931296] disable vbus discharge ret:0
[ 6169.931301] Setting usb_comm capable false
[ 6169.932783] Setting voltage/current limit 0 mV 0 mA
[ 6169.932802] polarity 0
[ 6169.933706] Requesting mux state 0, usb-role 0, orientation 0
[ 6169.936689] cc:=0
[ 6169.936812] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms [rev2 NONE_AMS]
[ 6169.937157] CC1: 0 -> 0, CC2: 5 -> 0 [state PORT_RESET, polarity 0, disconnected]
[ 6170.036880] state change PORT_RESET -> PORT_RESET_WAIT_OFF [delayed 100 ms]
[ 6170.036890] state change PORT_RESET_WAIT_OFF -> SNK_UNATTACHED [rev2 NONE_AMS]
[ 6170.036896] Start toggling
[ 6170.041412] CC1: 0 -> 0, CC2: 0 -> 0 [state TOGGLING, polarity 0, disconnected]
[ 6170.042973] CC1: 0 -> 0, CC2: 0 -> 5 [state TOGGLING, polarity 0, connected]
[ 6170.042976] state change TOGGLING -> SNK_ATTACH_WAIT [rev2 NONE_AMS]
[ 6170.042981] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 170 ms [rev2 NONE_AMS]
[ 6170.213014] state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 170 ms]
[ 6170.213019] pending state change SNK_DEBOUNCED -> PORT_RESET @ 480 ms [rev2 NONE_AMS]
[ 6170.693068] state change SNK_DEBOUNCED -> PORT_RESET [delayed 480 ms]
[ 6170.693304] disable vbus discharge ret:0
[ 6170.693308] Setting usb_comm capable false
[ 6170.695193] Setting voltage/current limit 0 mV 0 mA
[ 6170.695210] polarity 0
[ 6170.695990] Requesting mux state 0, usb-role 0, orientation 0
[ 6170.701896] cc:=0
[ 6170.702181] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms [rev2 NONE_AMS]
[ 6170.703343] CC1: 0 -> 0, CC2: 5 -> 0 [state PORT_RESET, polarity 0, disconnected]
Fixes: f0690a25a1 ("staging: typec: USB Type-C Port Manager (tcpm)")
Cc: stable@vger.kernel.org
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Link: https://lore.kernel.org/r/20211130001825.3142830-1-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-03 13:57:10 +01:00
..
2021-11-26 19:45:31 +01:00
2021-11-17 16:08:52 +01:00
2021-11-18 14:34:25 +09:00
2021-10-22 00:13:16 +02:00
2021-11-11 13:09:33 +01:00
2021-11-06 14:36:12 -07:00
2021-11-28 11:58:52 -08:00
2021-11-04 09:09:37 -07:00
2021-11-13 09:11:33 -08:00
2021-11-01 10:09:14 -07:00
2021-11-04 08:21:47 -07:00
2021-11-14 11:11:51 -08:00
2021-11-02 11:24:14 -07:00
2021-10-30 10:54:47 +02:00
2021-10-21 13:02:47 +02:00
2021-11-23 14:11:18 +01:00
2021-11-03 17:00:52 -07:00
2021-11-06 14:36:12 -07:00
2021-11-08 11:49:48 -08:00
2021-11-10 14:06:51 +01:00
2021-11-10 11:47:55 -08:00
2021-11-12 12:11:07 -08:00
2021-11-01 15:02:49 -07:00
2021-10-27 14:13:39 +09:00
2021-11-05 08:42:02 -07:00
2021-11-22 11:42:59 +01:00
2021-10-22 09:54:33 +10:30
2021-11-16 09:41:44 +01:00
2021-11-26 09:54:13 -08:00
2021-11-19 16:00:21 +01:00
2021-11-04 13:56:55 -07:00
2021-11-15 12:35:56 +00:00
2021-11-06 14:08:17 -07:00
2021-10-27 11:46:01 -06:00
2021-11-23 10:55:48 +01:00
2021-11-10 11:36:43 -08:00
2021-11-17 16:45:16 -04:00
2021-11-23 13:41:29 -06:00
2021-11-26 22:54:47 +01:00
2021-11-12 16:09:51 +00:00
2021-11-06 14:08:17 -07:00
2021-10-29 23:03:09 -05:00
2021-11-09 11:24:08 -08:00
2021-11-22 14:58:57 -08:00
2021-11-25 14:46:00 +01:00
2021-11-06 14:36:12 -07:00
2021-11-10 11:36:43 -08:00
2021-11-10 11:52:40 -08:00
2021-11-23 12:32:28 +01:00
2021-10-26 19:12:01 +02:00
2021-11-09 11:24:08 -08:00
2021-10-21 20:02:42 +01:00
2021-11-28 11:58:52 -08:00
2021-11-26 11:14:31 -08:00
2021-11-10 10:56:02 -08:00
2021-11-25 15:02:40 +01:00
2021-11-14 11:11:51 -08:00
2021-11-14 10:38:27 -08:00
2021-11-02 06:20:58 -07:00
2021-11-02 15:58:39 -07:00
2021-11-04 08:21:47 -07:00
2021-11-16 02:19:15 +01:00
2021-11-24 09:44:13 -08:00
2021-11-02 16:48:47 +01:00
2021-11-10 21:18:14 +01:00
2021-11-18 12:12:55 +00:00
2021-11-05 11:57:13 +01:00
2021-11-06 13:30:33 -07:00
2021-11-08 12:07:52 -08:00
2021-11-03 17:00:52 -07:00
2021-11-10 09:07:26 -08:00
2021-11-12 11:44:31 -08:00
2021-11-16 12:29:19 +01:00
2021-11-28 11:58:52 -08:00
2021-11-10 16:15:54 -08:00
2021-10-20 20:54:59 +05:30
2021-11-18 14:35:41 -08:00
2021-11-17 14:08:57 +01:00
2021-11-18 23:07:02 -05:00
2021-11-16 14:41:23 +01:00
2021-11-18 20:40:28 +01:00
2021-10-25 13:17:29 +02:00
2021-11-23 13:42:08 -06:00
2021-10-28 11:22:23 +00:00
2021-12-03 13:57:10 +01:00
2021-11-24 19:00:29 -05:00
2021-11-24 19:00:28 -05:00
2021-11-26 09:54:13 -08:00
2021-11-24 18:47:27 -05:00
2021-11-10 09:41:22 -08:00
2021-11-24 08:55:15 -06:00