apache / nuttx

Apache NuttX is a mature, real-time embedded operating system (RTOS)
https://nuttx.apache.org/
Apache License 2.0
2.91k stars 1.18k forks source link

[BUG] esp32s3 up_putc clears all interrupts #14872

Closed yamt closed 16 hours ago

yamt commented 1 week ago

Description / Steps to reproduce the issue

esp32s3 up_putc temporarily disables interrupts. while doing so, it clears all pending interrupts, even ones unrelated to TX. https://github.com/apache/nuttx/blob/d41e3da9114cfd4c943c86e3da120b77306b1e7d/arch/xtensa/src/esp32s3/esp32s3_lowputc.c#L828-L830 it seems inappropriate to me, especially when there can be concurrent interrupt-based activities on the UART. (eg. drivers/serial.c)

On which OS does this issue occur?

[OS: Mac]

What is the version of your OS?

macOS 14.7

NuttX Version

master

Issue Architecture

[Arch: xtensa]

Issue Area

[Area: Drivers]

Verification

yamt commented 1 week ago

there seems to be a few copies in the tree.

spacetanuki% git grep "Clear all ints"
arch/risc-v/src/common/espressif/esp_lowputc.c:  /* Clear all ints */
arch/risc-v/src/esp32c3-legacy/esp32c3_lowputc.c:  /* Clear all ints */
arch/xtensa/src/esp32s2/esp32s2_lowputc.c:  /* Clear all ints */
arch/xtensa/src/esp32s3/esp32s3_lowputc.c:      /* Clear all ints */
spacetanuki%