Received: by 10.213.65.68 with SMTP id h4csp3914587imn; Tue, 10 Apr 2018 06:36:53 -0700 (PDT) X-Google-Smtp-Source: AIpwx49AxUleF0bmFhkkEoGutnaqcfh/T9TMyDmDaFUmDYEio99BRwpdmb6GccXHQgNwYnQtXGkn X-Received: by 2002:a17:902:28c4:: with SMTP id f62-v6mr481995plb.19.1523367413409; Tue, 10 Apr 2018 06:36:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523367413; cv=none; d=google.com; s=arc-20160816; b=h0poxiTenBoaXGnpBEopml3eANOXJCEsB2Ss3GttB3l5J7ftAL+vVkCVBlvGSbLZIm rLdb4r8ODPHzDJz/aE4ae05mVO1aR1inlbSFuKBjQrHK6FuQGJlnoUN4W0P9bYMuH3dZ vijSysMvxd0hB4zrK6cRRWYJw+efTmvhk1BuU7ASBOu+ODhJiu2n7yLsH/5jqhkoljE8 km01SnPYnOpICCru9TxKC8d+tZ6rG6/TIcjddypkon2sbmHeUMzBde6FqCQ7jlGyf/BC etSS9oT0eTj01TqZItQBceOF9w1j+ogFpmE9PFzMTGPk62bxTbXJ20QwHj74vcny6bQs PHZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Jm/Bgx3uPrh5QWpCac5UH9qqTA77jKi2RVPcX3gxJDk=; b=urvFbicKIjVsjxrEthiJuONiByM1ZrEwgYeKTrtvDnMpBIspUQl/nRX0hzkmdk6GsU 8znAAnp2lVaAu9OonjJOn9kU5bvlLRJcvFABy/AaTRACjuoeOEboAsMI2BVJtVHWlr+p pMidUsYN+4TDdNdtLGd8P6v6KQl9HaL2Z1ozFmRvz96xZ9f0kkgrOSKk+fBbUJ4VJa+D fYOp5+9yrDbFaY+udY9srSlCbciafdRxY9g38rc2S43dD03UrXKmd+++UE8hg63Dc/LI u1sl3uwmV9bZKKjuJzvqH4aDCEGDLv/aIW4zF/Nd9T29Q9TdQ2q4M+i+wM3IYSDCrlDS 9/vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@monstr-eu.20150623.gappssmtp.com header.s=20150623 header.b=a54fHt+G; 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 e5-v6si2933857plk.730.2018.04.10.06.36.16; Tue, 10 Apr 2018 06:36:53 -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=fail header.i=@monstr-eu.20150623.gappssmtp.com header.s=20150623 header.b=a54fHt+G; 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 S1753824AbeDJNdg (ORCPT + 99 others); Tue, 10 Apr 2018 09:33:36 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:37329 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752912AbeDJNdd (ORCPT ); Tue, 10 Apr 2018 09:33:33 -0400 Received: by mail-wr0-f194.google.com with SMTP id l49so12847449wrl.4 for ; Tue, 10 Apr 2018 06:33:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id; bh=Jm/Bgx3uPrh5QWpCac5UH9qqTA77jKi2RVPcX3gxJDk=; b=a54fHt+G0J8ZsZHWF5vd77QLM0IV6M5IZdRaoENEU4RsqZ5APUP1kBE29UGrvY+xJK ztLcl0mLDlLS4toVbTe3ZJnwktxzYklzAPjlTaXDjJ6F7hN+u4Lato98u8qj096RRH3Z 7VNxXPJYNq2F+amg1To56RDIKlZ7ezY2CBtog66CX26XnP3WBNSbpWxVhZwUmbD8X9Gx SN1Z21ovMNryWS9uh4iCQej4BIAscStdciNrWfrn73oTj1e6qLuoAFhOSLiHI0AnEXDb 1+jrSp4FRe86fP7dn7NqId7G74dJcHne1Ss1q2PX0L/x/oeZlwC0hY7j4X4wXIJILfaH N9Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=Jm/Bgx3uPrh5QWpCac5UH9qqTA77jKi2RVPcX3gxJDk=; b=pXyTV1G2dzHd6m4dgJ8L+K2lx3TkrbR+a6LTsAIVs9NX5LgEaheIHOjvvZXykLrE6o YM7FWDbkPGPy4uu9hlkYAvGYAy8AAn6R6STOeye5rNXcvAefLxLK8tsRlOq2tmFFisJy Sl62087v5G3bkTTCe4iQCna5N/wP79RkiL1V1EDnlYsdQK1V/2OwvJ9r74sWtjSfu8AP bEOwv+ZpNu8cCJ4jxF6SLNdtjKXXmsn6KZAjCj+OL8VWXD2ejxdZhkyOqGG8L31PniCC UcpPX8p8N03T8j/hoAEyxIdUYIJRuklOihdQ1cBg87GyVoD/NnvGUdY2n6b7PNSEb6qA GYQQ== X-Gm-Message-State: ALQs6tAkLxqoJSxsIVTnjWiCXW2YM4UYenhSJ7uHPAQ5DDK5pKlw2fNy xI9SPQh7g0mh9erJWiTzrowRgLw6 X-Received: by 10.223.184.35 with SMTP id h32mr347393wrf.209.1523367212104; Tue, 10 Apr 2018 06:33:32 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id a63sm4047907wrc.22.2018.04.10.06.33.31 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 10 Apr 2018 06:33:31 -0700 (PDT) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu Cc: Jiri Slaby , linux-serial@vger.kernel.org, Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org Subject: [PATCH] tty: serial: xuartps: Setup early console when uartclk is also passed Date: Tue, 10 Apr 2018 15:33:30 +0200 Message-Id: <2ef5ac478f8d32bc807ead758eb5d60744a44515.1523367208.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/xilinx_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(struct 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 = 0, bdiv = 0; u32 mr; int div8; -- 1.9.1