diff mbox series

[1/2] ns16550: do not override fifo size if explicitly set

Message ID 20210813183139.391546-1-marmarek@invisiblethingslab.com (mailing list archive)
State Superseded
Headers show
Series [1/2] ns16550: do not override fifo size if explicitly set | expand

Commit Message

Marek Marczykowski-Górecki Aug. 13, 2021, 6:31 p.m. UTC
If fifo size is already set via uart_params, do not force it to 16 - which
may not match the actual hardware. Specifically Exar cards have fifo of
256 bytes.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 xen/drivers/char/ns16550.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jan Beulich Aug. 16, 2021, 7:42 a.m. UTC | #1
On 13.08.2021 20:31, Marek Marczykowski-Górecki wrote:
> If fifo size is already set via uart_params, do not force it to 16 - which
> may not match the actual hardware. Specifically Exar cards have fifo of
> 256 bytes.
> 
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
diff mbox series

Patch

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 16a73d0c0e47..97b85b0225cc 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -357,7 +357,8 @@  static void __init ns16550_init_preirq(struct serial_port *port)
     ns16550_setup_preirq(uart);
 
     /* Check this really is a 16550+. Otherwise we have no FIFOs. */
-    if ( ((ns_read_reg(uart, UART_IIR) & 0xc0) == 0xc0) &&
+    if ( uart->fifo_size <= 1 &&
+         ((ns_read_reg(uart, UART_IIR) & 0xc0) == 0xc0) &&
          ((ns_read_reg(uart, UART_FCR) & UART_FCR_TRG14) == UART_FCR_TRG14) )
         uart->fifo_size = 16;
 }