mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-04 15:09:50 -04:00
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20220422180615.9098-7-miquel.raynal@bootlin.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e4fb03fe10
commit
8ef6e1ba71
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user