Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2333885imu; Thu, 10 Jan 2019 12:17:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN5BKw4xQbh5n9LQHkw+WUgthINOcpEmBLIFC6y62XDEkj/ZtFC0DeW6dKji8izoGUtzh4qJ X-Received: by 2002:a63:bf0b:: with SMTP id v11mr596748pgf.302.1547151424896; Thu, 10 Jan 2019 12:17:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547151424; cv=none; d=google.com; s=arc-20160816; b=Dfapc83rJ1Q5drVlI9KhLpCL+5Nbj/2kWdQI4lhezz1pLJb9Rc9LMBNqBT2U2Jdeuq RzJ26aIObRypZx3mZ0wgu7+N6PIb47q0ki+lYY7T034rWL4bX3Q/Gwxb3Klrm2iNKshO V6Gp6FTVgQA9SwoEyfZHbip3tbkhkHa01LxbCGN69PSSt45cgqGf9X8juq7+uTTvk226 Ln7Eebl0YrDKNKx6DVLoUgs2raAV4SMAhBnoXtLQf/pnxo7DvTh2EBiuP4i4z4cXyqTm WtuGyP3gUaVO/ns0ohAzjXmyXe/zhiOzjYHvomrNongobukIh6J98t2L6qI16p2S0yps hzjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=gLob20iXtV9X7gzcBBmME2TKZCOWr+JMlcZgUCIIS/8=; b=0j1CfAgF8fB0Xw4zPZ10Cz+EeJOx/6GzBMAnIFJ4VQQkqn+9OP9BtOkjMoy9NQ+64Y BKhfiawPamcFLfZnylFfGwJKhRdKZad7KGN7i3HKjUWgY7MwM2vmXMsz9wGy5gruvUm9 eKz2HUN7mKBq4drA5R3zCmBiP42G/dVgcTs0d6qcHMrUMXMjP373Axw9vIKQgIaPDVwX isXikYYR4vG67MYZlAnep2og4440yML34Rgvss4Mgot12uKOUe00iOPB/40vGTpfnFB+ oa7TJLhGI1yai4zzntelWWz5NtP8KQ6OWmOPOfQ0mMqu9SMc6IGlqeSXBQyHrY6KTbqr cVVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=CLGlrGmU; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4si22390823pgg.492.2019.01.10.12.16.48; Thu, 10 Jan 2019 12:17:04 -0800 (PST) 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=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=CLGlrGmU; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729489AbfAJPRF (ORCPT + 99 others); Thu, 10 Jan 2019 10:17:05 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43087 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728154AbfAJPRE (ORCPT ); Thu, 10 Jan 2019 10:17:04 -0500 Received: by mail-wr1-f68.google.com with SMTP id r10so11783976wrs.10 for ; Thu, 10 Jan 2019 07:17:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gLob20iXtV9X7gzcBBmME2TKZCOWr+JMlcZgUCIIS/8=; b=CLGlrGmU/fE47yJC3vvgHYxs6IZbObwxvuEHj2kbL3oe8qZD9l53a/Kwe6Bk2FgaIp 9xhXyueKPowmdUuSEU5VVuaL9D3TX/FsHNn/9hmmHiPlZdA0sWWZukhEQbqEhECiYsIN WT7jeR7AlwUyeyq/73ARJzgv/tk53UEQriCNroVKgClb78mcXnhyAhCF7TBMr5giV8ru 43gf+XkYWee9+UBCgjHTcsMqHlYzZdcxFKq3t/5zvI1Jj9jyXKUoVvHXZeuTmrVJz8/f OCW9mq4yDCJlx+DeIK7DQCFh1XDaRkaehXQ6nPBEWN43lj+zZGHTXrXbCpLFZjKAtcZ4 Gwng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gLob20iXtV9X7gzcBBmME2TKZCOWr+JMlcZgUCIIS/8=; b=owV3kEE/tENAsedsBjG5SmewKelC6ySnpeAazrj0QfpQLDKUlNX2LM8BBpmGZqRaWK e+F+1l1IrV6vC0kcllt0nDTSBWzx7VhUdizOvJyIp3cPo2/XBWkp4Ya9lnkHWHOsvjUv +rn02x0MDwAG98bt1kfjzhbv+hcqnujiLjPD/B/DyBC8BtByAGSRA139CEc8LrdygpGb PkTo0XuNlxGPr+zlPpr9dP7gNsuc2tGlmKWogWp9lwi/dxvSWFsDXB6rwJyKweq39UJw sm3IT1JcdqzCBoxkBfa0QHxlcnQhpgBYlooMdVUKCpqaMkyDr9h0lErbpJ62/xpjB1nD WGUg== X-Gm-Message-State: AJcUukeV2NPtCrnnpuhHsqfg95bGHnO1CgMbQkwmlvaimEMwGjCXzrlL sWmGGpj5SyrnvThsTT/URwV9V7UgBkneSfiFLWwtyw== X-Received: by 2002:adf:f5d1:: with SMTP id k17mr10352859wrp.59.1547133422301; Thu, 10 Jan 2019 07:17:02 -0800 (PST) MIME-Version: 1.0 References: <20181204135507.3706-1-anup@brainfault.org> <20181204135507.3706-2-anup@brainfault.org> In-Reply-To: From: Anup Patel Date: Thu, 10 Jan 2019 20:46:51 +0530 Message-ID: Subject: Re: [PATCH] tty/serial: emit CR before NL in RISC-V SBL console To: Andreas Schwab Cc: Greg Kroah-Hartman , Jiri Slaby , Palmer Dabbelt , Albert Ou , Atish Patra , Christoph Hellwig , Rob Herring , linux-riscv@lists.infradead.org, "linux-kernel@vger.kernel.org List" , linux-serial@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 10, 2019 at 7:37 PM Andreas Schwab wrote: > > Signed-off-by: Andreas Schwab > --- > drivers/tty/serial/earlycon-riscv-sbi.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/tty/serial/earlycon-riscv-sbi.c b/drivers/tty/serial/earlycon-riscv-sbi.c > index e1a551aae3..9c51b945b5 100644 > --- a/drivers/tty/serial/earlycon-riscv-sbi.c > +++ b/drivers/tty/serial/earlycon-riscv-sbi.c > @@ -15,8 +15,11 @@ static void sbi_console_write(struct console *con, > { > int i; > > - for (i = 0; i < n; ++i) > + for (i = 0; i < n; ++i) { > + if (s[i] == '\n') > + sbi_console_putchar('\r'); Instead of doing '\n' handling here, we should do it in BBL or OpenSBI (i.e. SBI runtime firmware) otherwise all users of SBI_CONSOLE_PUTCHAR (namely, Linux, FreeBSD, FreeRTOS, U-Boot S-mode, etc) will endup having '\n' handling. Currently, the BBL does not handle it but we have already handled this in upcoming OpenSBI. The SBI_CONSOLE_PUTCHAR is comparable to ARM semihosting early prints (refer, tty/serial/earlycon-arm-semihost.c). Even in ARM semihosting early prints the '\n' is not explicitly handled. Regards, Anup