Received: by 10.192.165.148 with SMTP id m20csp3169951imm; Mon, 23 Apr 2018 01:39:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx48FwNN0G84I4umjHcTw7MZnCq62pm14Yiykq4EMfvAVQ5tyomQLeQ33wNgFWRNuCNkqLcDP X-Received: by 10.98.46.5 with SMTP id u5mr18987352pfu.247.1524472781267; Mon, 23 Apr 2018 01:39:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524472781; cv=none; d=google.com; s=arc-20160816; b=xo/E9Sm3ZDCJ5q5D6xiQp9NcgM+HndrR2w6jAELa4wvs/TXEMlCwsBHXPptwxA41dd Vz7Krj1an1KTeWlIDosuRttIX7gerqCw0T5lp2PfvIGs+p05pTTQDXKyz0+VsM34nujO UCbPMjV2NuTnpXvZ1Kw8EmyfbHNbbZywrszf3l7ozfrIabWnuBO2EZuIFWqBSLSQvybO OCd7bd2euuwemD8LX5qO2hyGmmKcvLr0GaqRmeJ/iIgDdfNNZd3szs9Xa0e3STII/avE UG6di8Uf+Yuw1zuQD/nX5kDuSnPt5ZjzagignJfSSZNKLjfGLmjwYvqDnT4f1BNsm3ug oP0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:mime-version:user-agent:date :message-id:openpgp:from:references:cc:to:subject:reply-to :dkim-signature:arc-authentication-results; bh=9xgUyubzhWXLSFeH+U6XjqG2NinOjaCd7/2nU69thIg=; b=LXr2AcpgjlZZh2MIlMPnlcAo8iIS1MRnBDLTetKEo7NIoQx6eqD2a3vH9Vn72hjTFz tlSMNhmKCLoIM4dncUDQBRonUDoh4tBnEtj5nlEJ3YLZ4ceaZNOFPuz4XRwhPnjjoNio RGpEN4DE6RgW9NI7DTzcOfk2+FijDWvAYKiBFFJA0nittw8Fqdzm+u8KNBYhuZ/X+k8w CljU7IFEluCPCTw+IKmZzud/EJYoBdmja4mcxEiXTNLwo/hYMO39czdtIpm9qEFeDowF zDnQOWRvQcausNXgwXVZdLiWRl8pgbzMZL7H9SZ5MFacM+Gzgni6nsyZV/llfrIMROZw qf2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@monstr-eu.20150623.gappssmtp.com header.s=20150623 header.b=ZhYmtr5o; 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 89-v6si11176135plc.444.2018.04.23.01.39.26; Mon, 23 Apr 2018 01:39:41 -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=@monstr-eu.20150623.gappssmtp.com header.s=20150623 header.b=ZhYmtr5o; 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 S1754652AbeDWIhc (ORCPT + 99 others); Mon, 23 Apr 2018 04:37:32 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:42029 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754635AbeDWIhW (ORCPT ); Mon, 23 Apr 2018 04:37:22 -0400 Received: by mail-wr0-f196.google.com with SMTP id s18-v6so38755057wrg.9 for ; Mon, 23 Apr 2018 01:37:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=reply-to:subject:to:cc:references:from:openpgp:message-id:date :user-agent:mime-version:in-reply-to; bh=9xgUyubzhWXLSFeH+U6XjqG2NinOjaCd7/2nU69thIg=; b=ZhYmtr5oyXcSs4yKvZGuSMzWxpOvNBmuzVp1j2U7Xyh0rRaBTePyfxogCjHX7l2LpU GJq1zvRY0LOBVtv8NBghQU05vnRnu4ysrHXLtYDSPDpbq3JgZOM0A0euVnGNpZokMzr+ w5UEDq0g9V/RvcrYccG+qvaXONj6EaubGA6c9zpzd9pSoKX1vXocxwYOo7XZrCx49Hdi Xri40xnJ1Qcg9kWuiEMrZ/xxjI6jsLCn+dG745He4v5g7bgDU8tFyKaax9I0MBDGdx7b ypBtvWmSfSKlJMZ/vKELnklgyGqBBGH1NhmytF1UVgxDChEjQXLLVALtN0XA0dGLiVHP X7ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from:openpgp :message-id:date:user-agent:mime-version:in-reply-to; bh=9xgUyubzhWXLSFeH+U6XjqG2NinOjaCd7/2nU69thIg=; b=q6/LSYjTt0mSpLb8PIpZKmMAkFEfb9+WzD5uudqbTb1wVeqdAgtPHM90CrGrl8IxdL Ch1EmeV43fpnH76olXgGrJAd4BhyI3bbNmzx4ocQtMBRePKoYJE8I7+pKmD6MUqFNlwe 7HBv+Rkw43Klm5kBYmXQYxVcvgp5mWsRcFKafpEZS96pkkG7rK7OAS4Oq/4sNMdyyfnM qD1SSnaRlqIebEa/aokhcIIhEIy8JYam79oZTolKeiEoCZmD8vKvhXId+L9bG3Mph5Xz dsThYJjPqB+UIBhKnQ4zzK4/fjQHUv//pQSBuJmjp0PfvWlwGUznfwMGm/H88JmZExpg 3M7g== X-Gm-Message-State: ALQs6tDV11iP9q7LT2Nqh4ZUwuHwmwIjZ8IN3FS9kvLSMbF+LpHiEviW mtClLSD1aMSMBR4JEW6U4XVgBw== X-Received: by 10.28.51.79 with SMTP id z76mr9665361wmz.113.1524472639966; Mon, 23 Apr 2018 01:37:19 -0700 (PDT) Received: from [64.233.167.108] ([149.199.62.254]) by smtp.gmail.com with ESMTPSA id a129sm13435191wme.3.2018.04.23.01.37.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 01:37:19 -0700 (PDT) Reply-To: monstr@monstr.eu Subject: Re: [PATCH] tty: serial: xuartps: Setup early console when uartclk is also passed To: Greg Kroah-Hartman , Michal Simek Cc: linux-kernel@vger.kernel.org, Jiri Slaby , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <2ef5ac478f8d32bc807ead758eb5d60744a44515.1523367208.git.michal.simek@xilinx.com> <20180423080641.GA20149@kroah.com> From: Michal Simek Openpgp: preference=signencrypt Message-ID: Date: Mon, 23 Apr 2018 10:37:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180423080641.GA20149@kroah.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XGTjHajY7qfXSCDNdLgqD6Vk4aEUur3dO" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --XGTjHajY7qfXSCDNdLgqD6Vk4aEUur3dO Content-Type: multipart/mixed; boundary="KPaznCRZjRlxfSqw507PZC086LxXJF86E"; protected-headers="v1" From: Michal Simek Reply-To: monstr@monstr.eu To: Greg Kroah-Hartman , Michal Simek Cc: linux-kernel@vger.kernel.org, Jiri Slaby , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org Message-ID: Subject: Re: [PATCH] tty: serial: xuartps: Setup early console when uartclk is also passed References: <2ef5ac478f8d32bc807ead758eb5d60744a44515.1523367208.git.michal.simek@xilinx.com> <20180423080641.GA20149@kroah.com> In-Reply-To: <20180423080641.GA20149@kroah.com> --KPaznCRZjRlxfSqw507PZC086LxXJF86E Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 23.4.2018 10:06, Greg Kroah-Hartman wrote: > On Tue, Apr 10, 2018 at 03:33:30PM +0200, Michal Simek wrote: >> Baudrate calculation depends on requested baudrate and uart clock. >> This patch is checking that uartclk is also passed. >> >> The same logic is used 8250_early.c/init_port function. >> >> Signed-off-by: Michal Simek >> --- >> >> drivers/tty/serial/xilinx_uartps.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/x= ilinx_uartps.c >> index b9b2bc76bcac..a654cda203c7 100644 >> --- a/drivers/tty/serial/xilinx_uartps.c >> +++ b/drivers/tty/serial/xilinx_uartps.c >> @@ -1181,7 +1181,7 @@ static int __init cdns_early_console_setup(struc= t earlycon_device *device, >> /* only set baud if specified on command line - otherwise >> * assume it has been initialized by a boot loader. >> */ >> - if (device->baud) { >> + if (port->uartclk && device->baud) { >> u32 cd =3D 0, bdiv =3D 0; >> u32 mr; >> int div8; >> --=20 >> 1.9.1 >=20 > This patch conflicts with the previous patch you sent: Subject: [PATCH]= > serial: xuartps: Fix the early_console junk character issue >=20 > So, which one should I apply? >=20 > I've dropped both from my review queue now, please resend the one(s) yo= u > want applied, in a patch series if needed. First of all thanks for dropping. I forget that I have sent it in past. Both patches are targeting the same problem. The first one is more destructive. And this one is what 8250 is doing. I have also sent "[PATCH] earlycon: Initialize port->uartclk based on clock-frequency property" which is filling uartclk based on DT to do proper divider calculation. It means when patch above is applied we can keep divider calculation in the driver because it is using right values. If not we need to remove that baudrate calculation because it is not correct (uartclk is hardcoded to BASE_BAUD * 16 in of_setup_earlycon). And it is really a question if "port->uartclk =3D BASE_BAUD * 16" should be in of_setup_earlycon. Thanks, Michal --=20 Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Xilinx Microblaze Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP SoCs --KPaznCRZjRlxfSqw507PZC086LxXJF86E-- --XGTjHajY7qfXSCDNdLgqD6Vk4aEUur3dO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iEYEARECAAYFAlrdmzgACgkQykllyylKDCHrfwCfffPyzm2suay6gS7WHBXfUFBJ s8QAnA9jh/b+Vh6nP47P4wViogwE6Efg =6k+y -----END PGP SIGNATURE----- --XGTjHajY7qfXSCDNdLgqD6Vk4aEUur3dO--