Comments (5)
@robhancocksed - I'm not able to assign this to you, but this should be fixed before relanding #72599
from zephyr.
@keith-zephyr Looking at the code in the uart_ns16550 driver's uart_ns16550_fifo_fill function, it seems to assume that whenever it is called, the entire FIFO size of the UART is available to write data and so it will write up to fifo_size bytes if they are provided. With the change to the shell UART backend, it's possible that uart_fifo_fill is called twice for a given UART interrupt, such as if the shell's ring buffer wraps around and there is data that needs writing at both the "tail" and "head" ends. That behavior seems valid according to the UART API definition as far as I can tell. With the way uart_ns16550_fifo_fill is implemented, this could easily result in the UART's FIFO overflowing and dropping data.
Other UART drivers that I have looked at are either checking for FIFO full status after each byte is written, or possibly checking the FIFO occupancy before writing bytes to ensure it is not going to overflow, in their fifo_fill function. It seems like either that is the proper fix here. Or if indeed it's not valid to call uart_fifo_fill multiple times on one UART interrupt, then the patch I had should be reverted, but the documentation should be updated to make that clear..
from zephyr.
It looks like the 16550 UART doesn't actually provide a way to directly check the TX FIFO occupancy or even if it is full. All you know is that when you get an interrupt that indicates the TX FIFO is empty, you can write up to the TX FIFO size without overflow. So if it needs to support multiple uart_fifo_calls per interrupt, it would need to keep track internally of how many bytes were already written on the current interrupt and ensure it didn't allow more than that many bytes to be written in total.
from zephyr.
@keith-zephyr did the revert in #72599 resolve this issue? if so, could you please close this bug report.
from zephyr.
Closing, please reopen if you disagree
from zephyr.
Related Issues (20)
- Kconfig: build system ignores configs for snps/nsim SoCs after HWMv2 was applied HOT 1
- net: buf: Make a `net_buf_move(&buf)` API HOT 4
- Lots of twister errors in CI that don't get reported as failures HOT 6
- llext: move settings away from `cmake/compiler/*` files
- twister: blackbox: improve tests for command line options
- Runtime Filtering of Log Levels Not Working Properly HOT 3
- Increase and improve random number generator tests
- llext: Proper support for Thumb32 relocations
- Fix the temperature ADC_STM32_Die_Temp_Read value getting incorrect for nucleo_h743zi in Zephyr 3.6.0 HOT 1
- sensor_shell: crash when `sensor get <sensor> current`
- sensor_shell: strange and unexpected output when getting single axis from 3-axis data HOT 1
- Errors in rx node retention mechanism in refactored LLCP, possibly leading to erroneous rx node handling HOT 2
- drivers: uart: uart_pm: drivers.uart.pm fails
- Bluetooth: Controller: Assert when starting periodic advertising right after extended advertising when there is a BIG
- Multiple intermitent failures in seveal SMP targets due to UART missbehaviour HOT 6
- rpi_5 fails to build samples/tests with UART HOT 1
- LE Audio: Dynamically generate BASS receive states
- net: http: HTTP server send incomplete response header HOT 1
- stm32f207 fails executing the tests/drivers/rtc/rtc_api HOT 1
- os: add zephyr virtual filesystem (zvfs) api
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zephyr.