serial: nuttx: revert tcdrain back to fsync#25538
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 <alexander@auterion.com>
* serial: nuttx: revert tcdrain back to fsync * serial: do not print error on EAGAIN --------- Co-authored-by: Alexander Lerach <alexander@auterion.com>
* serial: nuttx: revert tcdrain back to fsync * serial: do not print error on EAGAIN --------- Co-authored-by: Alexander Lerach <alexander@auterion.com>
* serial: nuttx: revert tcdrain back to fsync * serial: do not print error on EAGAIN --------- Co-authored-by: Alexander Lerach <alexander@auterion.com>
* serial: nuttx: revert tcdrain back to fsync * serial: do not print error on EAGAIN --------- Co-authored-by: Alexander Lerach <alexander@auterion.com>
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.