Skip to content

usb_c: pe: fix PE state on DRS sender response timeout#106455

Open
ncadieux wants to merge 1 commit intozephyrproject-rtos:mainfrom
ncadieux:fix/usbc-drs-timeout
Open

usb_c: pe: fix PE state on DRS sender response timeout#106455
ncadieux wants to merge 1 commit intozephyrproject-rtos:mainfrom
ncadieux:fix/usbc-drs-timeout

Conversation

@ncadieux
Copy link
Copy Markdown
Contributor

@ncadieux ncadieux commented Mar 27, 2026

When the SenderResponseTimer expires in PE_DRS_SEND_SWAP, the Policy Engine was unconditionally transitioning to PE_SNK_READY. This is incorrect when the port is operating as a Source, it should return to PE_SRC_READY instead.

Replace the hardcoded pe_set_state(dev, PE_SNK_READY) with pe_set_ready_state(dev), which selects the correct ready state based on the current power role.

This bug would cause a Source port to enter the wrong PE state after a rejected or timed-out Data Role Swap, potentially leading to a protocol error or Hard Reset.

Fixes: #106454

When the SenderResponseTimer expires in PE_DRS_SEND_SWAP, PE was
unconditionally transitioning to PE_SNK_READY. This is incorrect when
the port is operating as a Source, as it should return to PE_SRC_READY.

Replace pe_set_state(dev, PE_SNK_READY) with pe_set_ready_state(dev),
which selects the correct ready state based on the current power role.

Signed-off-by: Nicholas Cadieux <ncadieux@qti.qualcomm.com>
@ncadieux ncadieux force-pushed the fix/usbc-drs-timeout branch from 73e735a to bd2d1c0 Compare March 27, 2026 18:24
@sonarqubecloud
Copy link
Copy Markdown

@ncadieux ncadieux marked this pull request as ready for review March 27, 2026 21:35
@zephyrbot zephyrbot added area: USB-C area: USB Universal Serial Bus size: XS A PR changing only a single line of code labels Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: USB Universal Serial Bus area: USB-C size: XS A PR changing only a single line of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

usb_c: pe: DRS sender response timeout returns to wrong PE ready state

3 participants