[RFC PATCH 2/2] tty:msm_serial: Do not reset IP if we use bootconsole

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The use case is when we boot the platform with bootconsole enabled. What
I noticed is that the console gets locked sometimes up before the bootconsole
is disabled.

As part of console setup in serial driver it resets that hardware which
is a race condition to bootconsole using the same hardware. This
patch adds a check to see if there is bootconsole before reseting the hardware.

Am sure there are better ways to solve this, so marking this patch as
RFC. Any suggestions are welcome.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx>
---
 drivers/tty/serial/msm_serial.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
index 778e376..7078153 100644
--- a/drivers/tty/serial/msm_serial.c
+++ b/drivers/tty/serial/msm_serial.c
@@ -913,6 +913,17 @@ static void msm_console_write(struct console *co, const char *s,
 	spin_unlock(&port->lock);
 }
 
+static int have_boot_console(void)
+{
+	struct console *con;
+
+	for_each_console(con)
+		if (con->flags & CON_BOOT)
+			return 1;
+
+	return 0;
+}
+
 static int __init msm_console_setup(struct console *co, char *options)
 {
 	struct uart_port *port;
@@ -943,7 +954,12 @@ static int __init msm_console_setup(struct console *co, char *options)
 		baud = 115200;
 	msm_set_baud_rate(port, baud);
 
-	msm_reset(port);
+	/*
+	 * do not reset if we are the boot console
+	 * can result in a lockup from bootconsole
+	 */
+	if (have_boot_console())
+		msm_reset(port);
 
 	if (msm_port->is_uartdm) {
 		msm_write(port, UART_CR_CMD_PROTECTION_EN, UART_CR);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux