Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 May 2025 11:02:24 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        mmel@FreeBSD.org, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   Re: 0d2fd5b99c95 - main - ns8250: use LSR_THRE instead of LSR_TEMT for checking tx flush
Message-ID:  <e9340bb2-754e-44e7-8928-b8331247fe8b@FreeBSD.org>
In-Reply-To: <13b1bbfe-4a60-4c4a-aa4e-ed168cb1286a@FreeBSD.org>
References:  <202505201457.54KEvD1r053951@gitrepo.freebsd.org> <1a11f640-be62-4f4e-b537-70806ac54831@FreeBSD.org> <bc1afdab-72d6-43c1-9603-1eed07cb25e6@FreeBSD.org> <37BF51C0-C631-493F-B3AF-3AA9FC32551B@panasas.com> <13b1bbfe-4a60-4c4a-aa4e-ed168cb1286a@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 22/05/2025 09:37, mmel@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e9340bb2-754e-44e7-8928-b8331247fe8b>