-
Notifications
You must be signed in to change notification settings - Fork 14.8k
serial: nuttx: revert tcdrain back to fsync #25538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hi @dakejahl, I allowed myself to add a small update to avoid the console getting spammed with errors no in case of fast uart writes (which can now cause EAGAIN to be returned, as there is no wait to drain anymore). This leads to a lot of spam. |
|
@alexcekay I'm okay with removing the warning but we should also fix the caller that is causing the warning in the first place. If 0 bytes are written it means the caller needs to back off and wait until the TX buffer has partially drained. |
e60fe5a to
799ef42
Compare
|
Just FYI @dakejahl, I had a look at all the drivers that actually use the @JoelJ18: The following function is a bit optimistic (in The interface is happy as long as any data is written, but it may be less than the requested amount of bytes. The rest of the code seems to assume that if this returns true the send worked correctly. @katzfey: The In case this one write returns less than the requested amount of bytes (which could happen, although unlikely) the function returns |
|
We probably need to backport this into 1.16 |
* serial: nuttx: revert tcdrain back to fsync * serial: do not print error on EAGAIN --------- Co-authored-by: Alexander Lerach <[email protected]>
* serial: nuttx: revert tcdrain back to fsync * serial: do not print error on EAGAIN --------- Co-authored-by: Alexander Lerach <[email protected]>
* serial: nuttx: revert tcdrain back to fsync * serial: do not print error on EAGAIN --------- Co-authored-by: Alexander Lerach <[email protected]>
* serial: nuttx: revert tcdrain back to fsync * serial: do not print error on EAGAIN --------- Co-authored-by: Alexander Lerach <[email protected]>
Reverts #23686
Due to the bug described here
#23686 (comment)
Solutions
GPS driver RTCM injection logic could be better
#25535
We need a blocking and non-blocking write method
#25537
But this should be reverted since the problem it solves is the minority case. The fix can be handled by instead adding a block write method OR by first polling (POLLOUT) to check if data can be written before calling write.