]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ns8250_drain: Drain without DELAY first
authorColin Percival <cperciva@FreeBSD.org>
Fri, 12 Aug 2022 23:45:17 +0000 (16:45 -0700)
committerColin Percival <cperciva@FreeBSD.org>
Sat, 8 Oct 2022 00:51:54 +0000 (17:51 -0700)
commit39d6144dcd94e9d07f07cb554aecb1f2d4089f6d
tree2fb715dc2fbd56b4d5cde278e5127cf8744475c0
parent9c1bec9c21a2b14ac13b5f0ad6e447c082042e6a
ns8250_drain: Drain without DELAY first

In virtual machines with virtual UARTs which have fictitious baud
rates, it may be possible to drain the receive queue very quickly,
without needing to DELAY after each character.  Attempt to read
(and discard) the receive queue as fast as possible, stopping for
a DELAY only when LSR_RXRDY is no longer asserted; assume that we
have finished draining the queue when LSR_RXRDY is asserted both
before and after a DELAY.

This speeds up the boot process in FreeBSD/Firecracker by 27 ms.

Reviewed by: imp, jrtc27
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D36184
sys/dev/uart/uart_dev_ns8250.c