summaryrefslogtreecommitdiff
path: root/tools/u_boot_pylib/test_util.py
diff options
context:
space:
mode:
authorRasmus Villemoes <ravi@prevas.dk>2024-10-03 16:10:27 +0200
committerTom Rini <trini@konsulko.com>2024-10-16 15:54:31 -0600
commitf4e7a399480c453df055b521ceda4c57ffb8e99e (patch)
tree4b56c7f8d758e04d7a39f76411168277433cb83c /tools/u_boot_pylib/test_util.py
parente698608680d1250ea50213551ce7c2b296529930 (diff)
serial: do not overwrite not-consumed characters in rx buffer
Before the previous patch, pasting a string of length x > CONFIG_SERIAL_RX_BUFFER_SIZE results in getting the last (x%CONFIG_SERIAL_RX_BUFFER_SIZE) characters from that string. With the previous patch, one instead gets the last CONFIG_SERIAL_RX_BUFFER_SIZE characters repeatedly until the ->rd_ptr catches up. Both behaviours are counter-intuitive, and happen because the code that checks for a character available from the hardware does not account for whether there is actually room in the software buffer to receive it. Fix that by adding such accounting. This also brings the software buffering more in line with how most hardware FIFOs behave (first received characters are kept, overflowing characters are dropped). Signed-off-by: Rasmus Villemoes <ravi@prevas.dk> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/u_boot_pylib/test_util.py')
0 files changed, 0 insertions, 0 deletions