Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mxser: don't read from UART_FCR

The UART_FCR register is write-only. When reading it, one gets contents
of (read-only) UART_IIR instead as they are shared. This mistake was
performed in mxser_flush_buffer() to clear FIFOs.

Actually FCR handling throughout the driver is completely broken. On
many places, it respects neither mu860 settings, nor FIFO (16450 vs
16550) setting. This patch doesn't help to fix this, it actually does
the same. We will introduce a mxser_port::FCR in the next patch to fix
this issue.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210922075938.31390-6-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby and committed by
Greg Kroah-Hartman
215fa41c ee7e5e66

+1 -4
+1 -4
drivers/tty/mxser.c
··· 859 859 static void mxser_flush_buffer(struct tty_struct *tty) 860 860 { 861 861 struct mxser_port *info = tty->driver_data; 862 - char fcr; 863 862 unsigned long flags; 864 863 865 864 866 865 spin_lock_irqsave(&info->slock, flags); 867 866 info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; 868 867 869 - fcr = inb(info->ioaddr + UART_FCR); 870 - outb((fcr | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT), 868 + outb(UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT, 871 869 info->ioaddr + UART_FCR); 872 - outb(fcr, info->ioaddr + UART_FCR); 873 870 874 871 spin_unlock_irqrestore(&info->slock, flags); 875 872