Commit f8ba5680 authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by Greg Kroah-Hartman
Browse files

serial: 8250: make saved LSR larger



DW flags address received as BIT(8) in LSR. In order to not lose that
on read, enlarge lsr_saved_flags to u16.

Adjust lsr/status variables and related call chains to use u16.
Technically, some of these type conversion would not be needed but it
doesn't hurt to be consistent.

Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220624204210.11112-2-ilpo.jarvinen@linux.intel.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 34619de1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -133,9 +133,9 @@ static inline void serial_out(struct uart_8250_port *up, int offset, int value)
 *
 *	Returns LSR value or'ed with the preserved flags (if any).
 */
static inline unsigned int serial_lsr_in(struct uart_8250_port *up)
static inline u16 serial_lsr_in(struct uart_8250_port *up)
{
	unsigned int lsr = up->lsr_saved_flags;
	u16 lsr = up->lsr_saved_flags;

	lsr |= serial_in(up, UART_LSR);
	up->lsr_saved_flags = lsr & LSR_SAVE_FLAGS;
+1 −1
Original line number Diff line number Diff line
@@ -195,11 +195,11 @@ static int xr17v35x_startup(struct uart_port *port)

static void exar_shutdown(struct uart_port *port)
{
	unsigned char lsr;
	bool tx_complete = false;
	struct uart_8250_port *up = up_to_u8250p(port);
	struct circ_buf *xmit = &port->state->xmit;
	int i = 0;
	u16 lsr;

	do {
		lsr = serial_in(up, UART_LSR);
+1 −1
Original line number Diff line number Diff line
@@ -25,8 +25,8 @@

int fsl8250_handle_irq(struct uart_port *port)
{
	unsigned char lsr, orig_lsr;
	unsigned long flags;
	u16 lsr, orig_lsr;
	unsigned int iir;
	struct uart_8250_port *up = up_to_u8250p(port);

+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ static void early_out(struct uart_port *port, int offset, uint8_t value)

static void ingenic_early_console_putc(struct uart_port *port, unsigned char c)
{
	uint8_t lsr;
	u16 lsr;

	do {
		lsr = early_in(port, UART_LSR);
+3 −4
Original line number Diff line number Diff line
@@ -1115,8 +1115,7 @@ static bool handle_rx_dma(struct uart_8250_port *up, unsigned int iir)
	return omap_8250_rx_dma(up);
}

static unsigned char omap_8250_handle_rx_dma(struct uart_8250_port *up,
					     u8 iir, unsigned char status)
static u16 omap_8250_handle_rx_dma(struct uart_8250_port *up, u8 iir, u16 status)
{
	if ((status & (UART_LSR_DR | UART_LSR_BI)) &&
	    (iir & UART_IIR_RDI)) {
@@ -1130,7 +1129,7 @@ static unsigned char omap_8250_handle_rx_dma(struct uart_8250_port *up,
}

static void am654_8250_handle_rx_dma(struct uart_8250_port *up, u8 iir,
				     unsigned char status)
				     u16 status)
{
	/*
	 * Queue a new transfer if FIFO has data.
@@ -1164,7 +1163,7 @@ static int omap_8250_dma_handle_irq(struct uart_port *port)
{
	struct uart_8250_port *up = up_to_u8250p(port);
	struct omap8250_priv *priv = up->port.private_data;
	unsigned char status;
	u16 status;
	u8 iir;

	serial8250_rpm_get(up);
Loading