Commit da7fa058 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Greg Kroah-Hartman

serial: 8250_uniphier: avoid locking for FCR register write

The hardware book says, the FCR is combined with a register called
CHAR (it will trigger interrupt when a specific character is
received).  At first, I used lock/read/modify/write/unlock dance for
the FCR to not affect the upper bits, but the CHAR is actually never
used.  It should not hurt to always clear the CHAR and to handle the
FCR as a normal case.  It can save the costly locking.
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Suggested-by: default avatarDenys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 94cbb697
...@@ -101,7 +101,7 @@ static unsigned int uniphier_serial_in(struct uart_port *p, int offset) ...@@ -101,7 +101,7 @@ static unsigned int uniphier_serial_in(struct uart_port *p, int offset)
static void uniphier_serial_out(struct uart_port *p, int offset, int value) static void uniphier_serial_out(struct uart_port *p, int offset, int value)
{ {
unsigned int valshift = 0; unsigned int valshift = 0;
bool normal = false; bool normal = true;
switch (offset) { switch (offset) {
case UART_FCR: case UART_FCR:
...@@ -114,9 +114,9 @@ static void uniphier_serial_out(struct uart_port *p, int offset, int value) ...@@ -114,9 +114,9 @@ static void uniphier_serial_out(struct uart_port *p, int offset, int value)
/* fall through */ /* fall through */
case UART_MCR: case UART_MCR:
offset = UNIPHIER_UART_LCR_MCR; offset = UNIPHIER_UART_LCR_MCR;
normal = false;
break; break;
default: default:
normal = true;
offset <<= UNIPHIER_UART_REGSHIFT; offset <<= UNIPHIER_UART_REGSHIFT;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment