Bug 191265 - [patch] uart(4) punishes UARTs for being too fast
Summary: [patch] uart(4) punishes UARTs for being too fast
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Marcel Moolenaar
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2014-06-22 09:26 UTC by Stephen Hurd
Modified: 2023-05-14 04:34 UTC (History)
0 users

See Also:


Attachments
Fix for discarding data when internal buffer full. (1.10 KB, patch)
2014-06-22 09:26 UTC, Stephen Hurd
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Hurd freebsd_committer freebsd_triage 2014-06-22 09:26:41 UTC
Created attachment 144015 [details]
Fix for discarding data when internal buffer full.

For NS8250 family UARTs, svn 120146 - http://svnweb.freebsd.org/base?view=revision&revision=120146 - made a change to flush the UART if the kernel buffers are full.  The commit message suggests this is because of how the read loop was structured.

However, this change mad it so that if the internal FreeBSD buffer is full, it will drop all pending data... effectively punishing devices for having too much data buffered.  At least one network exposed UART is capable of this.

The attached patch doesn't clear the interrupt if the rx buffer is full by checking the buffer has space before reading LSR.
Comment 1 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:35:30 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>
Comment 2 Stephen Hurd freebsd_committer freebsd_triage 2023-05-14 04:34:29 UTC
I no longer have this device, and #191266 is fixed.