Commit 8ef6e1ba authored by Miquel Raynal's avatar Miquel Raynal Committed by Greg Kroah-Hartman
Browse files

serial: 8250: dw: Introduce an rx_timeout variable in the IRQ path



In a next change we are going to need the same Rx timeout condition as
we already have in the IRQ handling code. Let's just create a boolean to
clarify what this operation does before reusing it.

There is no functional change.

Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20220422180615.9098-7-miquel.raynal@bootlin.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e4fb03fe
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -225,6 +225,7 @@ static int dw8250_handle_irq(struct uart_port *p)
	struct uart_8250_port *up = up_to_u8250p(p);
	struct dw8250_data *d = to_dw8250_data(p->private_data);
	unsigned int iir = p->serial_in(p, UART_IIR);
	bool rx_timeout = (iir & 0x3f) == UART_IIR_RX_TIMEOUT;
	unsigned int status;
	unsigned long flags;

@@ -238,7 +239,7 @@ static int dw8250_handle_irq(struct uart_port *p)
	 * This problem has only been observed so far when not in DMA mode
	 * so we limit the workaround only to non-DMA mode.
	 */
	if (!up->dma && ((iir & 0x3f) == UART_IIR_RX_TIMEOUT)) {
	if (!up->dma && rx_timeout) {
		spin_lock_irqsave(&p->lock, flags);
		status = p->serial_in(p, UART_LSR);