From patchwork Tue Jun 10 14:32:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 4329271 Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 87FE69F3B4 for ; Tue, 10 Jun 2014 14:32:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A9BD4202C8 for ; Tue, 10 Jun 2014 14:32:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BE2FE202BE for ; Tue, 10 Jun 2014 14:32:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751320AbaFJOcV (ORCPT ); Tue, 10 Jun 2014 10:32:21 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:57714 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751124AbaFJOcU (ORCPT ); Tue, 10 Jun 2014 10:32:20 -0400 Received: by mail-wi0-f181.google.com with SMTP id n3so3542910wiv.2 for ; Tue, 10 Jun 2014 07:32:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=caM8C043ueaz3f8NwPSroxa6qqHQJKwYx06CtWJtdXI=; b=VemhOMi0YKX3Yg/w3BmwyOOAn+HKWIu50x+x8GqvornqW/S1rUDt6jNIbfwbG1x8u8 EQDs7WXN5HDzJZOTWhVWySK3HJkRtJCLmRt6pXS+NC1j0dl4vX19MvLIMoGzuah08s83 KPAYSXRy9dHiLlp2OfKhFgoqRlJLqWd9qAWRXOs1loZLeNM4hdb6b2pzSiWVl0kZPo0t 6i9xUO0ebRTKB5Ss5IRIhhgmGytYELqgfuDs18uVVGnKb1sZnbIVJ4Hqh+nI9LIc82iR zGEYJDvTriZWVI5WD/T9kgi6j0XuT1DXGOEqINXyzxAC093DerrRfTqej7w2qWo/LbFr 6e5g== X-Gm-Message-State: ALoCoQmJtiot+S+dnHw5NfuAXlGNf/ozA4xREscuQ/91y5q3QjJPeNbwG8FAqgct/x1r9QHDQ7gZ X-Received: by 10.180.99.166 with SMTP id er6mr39080438wib.48.1402410736037; Tue, 10 Jun 2014 07:32:16 -0700 (PDT) Received: from srini-ThinkPad-X1-Carbon-2nd.dlink.com (host-78-144-120-232.as13285.net. [78.144.120.232]) by mx.google.com with ESMTPSA id em7sm29856121wjd.34.2014.06.10.07.32.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Jun 2014 07:32:15 -0700 (PDT) From: Srinivas Kandagatla To: linux-arm-msm@vger.kernel.org Cc: agross@codeaurora.org, Srinivas Kandagatla 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 Message-Id: <1402410732-13021-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1402410678-12931-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1402410678-12931-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);