Attention is currently required from: Stanislav Ponomarev.

Stanislav Ponomarev uploaded patch set #3 to this change.

View Change

serial: Fix sp_flush_incoming for serprog TCP connections

During the development of an esp32 serprog-compatible SPI programmer,
and implementation of the TCP over Wi-Fi for serprog,
I discovered that sp_flush_incoming() silently fails
if the underlying sp_fd descriptor is a TCP socket.

This patch adds a check for this case - tcflush returns ENOTTY,
meaning tcflush is not supported for not terminal objects,
in this case a fallback serialport_read_nonblock loop is used.

TESTED=esp32-serprog, TCP-over-WiFi mode, ~90% connection attempts fail to synchronize without patch; no synchronization issues with patch applied.

Signed-off-by: Stanislav Ponomarev <me@stasponomarev.com>

Change-Id: I9724a2fcd4a41dede2c15f83877efa6c3b0b7fae
---
M serial.c
1 file changed, 20 insertions(+), 2 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/12/79112/3

To view, visit change 79112. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I9724a2fcd4a41dede2c15f83877efa6c3b0b7fae
Gerrit-Change-Number: 79112
Gerrit-PatchSet: 3
Gerrit-Owner: Stanislav Ponomarev <me@stasponomarev.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-Attention: Stanislav Ponomarev <me@stasponomarev.com>
Gerrit-MessageType: newpatchset