Skip to content

Commit

Permalink
serial: sprd: clear timeout interrupt only rather than all interrupts
Browse files Browse the repository at this point in the history
On Spreadtrum's serial device, nearly all of interrupts would be cleared
by hardware except timeout interrupt.  This patch removed the operation
of clearing all interrupt in irq handler, instead added an if statement
to check if the timeout interrupt is supposed to be cleared.

Wrongly clearing timeout interrupt would lead to uart data stay in rx
fifo, that means the driver cannot read them out anymore.

Signed-off-by: Lanqing Liu <lanqing.liu@spreadtrum.com>
Signed-off-by: Chunyan Zhang <chunyan.zhang@spreadtrum.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Lanqing Liu authored and Greg Kroah-Hartman committed Jul 30, 2017
1 parent 64432a8 commit 4350782
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/tty/serial/sprd_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@

/* interrupt clear register */
#define SPRD_ICLR 0x0014
#define SPRD_ICLR_TIMEOUT BIT(13)

/* line control register */
#define SPRD_LCR 0x0018
Expand Down Expand Up @@ -298,7 +299,8 @@ static irqreturn_t sprd_handle_irq(int irq, void *dev_id)
return IRQ_NONE;
}

serial_out(port, SPRD_ICLR, ~0);
if (ims & SPRD_IMSR_TIMEOUT)
serial_out(port, SPRD_ICLR, SPRD_ICLR_TIMEOUT);

if (ims & (SPRD_IMSR_RX_FIFO_FULL |
SPRD_IMSR_BREAK_DETECT | SPRD_IMSR_TIMEOUT))
Expand Down

0 comments on commit 4350782

Please sign in to comment.