usb: typec: tcpm: fix missed frs_sourcing_vbus() call during FRS
Subsystems (4)
PATCH 1/1 usb: typec: tcpm: fix missed frs_sourcing_vbus() call during FRS
Since commit 0908c5aca31e ("usb: typec: tcpm: AMS and Collision Avoidance") the TCPC reports sourcing vbus while the port is still in AMS_START with FR_SWAP_SEND as the upcoming state. Because of _tcpm_pd_vbus_on() ignores this state, frs_sourcing_vbus() is never called during FRS.
On Pixel 11 Pro XL after an FRS from sink to source the phone keeps showing the charging indicator, and about 20 seconds later VBUS drops and the attached device reboots.
Call frs_sourcing_vbus() from AMS_START when the upcoming state is FR_SWAP_SEND.
---
I'm not test theese changes on mainline, but tested on Pixel 11 Pro XL vendor kernel 6.1 with the same _tcpm_pd_vbus_on() code, as i see mainline tcpm.c is identical in this area.
--- drivers/usb/typec/tcpm/tcpm.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/usb/typec/tcpm/tcpm.c +5 -0
@@ -6889,6 +6889,11 @@ static void _tcpm_pd_vbus_on(struct tcpm_port *port) port->tcpc->frs_sourcing_vbus (port->tcpc);tcpm_set_state (port,FR_SWAP_SNK_SRC_SOURCE_VBUS_APPLIED ,0 );break ; +case AMS_START : +if (port->upcoming_state ==FR_SWAP_SEND && + port->tcpc->frs_sourcing_vbus) + port->tcpc->frs_sourcing_vbus (port->tcpc); +break ;case PORT_RESET :case PORT_RESET_WAIT_OFF :
Signature · 1 line
2.47.3
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [High] usb: typec: tcpm: Signed-off-by and Fixes trailers placed below --- tearline --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [High] usb: typec: tcpm: Signed-off-by and Fixes trailers placed below --- tearline
--
commit 2b51cba8ef01ebefb9093ae6c74c438910efa79e
Author: Max Andreev <[email protected]>
Quoted 8 lines
usb: typec: tcpm: fix missed
frs_sourcing_vbus()call during FRSSince commit
0908c5aca31e("usb: typec: tcpm: AMS and Collision Avoidance") the TCPC reports sourcing vbus while the port is still inAMS_STARTwithFR_SWAP_SENDas the upcoming state. Because of_tcpm_pd_vbus_on()ignores this state,frs_sourcing_vbus()is never called during FRS.
Quoted 6 lines
On Pixel 11 Pro XL after an FRS from sink to source the phone keeps showing the charging indicator, and about 20 seconds later VBUS drops and the attached device reboots.
Call
frs_sourcing_vbus()fromAMS_STARTwhen the upcoming state isFR_SWAP_SEND.
[Severity: High]
The Fixes:, Cc:, and Signed-off-by: trailers were placed below the first "---" separator line in the patch, causing git am to strip them along with the patch commentary and leaving the applied commit without a
Signed-off-by: or Fixes: trailer. Those trailers need to sit above the first "---" line so they are kept in the commit message.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Greg Kroah-Hartman
maintainerQuoted 13 lines · Max Andreev
Since commit
0908c5aca31e("usb: typec: tcpm: AMS and Collision Avoidance") the TCPC reports sourcing vbus while the port is still inAMS_STARTwithFR_SWAP_SENDas the upcoming state. Because of_tcpm_pd_vbus_on()ignores this state,frs_sourcing_vbus()is never called during FRS.On Pixel 11 Pro XL after an FRS from sink to source the phone keeps showing the charging indicator, and about 20 seconds later VBUS drops and the attached device reboots.
Call
frs_sourcing_vbus()fromAMS_STARTwhen the upcoming state isFR_SWAP_SEND.
Quoted 8 lines
---
I'm not test theese changes on mainline, but tested on Pixel 11 Pro XL vendor kernel 6.1 with the same_tcpm_pd_vbus_on()code, as i see mainlinetcpm.cis identical in this area.Fixes 0908c5aca31e ("usb: typec: tcpm: AMS and Collision Avoidance")Signed-off-by Max Andreev <[email protected]>
Why is this all below the --- line? That will get cut off :(
PATCH 1/1 usb: typec: tcpm: fix missed frs_sourcing_vbus() call during FRS
Since commit 0908c5aca31e ("usb: typec: tcpm: AMS and Collision Avoidance") the TCPC reports sourcing vbus while the port is still in AMS_START with FR_SWAP_SEND as the upcoming state. Because of _tcpm_pd_vbus_on() ignores this state, frs_sourcing_vbus() is never called during FRS.
On Pixel 11 Pro XL after an FRS from sink to source the phone keeps showing the charging indicator, and about 20 seconds later VBUS drops and the attached device reboots.
Call frs_sourcing_vbus() from AMS_START when the upcoming state is FR_SWAP_SEND.
---
I'm not test theese changes on mainline, but tested on Pixel 11 Pro XL vendor kernel 6.1 with the same _tcpm_pd_vbus_on() code, as i see mainline tcpm.c is identical in this area.
--- drivers/usb/typec/tcpm/tcpm.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/usb/typec/tcpm/tcpm.c +5 -0
@@ -6889,6 +6889,11 @@ static void _tcpm_pd_vbus_on(struct tcpm_port *port) port->tcpc->frs_sourcing_vbus (port->tcpc);tcpm_set_state (port,FR_SWAP_SNK_SRC_SOURCE_VBUS_APPLIED ,0 );break ; +case AMS_START : +if (port->upcoming_state ==FR_SWAP_SEND && + port->tcpc->frs_sourcing_vbus) + port->tcpc->frs_sourcing_vbus (port->tcpc); +break ;case PORT_RESET :case PORT_RESET_WAIT_OFF :
Signature · 1 line
2.47.3
PATCH v2 1/1 usb: typec: tcpm: fix missed frs_sourcing_vbus() call during FRS
In reply to Greg Kroah-HartmanSince commit 0908c5aca31e ("usb: typec: tcpm: AMS and Collision Avoidance") the TCPC reports sourcing vbus while the port is still in AMS_START with FR_SWAP_SEND as the upcoming state. Because of _tcpm_pd_vbus_on() ignores this state, frs_sourcing_vbus() is never called during FRS.
On Pixel 11 Pro XL after an FRS from sink to source the phone keeps showing the charging indicator, and about 20 seconds later VBUS drops and the attached device reboots.
Call frs_sourcing_vbus() from AMS_START when the upcoming state is FR_SWAP_SEND.
---
v2: moved the trailers above the --- line
I'm not test theese changes on mainline, but tested on Pixel 11 Pro XL vendor kernel 6.1 with the same _tcpm_pd_vbus_on() code, as i see mainline tcpm.c is identical in this area.
drivers/usb/typec/tcpm/tcpm.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/usb/typec/tcpm/tcpm.c +5 -0
@@ -6889,6 +6889,11 @@ static void _tcpm_pd_vbus_on(struct tcpm_port *port) port->tcpc->frs_sourcing_vbus (port->tcpc);tcpm_set_state (port,FR_SWAP_SNK_SRC_SOURCE_VBUS_APPLIED ,0 );break ; +case AMS_START : +if (port->upcoming_state ==FR_SWAP_SEND && + port->tcpc->frs_sourcing_vbus) + port->tcpc->frs_sourcing_vbus (port->tcpc); +break ;case PORT_RESET :case PORT_RESET_WAIT_OFF :
Signature · 1 line
2.47.3
[email protected]
AI reviewSashiko has reviewed this patch and found no issues.
Quoted 10 lines
Since commit
0908c5aca31e("usb: typec: tcpm: AMS and Collision Avoidance") the TCPC reports sourcing vbus while the port is still inAMS_STARTwithFR_SWAP_SENDas the upcoming state. Because of_tcpm_pd_vbus_on()ignores this state,frs_sourcing_vbus()is never called during FRS.On Pixel 11 Pro XL after an FRS from sink to source the phone keeps showing the charging indicator, and about 20 seconds later VBUS drops and the attached device reboots.
Quoted 6 lines
Call
frs_sourcing_vbus()fromAMS_STARTwhen the upcoming state isFR_SWAP_SEND.Fixes 0908c5aca31e ("usb: typec: tcpm: AMS and Collision Avoidance")Signed-off-by Max Andreev <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1