On 22/05/2025 09:37, m...@freebsd.org wrote:
> I wrote:
Maybe I don't understand the code, but UART_FLUSH_RECEIVER in ns8250_bus_attach
looks strange to me. It's one thing to flush data while in the loop-back mode,
but I think that in ns8250_bus_attach the hardware is fully set up to receive
data from the outside world. So, how can we hope to drain all of it and to
reliably detect whether FIFO flushing works. I mean that something on the other
end could be continuously transmitting.
I'm not sure if I understand you exactly, but in loop-back mode the RX input is
internally connected to the TX output (i.e. disconnected from the outside
world). So from that perspective, the FIFO detection and flush seems fine to me.
Right. Loop-back mode is used in probe, but in attach the UART is in normal mode
as far as I can tell.
--
Andriy Gapon