From patchwork Wed Jun 11 17:58:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 4337671 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B1EB2BEEAA for ; Wed, 11 Jun 2014 18:01:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E01B820254 for ; Wed, 11 Jun 2014 18:01:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1518C20218 for ; Wed, 11 Jun 2014 18:01:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WumnV-0003oP-VC; Wed, 11 Jun 2014 17:58:53 +0000 Received: from mail-ob0-x22f.google.com ([2607:f8b0:4003:c01::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WumnT-0003lE-DQ for linux-arm-kernel@lists.infradead.org; Wed, 11 Jun 2014 17:58:51 +0000 Received: by mail-ob0-f175.google.com with SMTP id wo20so107656obc.20 for ; Wed, 11 Jun 2014 10:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=YdoAWbjKIlOzv0FqLrQ0JuspV6ggfQxPd4kRPV689+E=; b=wz9PSilmAvVnD7PK7bia5cRiDsjHXJovRWSVqRbwrNamQ1/8n70yZ32v8ZN3wp1ieq lmLubYrW1jw4oOwCEjti3DNGUxdW7BE3WqAArg2UjGYDNLQSSD9H8q27nAarMewib3gZ Or+u8UP8NxuSq182zMTupBJhgdecM8c33XAs11vIGwPNOw+r1OMV8LTFCZwU/p0b9WdU 3Rhd3ATpn9qtMtPic4GbeXjvp98JYeLd3JJ8n3xIlGIpRCEj58db3Hwsp5dn5afgblFj W2/Blgj5Vao13UfdyB9m8N24rN3D9/bjSH45yV0e/qccTCvJyPLRsuMWtFC8kiIk9YZI o4qg== X-Received: by 10.182.20.241 with SMTP id q17mr4095827obe.83.1402509509735; Wed, 11 Jun 2014 10:58:29 -0700 (PDT) Received: from [192.168.1.238] (66-90-144-10.dyn.grandenetworks.net. [66.90.144.10]) by mx.google.com with ESMTPSA id e16sm50179770obs.26.2014.06.11.10.58.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Jun 2014 10:58:29 -0700 (PDT) Message-ID: <539898C3.8090903@gmail.com> Date: Wed, 11 Jun 2014 12:58:27 -0500 From: Rob Herring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Tony Luck Subject: Re: [PATCH v2 3/7] tty/serial: convert 8250 to generic earlycon References: <1397859600-11507-1-git-send-email-robherring2@gmail.com> <1397859600-11507-4-git-send-email-robherring2@gmail.com> <20140503220731.GA10927@kroah.com> <20140503221658.GA13403@kroah.com> In-Reply-To: X-Enigmail-Version: 1.6 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140611_105851_506460_2C00C8B8 X-CRM114-Status: GOOD ( 21.48 ) X-Spam-Score: -0.6 (/) Cc: Russell King , Arnd Bergmann , Greg Kroah-Hartman , Will Deacon , Linux Kernel Mailing List , Yinghai Lu , "linux-serial@vger.kernel.org" , Catalin Marinas , Andrew Morton , Jiri Slaby , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 06/10/2014 03:52 PM, Tony Luck wrote: > On Mon, Jun 9, 2014 at 4:18 PM, Rob Herring wrote: >> It should do auto detect of the baud-rate if it is not specified which >> for 8250 is just reading the baud-rate divider and calculating the >> baud-rate using the uart clock. It should just reprogram the divider >> with the same divider value. I don't see anything obvious why this >> would have broken. > > Something very weird is happening. Output is good so long as I put the > trailing ",115200" on the command line. > > But I made early_serial8250_setup() printk() the return value it got > from probe_baud() - in case is was somehow getting 115201 or some > other silly value ... nope. Exactly 115200. > > I also can't explain why the "noise" comes and goes a dozen > times during boot, > > Does some other place in the kernel look at the "uart..." command > line argument? I think I figured it out. The function serial8250_find_port_for_earlycon is failing to match 'uart' console to 'ttyS' console and transfer the options. It was also failing to create an option string when the baud rate is probed. Can you try out the below patch? Rob 8<------------------------------------------------------------------- diff --git a/drivers/tty/serial/8250/8250_early.c b/drivers/tty/serial/8250/8250_early.c index cfef801..4858b8a 100644 --- a/drivers/tty/serial/8250/8250_early.c +++ b/drivers/tty/serial/8250/8250_early.c @@ -144,8 +144,11 @@ static int __init early_serial8250_setup(struct earlycon_device *device, if (!(device->port.membase || device->port.iobase)) return 0; - if (!device->baud) + if (!device->baud) { device->baud = probe_baud(&device->port); + snprintf(device->options, sizeof(device->options), "%u", + device->baud); + } init_port(device); diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c index 5131b5e..d20e6d8 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -25,7 +25,7 @@ #include static struct console early_con = { - .name = "earlycon", + .name = "uart", .flags = CON_PRINTBUFFER | CON_BOOT, .index = -1, };