Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1367468imu; Wed, 23 Jan 2019 15:59:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN60fjK5BVAXHZbVTGap+Imov90xmBUl4srgvoLq46cgOv8oFSC7W15Icj42Wa7EZfubFWhI X-Received: by 2002:a63:66c6:: with SMTP id a189mr3895419pgc.167.1548287948253; Wed, 23 Jan 2019 15:59:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548287948; cv=none; d=google.com; s=arc-20160816; b=zqqBiA7zG21DIT9Iu//e6wKayMVL658LwZ23ylz/Qo7Me2HNGhBjR5P0mnlG03L2Hf skZ8EPtrcCxC9h3hZSgf5CBYeB4Z3IWentiDd38TcGhBBBydd5OSngF+BD5dofKCAnMb /Ap/EkcTMhpwQmRExbTKoRXyCWiEXe3QL+txtV6R/bY2ZVPItXohabqhGvGCLRLyKH+O QWKvKe6uzdXGTSgCZ21d3n0eWQlD3KZdT+9+PLnVVnnXf8fwPHYflcs1Y+5vm2StnAKF iTdGqejutXJ5fMQQ49DXE98QgZ3hixw6fZVvmyBiC+tGJMMpBiKzW7CB7gkwPoxddyd6 DaWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=GZJe5EbKNHuto8QgrVl02gFWkFbtyAX9mqXZe888OO8=; b=edRXbZkaP+9S+UzCKcXmgqE3UP65d0C0nA/CsWVU60yixis47sFn22r9HruWtey7Of InLFe3uBpSCfbKQ0EXIT4RzJZWn6ZcyW2gmx0z0LVq3NRV/1AAb73HUM8thGbrjC1ZDt 08BEdplVtI9eUrQOa5WdjITb6Dw9ug+DFQXbpLuv7dmLIm5sM8vAMXhuS5o8F2wKYaUU dlkCZTNoU7KmTF9L785Q3AGDM0S3F8aCK5JZr/prnLiNrSzrLRrKUMwVCY6WRDnP81lX wKLTw7YqrDBA3BcitOrYXiTi1tJ0c/Yhc2kyY+mch5ylZ7QKC1RhvZQTV/veK4pdpaqN crOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=OY3tPaoH; 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 d82si19721717pfj.124.2019.01.23.15.58.51; Wed, 23 Jan 2019 15:59:08 -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=@sifive.com header.s=google header.b=OY3tPaoH; 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 S1726313AbfAWX6p (ORCPT + 99 others); Wed, 23 Jan 2019 18:58:45 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:33409 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726235AbfAWX6o (ORCPT ); Wed, 23 Jan 2019 18:58:44 -0500 Received: by mail-pl1-f193.google.com with SMTP id z23so1984087plo.0 for ; Wed, 23 Jan 2019 15:58:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=GZJe5EbKNHuto8QgrVl02gFWkFbtyAX9mqXZe888OO8=; b=OY3tPaoHGnOjIkVyDB2MTfeVzG/0RH08tubCal8WACGBYmOPAtJ+DQnFHSmccr8ham /qNmDrTL19u4v9s5/09tMco2ss4pYkj1JJf9ivG2WrpUPvhpZSIH/IbtyQ1wqNqrXWZo Up80Ty9MFBIEjuhQgklwjo+HJOoQSV0I5kL3nK70x9MxvtjRCzLXadUnEKHxUNNI5O1G W6y72nPqeR/QCpuZm8bQ+VRfFbmUd2E4/DUZIU5akC/Vs1tEiLyOY/2wOfqTxqXO0+sH GKeI/WWMHtzV3U0kwjVvVqUlcS00Wo3SJLmb++C+6RXkQj1mFI2xj58aTmoFVt1bQf5J itng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=GZJe5EbKNHuto8QgrVl02gFWkFbtyAX9mqXZe888OO8=; b=dPserzMLyHEOv8iypaZ/A4x6Kw4CGhFqZQJJmSWLCvwVLNVv/29aEA7lkrSK/EeD76 p1ICVy0+585gIxXyXF9297DHG7V4/UCyDRv0imNnlZaHtTeOL/sIln1oyHserKtEWQ57 aUKcIUsbODHUlDj2uzYqsmoKC/ymZuLCO0LL/qZesq/h67mWVOyoMilqjgmen4UmEMf+ 6fbrVNiazpH3vc0acqF80BU9NkcP3tdMTJT7dMnLrh0LtdWtUlQMB1w2I5oXEBybPkGL 0iYe4QSMBSh0VbD5ErO2wSlXI4P+BvnjFU7BiiObM+VcXmVCCuB7xFnjILXqDhg/AYdr eeIg== X-Gm-Message-State: AJcUukchBUaywBkEj2CgTKzuP8TCl+HWybsmLF4O588A9AO+8g1M8F0c MytzgS6ikCj/SQj4C1AdNUXpJw== X-Received: by 2002:a17:902:9a9:: with SMTP id 38mr4250658pln.204.1548287924007; Wed, 23 Jan 2019 15:58:44 -0800 (PST) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id w184sm25022966pgd.34.2019.01.23.15.58.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 15:58:43 -0800 (PST) Date: Wed, 23 Jan 2019 15:58:43 -0800 (PST) X-Google-Original-Date: Wed, 23 Jan 2019 15:44:01 PST (-0800) Subject: Re: [PATCH] tty/serial: use uart_console_write in the RISC-V SBL early console In-Reply-To: CC: schwab@suse.de, Greg KH , jslaby@suse.com, aou@eecs.berkeley.edu, atish.patra@wdc.com, Christoph Hellwig , robh@kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org From: Palmer Dabbelt To: anup@brainfault.org Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 11 Jan 2019 03:13:30 PST (-0800), anup@brainfault.org wrote: > On Thu, Jan 10, 2019 at 10:41 PM Andreas Schwab wrote: >> >> This enables proper NLCR processing. >> >> Suggested-by: Anup Patel >> Signed-off-by: Andreas Schwab >> --- >> drivers/tty/serial/earlycon-riscv-sbi.c | 13 ++++++++----- >> 1 file changed, 8 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/tty/serial/earlycon-riscv-sbi.c b/drivers/tty/serial/earlycon-riscv-sbi.c >> index e1a551aae3..ce81523c31 100644 >> --- a/drivers/tty/serial/earlycon-riscv-sbi.c >> +++ b/drivers/tty/serial/earlycon-riscv-sbi.c >> @@ -10,13 +10,16 @@ >> #include >> #include >> >> -static void sbi_console_write(struct console *con, >> - const char *s, unsigned int n) >> +static void sbi_putc(struct uart_port *port, int c) >> { >> - int i; >> + sbi_console_putchar(c); >> +} >> >> - for (i = 0; i < n; ++i) >> - sbi_console_putchar(s[i]); >> +static void sbi_console_write(struct console *con, >> + const char *s, unsigned n) >> +{ >> + struct earlycon_device *dev = con->data; >> + uart_console_write(&dev->port, s, n, sbi_putc); >> } >> >> static int __init early_sbi_setup(struct earlycon_device *device, >> -- >> 2.20.1 >> >> -- >> Andreas Schwab, SUSE Labs, schwab@suse.de >> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 >> "And now for something completely different." > > Looks good to me. > > Reviewed-by: Anup Patel > > Regards, > Anup Thanks. I'm going to include this in my next PR, as it's pretty self contained and is necessary to actually use this sanely.