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>] [day] [month] [year] [list]
Date:   Wed,  4 Apr 2018 12:20:47 +0200
From:   Michal Simek <michal.simek@...inx.com>
To:     linux-kernel@...r.kernel.org, monstr@...str.eu, agraf@...e.de
Cc:     Nava kishore Manne <nava.manne@...inx.com>,
        Jiri Slaby <jslaby@...e.com>, linux-serial@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-arm-kernel@...ts.infradead.org
Subject: [PATCH] serial: xuartps: Fix the early_console junk character issue

From: Nava kishore Manne <nava.manne@...inx.com>

In the early_console_setup is trying to access the unregister clock value,
so we are receiving some garbage clk value because of this wrong clk value
the early_console_setup is fail to set the required console baud rate.

This path fix this issue.

Signed-off-by: Nava kishore Manne <navam@...inx.com>
Signed-off-by: Michal Simek <michal.simek@...inx.com>
---

 drivers/tty/serial/xilinx_uartps.c | 27 +--------------------------
 1 file changed, 1 insertion(+), 26 deletions(-)

diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 19d370779767..4176c3a0b4e8 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1130,34 +1130,9 @@ static void cdns_early_write(struct console *con, const char *s,
 static int __init cdns_early_console_setup(struct earlycon_device *device,
 					   const char *opt)
 {
-	struct uart_port *port = &device->port;
-
-	if (!port->membase)
+	if (!device->port.membase)
 		return -ENODEV;
 
-	/* initialise control register */
-	writel(CDNS_UART_CR_TX_EN|CDNS_UART_CR_TXRST|CDNS_UART_CR_RXRST,
-	       port->membase + CDNS_UART_CR);
-
-	/* only set baud if specified on command line - otherwise
-	 * assume it has been initialized by a boot loader.
-	 */
-	if (device->baud) {
-		u32 cd = 0, bdiv = 0;
-		u32 mr;
-		int div8;
-
-		cdns_uart_calc_baud_divs(port->uartclk, device->baud,
-					 &bdiv, &cd, &div8);
-		mr = CDNS_UART_MR_PARITY_NONE;
-		if (div8)
-			mr |= CDNS_UART_MR_CLKSEL;
-
-		writel(mr,   port->membase + CDNS_UART_MR);
-		writel(cd,   port->membase + CDNS_UART_BAUDGEN);
-		writel(bdiv, port->membase + CDNS_UART_BAUDDIV);
-	}
-
 	device->con->write = cdns_early_write;
 
 	return 0;
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ