From patchwork Thu May 29 08:48:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 31106 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5FF0920068 for ; Thu, 29 May 2014 08:49:07 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id rd3sf111935pab.11 for ; Thu, 29 May 2014 01:49:06 -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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=3UyYELX+S+26eUm9qYpau+QcehbWk2NR0H9tkamtnyc=; b=VgwZa6GIrv6PONgJWzd+FZKhk0hnixTeBmX2LWiXPpXnqLEiZX5xQ3dBO8O3gdOX4o wJRv2W1EPRuLfwlAUEvdHuB2mb5qg2UfHrg5yJuwRsWBpuOPsSKa7Pftw1ChyA3puMt8 6LGAw0aKOVMUo3PB6UG1EbO3XQg8IQCCa+8kac3zeFed506I4TpQi4loNJfC1w1Go8JV vHUzHfx5aqri7xxh3zP4DNUI25Ipodj/MVlOvICJX/YrIdq/Se1uTwocaFyKgPPAcFvm qtwvTgAOgHmmhIVwkeT6UcXYVBKiTnWOdAqyV5R9D1y3jMl7xFmTpshJISCap0cABbKg l+9g== X-Gm-Message-State: ALoCoQnffxHLfH4De/zWGj/0pMFaOmeSPXqtLL/aAnnATQ8Pqh7iKZ0ce44Wd5pIcpySmp3vE9xt X-Received: by 10.68.183.197 with SMTP id eo5mr2290566pbc.9.1401353346581; Thu, 29 May 2014 01:49:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.101.247 with SMTP id u110ls478572qge.79.gmail; Thu, 29 May 2014 01:49:06 -0700 (PDT) X-Received: by 10.52.227.138 with SMTP id sa10mr4214055vdc.25.1401353346480; Thu, 29 May 2014 01:49:06 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id z8si5189540vdz.102.2014.05.29.01.49.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 May 2014 01:49:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.177 as permitted sender) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id db11so24343veb.36 for ; Thu, 29 May 2014 01:49:06 -0700 (PDT) X-Received: by 10.220.7.131 with SMTP id d3mr39441vcd.45.1401353346322; Thu, 29 May 2014 01:49:06 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp11316vcb; Thu, 29 May 2014 01:49:05 -0700 (PDT) X-Received: by 10.194.92.7 with SMTP id ci7mr8274190wjb.7.1401353344779; Thu, 29 May 2014 01:49:04 -0700 (PDT) Received: from mail-we0-f173.google.com (mail-we0-f173.google.com [74.125.82.173]) by mx.google.com with ESMTPS id k10si37778777wjf.110.2014.05.29.01.49.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 May 2014 01:49:01 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 74.125.82.173 as permitted sender) client-ip=74.125.82.173; Received: by mail-we0-f173.google.com with SMTP id u57so32001wes.32 for ; Thu, 29 May 2014 01:49:01 -0700 (PDT) X-Received: by 10.180.198.178 with SMTP id jd18mr57399357wic.24.1401353341014; Thu, 29 May 2014 01:49:01 -0700 (PDT) Received: from sundance.lan (cpc4-aztw19-0-0-cust157.18-1.cable.virginm.net. [82.33.25.158]) by mx.google.com with ESMTPSA id k2sm40794wjq.20.2014.05.29.01.48.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 May 2014 01:48:59 -0700 (PDT) From: Daniel Thompson To: Greg Kroah-Hartman Cc: Daniel Thompson , linux-serial@vger.kernel.org, patches@linaro.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, John Stultz , Anton Vorontsov , Colin Cross , kernel-team@android.com, Jason Wessel , kgdb-bugreport@lists.sourceforge.net, Jiri Slaby , Dirk Behme , Doug Anderson , Christophe Leroy Subject: [PATCH tty-next v2 1/4] serial: cpm_uart: No LF conversion in put_poll_char() Date: Thu, 29 May 2014 09:48:43 +0100 Message-Id: <1401353326-14148-2-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1401353326-14148-1-git-send-email-daniel.thompson@linaro.org> References: <20140528200344.GA2750@kroah.com> <1401353326-14148-1-git-send-email-daniel.thompson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.thompson@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.128.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , In (c7d44a02a serial_core: Commonalize crlf when working w/ a non open console port) the core was modified to make the UART poll_put_char() automatically convert LF to CRLF. This driver's poll_put_char() adds a CR itself and this was not disabled by the above patch meaning currently it sends two CR characters. The code to issue a character is shared by the console write code (where driver must do LF to CRLF conversion, although it can make use of the uart_console_write() helper function) and the poll_put_char (where driver must not do the conversion). For that reason we add a flag rather than simply rip out the conversion code. Signed-off-by: Daniel Thompson Cc: Doug Anderson Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: Christophe Leroy Cc: linux-serial@vger.kernel.org --- drivers/tty/serial/cpm_uart/cpm_uart_core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_core.c b/drivers/tty/serial/cpm_uart/cpm_uart_core.c index 7d76214..aa60e6d 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c @@ -971,7 +971,7 @@ static void cpm_uart_config_port(struct uart_port *port, int flags) * Note that this is called with interrupts already disabled */ static void cpm_uart_early_write(struct uart_cpm_port *pinfo, - const char *string, u_int count) + const char *string, u_int count, bool handle_linefeed) { unsigned int i; cbd_t __iomem *bdp, *bdbase; @@ -1013,7 +1013,7 @@ static void cpm_uart_early_write(struct uart_cpm_port *pinfo, bdp++; /* if a LF, also do CR... */ - if (*string == 10) { + if (handle_linefeed && *string == 10) { while ((in_be16(&bdp->cbd_sc) & BD_SC_READY) != 0) ; @@ -1111,7 +1111,7 @@ static void cpm_put_poll_char(struct uart_port *port, static char ch[2]; ch[0] = (char)c; - cpm_uart_early_write(pinfo, ch, 1); + cpm_uart_early_write(pinfo, ch, 1, false); } #endif /* CONFIG_CONSOLE_POLL */ @@ -1275,7 +1275,7 @@ static void cpm_uart_console_write(struct console *co, const char *s, spin_lock_irqsave(&pinfo->port.lock, flags); } - cpm_uart_early_write(pinfo, s, count); + cpm_uart_early_write(pinfo, s, count, true); if (unlikely(nolock)) { local_irq_restore(flags);