Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753948AbaFKR6d (ORCPT ); Wed, 11 Jun 2014 13:58:33 -0400 Received: from mail-ob0-f170.google.com ([209.85.214.170]:34880 "EHLO mail-ob0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753152AbaFKR6b (ORCPT ); Wed, 11 Jun 2014 13:58:31 -0400 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 CC: Greg Kroah-Hartman , Yinghai Lu , "linux-arm-kernel@lists.infradead.org" , Linux Kernel Mailing List , "linux-serial@vger.kernel.org" , Jiri Slaby , Catalin Marinas , Russell King , Will Deacon , Arnd Bergmann , Andrew Morton 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 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, }; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/