]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.14/serial-sh-sci-fix-setting-scscr_tie-while-transferring-data.patch
Linux 4.9.167
[thirdparty/kernel/stable-queue.git] / queue-4.14 / serial-sh-sci-fix-setting-scscr_tie-while-transferring-data.patch
1 From 93bcefd4c6bad4c69dbc4edcd3fbf774b24d930d Mon Sep 17 00:00:00 2001
2 From: Hoan Nguyen An <na-hoan@jinso.co.jp>
3 Date: Mon, 18 Mar 2019 18:26:32 +0900
4 Subject: serial: sh-sci: Fix setting SCSCR_TIE while transferring data
5
6 From: Hoan Nguyen An <na-hoan@jinso.co.jp>
7
8 commit 93bcefd4c6bad4c69dbc4edcd3fbf774b24d930d upstream.
9
10 We disable transmission interrupt (clear SCSCR_TIE) after all data has been transmitted
11 (if uart_circ_empty(xmit)). While transmitting, if the data is still in the tty buffer,
12 re-enable the SCSCR_TIE bit, which was done at sci_start_tx().
13 This is unnecessary processing, wasting CPU operation if the data transmission length is large.
14 And further, transmit end, FIFO empty bits disabling have also been performed in the step above.
15
16 Signed-off-by: Hoan Nguyen An <na-hoan@jinso.co.jp>
17 Cc: stable <stable@vger.kernel.org>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20 ---
21 drivers/tty/serial/sh-sci.c | 12 +-----------
22 1 file changed, 1 insertion(+), 11 deletions(-)
23
24 --- a/drivers/tty/serial/sh-sci.c
25 +++ b/drivers/tty/serial/sh-sci.c
26 @@ -806,19 +806,9 @@ static void sci_transmit_chars(struct ua
27
28 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
29 uart_write_wakeup(port);
30 - if (uart_circ_empty(xmit)) {
31 + if (uart_circ_empty(xmit))
32 sci_stop_tx(port);
33 - } else {
34 - ctrl = serial_port_in(port, SCSCR);
35
36 - if (port->type != PORT_SCI) {
37 - serial_port_in(port, SCxSR); /* Dummy read */
38 - sci_clear_SCxSR(port, SCxSR_TDxE_CLEAR(port));
39 - }
40 -
41 - ctrl |= SCSCR_TIE;
42 - serial_port_out(port, SCSCR, ctrl);
43 - }
44 }
45
46 /* On SH3, SCIF may read end-of-break as a space->mark char */