Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1310617 > unrolled thread

[PATCH 4.2.y-ckt 271/305] serial: 8250_uniphier: fix dl_read and dl_write functions

Started byKamal Mostafa <kamal@canonical.com>
First post2016-01-16 01:20 +0100
Last post2016-01-16 01:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.2.y-ckt 271/305] serial: 8250_uniphier: fix dl_read and dl_write functions Kamal Mostafa <kamal@canonical.com> - 2016-01-16 01:20 +0100

#1310617 — [PATCH 4.2.y-ckt 271/305] serial: 8250_uniphier: fix dl_read and dl_write functions

FromKamal Mostafa <kamal@canonical.com>
Date2016-01-16 01:20 +0100
Subject[PATCH 4.2.y-ckt 271/305] serial: 8250_uniphier: fix dl_read and dl_write functions
Message-ID<qRmL3-54G-87@gated-at.bofh.it>
4.2.8-ckt2 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Masahiro Yamada <yamada.masahiro@socionext.com>

commit 7be047e035dc4fb1536f1694cbb932f881533ab2 upstream.

The register offset must be shifted by regshift, otherwise the
baudrate is not set.  I missed the issue probably because the
divisor register was already set by the boot loader.

Fixes: 1a8d2903cb6a ("serial: 8250_uniphier: add UniPhier serial driver")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/tty/serial/8250/8250_uniphier.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_uniphier.c b/drivers/tty/serial/8250/8250_uniphier.c
index d11621e..245edbb 100644
--- a/drivers/tty/serial/8250/8250_uniphier.c
+++ b/drivers/tty/serial/8250/8250_uniphier.c
@@ -115,12 +115,16 @@ static void uniphier_serial_out(struct uart_port *p, int offset, int value)
  */
 static int uniphier_serial_dl_read(struct uart_8250_port *up)
 {
-	return readl(up->port.membase + UNIPHIER_UART_DLR);
+	int offset = UNIPHIER_UART_DLR << up->port.regshift;
+
+	return readl(up->port.membase + offset);
 }
 
 static void uniphier_serial_dl_write(struct uart_8250_port *up, int value)
 {
-	writel(value, up->port.membase + UNIPHIER_UART_DLR);
+	int offset = UNIPHIER_UART_DLR << up->port.regshift;
+
+	writel(value, up->port.membase + offset);
 }
 
 static int uniphier_of_serial_setup(struct device *dev, struct uart_port *port,
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web