Skip to content

Commit 4350782

Browse files
Lanqing Liugregkh
authored andcommitted
serial: sprd: clear timeout interrupt only rather than all interrupts
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>
1 parent 64432a8 commit 4350782

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/tty/serial/sprd_serial.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363

6464
/* interrupt clear register */
6565
#define SPRD_ICLR 0x0014
66+
#define SPRD_ICLR_TIMEOUT BIT(13)
6667

6768
/* line control register */
6869
#define SPRD_LCR 0x0018
@@ -298,7 +299,8 @@ static irqreturn_t sprd_handle_irq(int irq, void *dev_id)
298299
return IRQ_NONE;
299300
}
300301

301-
serial_out(port, SPRD_ICLR, ~0);
302+
if (ims & SPRD_IMSR_TIMEOUT)
303+
serial_out(port, SPRD_ICLR, SPRD_ICLR_TIMEOUT);
302304

303305
if (ims & (SPRD_IMSR_RX_FIFO_FULL |
304306
SPRD_IMSR_BREAK_DETECT | SPRD_IMSR_TIMEOUT))

0 commit comments

Comments
 (0)