patch "usb: typec: tcpm: Fix response to vsafe0V event" added to usb-linus
Subsystems (4)
This is a note to let you know that I've just added the patch titled
usb: typec: tcpm: Fix response to vsafe0V event
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
From 4270d2b4845e820b274702bfc2a7140f69e4d19d Mon Sep 17 00:00:00 2001
From: Badhri Jagan Sridharan <[email protected]>
Date: Wed, 12 Jul 2023 08:57:22 +0000
Subject: usb: typec: tcpm: Fix response to vsafe0V event
Do not transition to SNK_UNATTACHED state when receiving vsafe0v event while in SNK_HARD_RESET_WAIT_VBUS. Ignore VBUS off events as well as in some platforms VBUS off can be signalled more than once.
[143515.364753] Requesting mux state 1, usb-role 2, orientation 2 [143515.365520] pending state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON @ 650 ms [rev3 HARD_RESET] [143515.632281] CC1: 0 -> 0, CC2: 3 -> 0 [state SNK_HARD_RESET_SINK_OFF, polarity 1, disconnected] [143515.637214] VBUS on [143515.664985] VBUS off [143515.664992] state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_WAIT_VBUS [rev3 HARD_RESET] [143515.665564] VBUS VSAFE0V [143515.665566] state change SNK_HARD_RESET_WAIT_VBUS -> SNK_UNATTACHED [rev3 HARD_RESET]
--- drivers/usb/typec/tcpm/tcpm.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/usb/typec/tcpm/tcpm.c +7 -0
@@ -5349,6 +5349,10 @@ static void _tcpm_pd_vbus_off(struct tcpm_port *port)/* Do nothing, vbus drop expected */ break ; +case SNK_HARD_RESET_WAIT_VBUS : +/* Do nothing, its OK to receive vbus off events */ +break ; +default :if (port->pwr_role ==TYPEC_SINK && port->attached)tcpm_set_state (port,SNK_UNATTACHED ,tcpm_wait_for_discharge (port));
@@ -5395,6 +5399,9 @@ static void _tcpm_pd_vbus_vsafe0v(struct tcpm_port *port)case SNK_DEBOUNCED :/*Do nothing, still waiting for VSAFE5V for connect */ break ; +case SNK_HARD_RESET_WAIT_VBUS : +/* Do nothing, its OK to receive vbus off events */ +break ;default :if (port->pwr_role ==TYPEC_SINK && port->auto_vbus_discharge_enabled)tcpm_set_state (port,SNK_UNATTACHED ,0 );
Signature · 1 line
2.41.0