From patchwork Mon Jun 13 19:02:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 69908 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp1691075qgf; Mon, 13 Jun 2016 12:03:29 -0700 (PDT) X-Received: by 10.107.5.12 with SMTP id 12mr9006964iof.160.1465844609218; Mon, 13 Jun 2016 12:03:29 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n6si19208331pav.242.2016.06.13.12.03.28; Mon, 13 Jun 2016 12:03:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424097AbcFMTDU (ORCPT + 30 others); Mon, 13 Jun 2016 15:03:20 -0400 Received: from mail-pf0-f180.google.com ([209.85.192.180]:34447 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424055AbcFMTC5 (ORCPT ); Mon, 13 Jun 2016 15:02:57 -0400 Received: by mail-pf0-f180.google.com with SMTP id 62so48875147pfd.1 for ; Mon, 13 Jun 2016 12:02:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=l30OmqUlOWjFBYQGcZYf9wwsywdHRUc1cS6CLJHAy3w=; b=XbHsPJD3uCZJ3uPKaiAVt8dLzqlAMS6hPjuhyjgASOJreVzbBFTMYNYUo1QL4zUlwd Qas15dFNSUHBMFNE5TNHOnwzSxGnKdx0tpOv1TvZwRg27lh3LOSgETHZOxM8XYuA+uEe S8944YlLGvLHTFQxsJECsVIw2q6GV/j+JHUxU= 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; bh=l30OmqUlOWjFBYQGcZYf9wwsywdHRUc1cS6CLJHAy3w=; b=Pil/6pLNDcCMLjaZgKYZ+sTPj4ZznMKtZJ+EK4fe3JCsL1Nu17WSCAGZyRNeaFLes0 CVojWXbAid9NEkI4ZGv9gxwn2wZCQcKXinuQxgqc6nvfcaKLt9qRT/7p534WdP6q6nkD N3i4QvtABolABRdXdstzRJfHqxNXTbqVHEx11FaNKTVGqIvT7aIIhzf8s8zAGBUR0gYM 2ZIgV0ZZUeF82WfU5mwuWzP+62oNp/Zfd/xnma1VUaNDITezb4WKf+dsMxBmruCU8DUq Qsi281XsRj8Omb5gDFSg1JjcWDEB+boX59c9NF7+d8rCxxbCk8jyWg0dejSa6+KS7bUQ a9rw== X-Gm-Message-State: ALyK8tItIuwowg9PuMzFqHAPOvskCs0BlmfLmg6+IbAWP+7yjTUZRa4I1nToR5EIeQqPnKMw X-Received: by 10.98.46.70 with SMTP id u67mr22200902pfu.134.1465844575855; Mon, 13 Jun 2016 12:02:55 -0700 (PDT) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id f27sm39484643pff.17.2016.06.13.12.02.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Jun 2016 12:02:55 -0700 (PDT) From: Bjorn Andersson To: Andy Gross , Stephen Boyd , David Brown Cc: Greg Kroah-Hartman , Jiri Slaby , linux-arm-msm@vger.kernel.org (open list:ARM/QUALCOMM SUPPORT), linux-soc@vger.kernel.org (open list:ARM/QUALCOMM SUPPORT), linux-serial@vger.kernel.org (open list:SERIAL DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [RFC PATCH] tty: serial: msm_serial: Don't reset uart on set_termios Date: Mon, 13 Jun 2016 12:02:51 -0700 Message-Id: <1465844571-1229-1-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Upon opening the tty, uart_open() ends up calling msm_set_baud_rate() which resets the uart block. If this happens as we're coming out of msm_console_write() a full fifo worth of console output will be discarded. Cc: Stephen Boyd Signed-off-by: Bjorn Andersson --- As reported here: https://bugs.96boards.org/show_bug.cgi?id=378 drivers/tty/serial/msm_serial.c | 18 ------------------ 1 file changed, 18 deletions(-) -- 2.5.0 diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c index b7d80bd57db9..93a10ac44933 100644 --- a/drivers/tty/serial/msm_serial.c +++ b/drivers/tty/serial/msm_serial.c @@ -813,23 +813,6 @@ static unsigned int msm_get_mctrl(struct uart_port *port) return TIOCM_CAR | TIOCM_CTS | TIOCM_DSR | TIOCM_RTS; } -static void msm_reset(struct uart_port *port) -{ - struct msm_port *msm_port = UART_TO_MSM(port); - - /* reset everything */ - msm_write(port, UART_CR_CMD_RESET_RX, UART_CR); - msm_write(port, UART_CR_CMD_RESET_TX, UART_CR); - msm_write(port, UART_CR_CMD_RESET_ERR, UART_CR); - msm_write(port, UART_CR_CMD_RESET_BREAK_INT, UART_CR); - msm_write(port, UART_CR_CMD_RESET_CTS, UART_CR); - msm_write(port, UART_CR_CMD_SET_RFR, UART_CR); - - /* Disable DM modes */ - if (msm_port->is_uartdm) - msm_write(port, 0, UARTDM_DMEN); -} - static void msm_set_mctrl(struct uart_port *port, unsigned int mctrl) { unsigned int mr; @@ -972,7 +955,6 @@ static int msm_set_baud_rate(struct uart_port *port, unsigned int baud, msm_write(port, 10, UART_TFWR); msm_write(port, UART_CR_CMD_PROTECTION_EN, UART_CR); - msm_reset(port); /* Enable RX and TX */ msm_write(port, UART_CR_TX_ENABLE | UART_CR_RX_ENABLE, UART_CR);