lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1437557699-25722-5-git-send-email-noamc@ezchip.com>
Date:	Wed, 22 Jul 2015 12:34:59 +0300
From:	Noam Camus <noamc@...hip.com>
To:	<linux-kernel@...r.kernel.org>, <linux-serial@...r.kernel.org>
CC:	<Alexey.Brodkin@...opsys.com>, <vgupta@...opsys.com>,
	<gregkh@...uxfoundation.org>, <jslaby@...e.com>,
	Noam Camus <noamc@...hip.com>
Subject: [PATCH 4/4] serial: 8250_dw: use serial_in() and not readl()

From: Noam Camus <noamc@...hip.com>

This is now matches device endianness.

Signed-off-by: Noam Camus <noamc@...hip.com>
---
 drivers/tty/serial/8250/8250_dw.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index 620f983..a64197c 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -291,7 +291,9 @@ static bool dw8250_dma_filter(struct dma_chan *chan, void *param)
 static void dw8250_setup_port(struct uart_8250_port *up)
 {
 	struct uart_port	*p = &up->port;
-	u32			reg = readl(p->membase + DW_UART_UCV);
+	u32			reg = (p->iotype == UPIO_MEM32BE) ?
+					ioread32be(p->membase + DW_UART_UCV) :
+					readl(p->membase + DW_UART_UCV);
 
 	/*
 	 * If the Component Version Register returns zero, we know that
@@ -303,7 +305,9 @@ static void dw8250_setup_port(struct uart_8250_port *up)
 	dev_dbg_ratelimited(p->dev, "Designware UART version %c.%c%c\n",
 		(reg >> 24) & 0xff, (reg >> 16) & 0xff, (reg >> 8) & 0xff);
 
-	reg = readl(p->membase + DW_UART_CPR);
+	reg = (p->iotype == UPIO_MEM32BE) ?
+		ioread32be(p->membase + DW_UART_CPR) :
+		readl(p->membase + DW_UART_CPR);
 	if (!reg)
 		return;
 
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ