All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: linux-arm-msm@vger.kernel.org
Cc: agross@codeaurora.org,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Subject: [RFC PATCH 2/2] tty:msm_serial: Do not reset IP if we use bootconsole
Date: Tue, 10 Jun 2014 15:32:12 +0100	[thread overview]
Message-ID: <1402410732-13021-1-git-send-email-srinivas.kandagatla@linaro.org> (raw)
In-Reply-To: <1402410678-12931-1-git-send-email-srinivas.kandagatla@linaro.org>

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@linaro.org>
---
 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

  parent reply	other threads:[~2014-06-10 14:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-10 14:31 [RFC PATCH 0/2] MSM/QCOM: Fix few race conditions when DEBUG_LL is enabled Srinivas Kandagatla
2014-06-10 14:31 ` [RFC PATCH 1/2] soc: qcom: do not disable the iface clock in probe Srinivas Kandagatla
2014-06-10 15:20   ` Kumar Gala
2014-06-10 17:39     ` Stephen Boyd
2014-06-10 17:46       ` Andy Gross
2014-06-10 17:47       ` Srinivas Kandagatla
2014-06-10 17:57         ` Andy Gross
2014-07-17 20:18   ` Srinivas Kandagatla
2014-08-12  4:25   ` Srinivas Kandagatla
2014-06-10 14:32 ` Srinivas Kandagatla [this message]
2014-06-10 14:37   ` [RFC PATCH 2/2] tty:msm_serial: Do not reset IP if we use bootconsole Srinivas Kandagatla
2014-06-17 21:09   ` Stephen Boyd
2014-06-17 22:04     ` Srinivas Kandagatla
2014-07-10 13:38     ` Srinivas Kandagatla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1402410732-13021-1-git-send-email-srinivas.kandagatla@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=agross@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.