linux/drivers/usb
Badhri Jagan Sridharan c5027380a1 UPSTREAM: usb: typec: tcpm: Do not disconnect when receiving VSAFE0V
With some chargers, vbus might momentarily raise above VSAFE5V and fall
back to 0V causing VSAFE0V to be triggered. This will
will report a VBUS off event causing TCPM to transition to
SNK_UNATTACHED state where it should be waiting in either SNK_ATTACH_WAIT
or SNK_DEBOUNCED state. This patch makes TCPM avoid VSAFE0V events
while in SNK_ATTACH_WAIT or SNK_DEBOUNCED state.

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."

[23.194131] CC1: 0 -> 0, CC2: 0 -> 5 [state SNK_UNATTACHED, polarity 0, connected]
[23.201777] state change SNK_UNATTACHED -> SNK_ATTACH_WAIT [rev3 NONE_AMS]
[23.209949] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 170 ms [rev3 NONE_AMS]
[23.300579] VBUS off
[23.300668] state change SNK_ATTACH_WAIT -> SNK_UNATTACHED [rev3 NONE_AMS]
[23.301014] VBUS VSAFE0V
[23.301111] Start toggling

Bug: 254441685
Fixes: 28b43d3d74 ("usb: typec: tcpm: Introduce vsafe0v for vbus")
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/20220122015520.332507-2-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 746f96e7d6)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Id5661d224fbd49acd39b646cca2a5c328128eb4b
2022-11-09 13:57:12 +00:00
..
atm
c67x00
cdns3 usb: cdns3: Fix issue for clear halt endpoint 2022-05-09 09:04:59 +02:00
chipidea usb: chipidea: udc: check request status before setting device address 2022-06-29 08:59:51 +02:00
class usb: cdc-wdm: fix reading stuck on device close 2022-05-18 10:23:46 +02:00
common FROMGIT: usb: common: usb-conn-gpio: Allow wakeup from system suspend 2022-06-22 15:28:39 +00:00
core This is the 5.10.122 stable release 2022-07-28 15:05:26 +02:00
dwc2 This is the 5.10.124 stable release 2022-07-28 15:53:46 +02:00
dwc3 Merge tag 'android12-5.10.136_r00' into android12-5.10 2022-09-28 09:54:28 +02:00
early
gadget Merge tag 'android12-5.10.136_r00' into android12-5.10 2022-09-28 09:54:28 +02:00
host Merge tag 'android12-5.10.136_r00' into android12-5.10 2022-09-28 09:54:28 +02:00
image
isp1760
misc usb: misc: fix improper handling of refcount in uss720_probe() 2022-05-09 09:04:58 +02:00
mon
mtu3 usb: mtu3: fix USB 3.0 dual-role-switch from device to host 2022-05-09 09:04:56 +02:00
musb usb: musb: Fix missing of_node_put() in omap2430_probe 2022-06-14 18:32:31 +02:00
phy usb: phy: generic: Get the vbus supply 2022-05-09 09:04:59 +02:00
renesas_usbhs
roles
serial USB: serial: ftdi_sio: add Belimo device ids 2022-07-21 21:20:18 +02:00
storage USB: storage: karma: fix rio_karma_init return 2022-06-14 18:32:31 +02:00
typec UPSTREAM: usb: typec: tcpm: Do not disconnect when receiving VSAFE0V 2022-11-09 13:57:12 +00:00
usbip usb: usbip: add missing device lock on tweak configuration cmd 2022-06-14 18:32:31 +02:00
Kconfig
Makefile
usb-skeleton.c