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: 31675 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5B1292054B for ; Tue, 10 Jun 2014 14:32:23 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id f10sf1643158yha.11 for ; Tue, 10 Jun 2014 07:32:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=uJRH1GshVNPQio5odF71gkJX0Wu0U5WekN8xnnup9pQ=; b=gkt+7VY6rmZHVuq9VjDpj+1wEoZs/+dFJWprXZcpnk0jteZRFysU+KQC77XCBCLfz7 pUKVlQAbrjlH3Elvg0aFIDOB7KqzEWCtQtOaxG9bPbrpAcyif+iE5qXTMgr7kz+AnPYx HxhA0xeVaxuoDFSAg6+NAUzNZUPZPMvg3XftWffvFjio+fHHTo66aRdcWSPFRX1eyy3h ObHAUwT7ETApdA+czstu+Jp4q5jt3TB5u6q7SKyYCr8nT+P+vaigqevqxcwPXSEuOIL9 K0gp2LDX+UW48vnOp1L77PPzHj6+UiPViD9cilFUNdBCiADmmwuI/z7OwO7w8pXjUAxR bUwA== X-Gm-Message-State: ALoCoQkudYTVwoGGxIH4gQw/+NC4is6nWV2Tfbpb2/vzdG6XwiHZihhmQ6bf+T9AWNHHX9uus05+ X-Received: by 10.58.151.201 with SMTP id us9mr4996290veb.23.1402410743113; Tue, 10 Jun 2014 07:32:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.82.37 with SMTP id g34ls2162648qgd.64.gmail; Tue, 10 Jun 2014 07:32:23 -0700 (PDT) X-Received: by 10.52.33.241 with SMTP id u17mr873600vdi.82.1402410742980; Tue, 10 Jun 2014 07:32:22 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id k3si13158709vey.59.2014.06.10.07.32.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Jun 2014 07:32:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id id10so6235656vcb.10 for ; Tue, 10 Jun 2014 07:32:22 -0700 (PDT) X-Received: by 10.58.216.163 with SMTP id or3mr439584vec.80.1402410742890; Tue, 10 Jun 2014 07:32:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp229988vcb; Tue, 10 Jun 2014 07:32:22 -0700 (PDT) X-Received: by 10.66.192.73 with SMTP id he9mr6095341pac.88.1402410742043; Tue, 10 Jun 2014 07:32:22 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ff2si34535131pbc.132.2014.06.10.07.32.21; Tue, 10 Jun 2014 07:32:21 -0700 (PDT) Received-SPF: none (google.com: linux-arm-msm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751320AbaFJOcV (ORCPT + 3 others); 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-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: list List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: srinivas.kandagatla@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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);