Skip to content

udc_dwc2: fix off-by-one in TX FIFO unset check#96804

Merged
kartben merged 1 commit intozephyrproject-rtos:mainfrom
sylvioalves:bugfix/udc_dwc2_fifo
Oct 2, 2025
Merged

udc_dwc2: fix off-by-one in TX FIFO unset check#96804
kartben merged 1 commit intozephyrproject-rtos:mainfrom
sylvioalves:bugfix/udc_dwc2_fifo

Conversation

@sylvioalves
Copy link
Copy Markdown
Contributor

@sylvioalves sylvioalves commented Sep 30, 2025

Fix the check in dwc2_unset_dedicated_fifo() that wrongly included the current endpoint when testing for higher FIFOs. This caused false warnings and early returns.

Use ~BIT_MASK(ep_idx + 1) to only test FIFOs above the current EP.

@zephyrbot zephyrbot added the area: USB Universal Serial Bus label Sep 30, 2025
@sylvioalves
Copy link
Copy Markdown
Contributor Author

sylvioalves commented Sep 30, 2025

I was only able to perform with SUCCESS /tests/driver/udc on ESP32-S3 by having this fix in the udc_dwc2 driver. The issue can be in ESP32-S3 workflow but it still not clear yet. While I perform more checks, would be good a feedback about it. Thanks!

@sylvioalves sylvioalves force-pushed the bugfix/udc_dwc2_fifo branch 2 times, most recently from 993e18d to dadd2f3 Compare September 30, 2025 15:19
@tmon-nordic
Copy link
Copy Markdown
Contributor

There is also #95654 which addresses the non 1-to-1 endpoint-to-TxFIFO mapping issue.

@sylvioalves
Copy link
Copy Markdown
Contributor Author

There is also #95654 which addresses the non 1-to-1 endpoint-to-TxFIFO mapping issue.

@tmon-nordic, thanks!

Comment thread drivers/usb/udc/udc_dwc2.c Outdated
Fix the check in dwc2_unset_dedicated_fifo() that wrongly included the
current endpoint when testing for higher FIFOs. This caused false
warnings and early returns.

Use ~BIT_MASK(ep_idx + 1) to only test FIFOs above the current EP.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
@sylvioalves sylvioalves force-pushed the bugfix/udc_dwc2_fifo branch from 06a7a26 to aeae800 Compare October 1, 2025 16:48
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Oct 1, 2025

@kartben kartben merged commit 7c1193c into zephyrproject-rtos:main Oct 2, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: USB Universal Serial Bus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants