From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751900AbbJJMsU (ORCPT ); Sat, 10 Oct 2015 08:48:20 -0400 Received: from mail-qk0-f177.google.com ([209.85.220.177]:35504 "EHLO mail-qk0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751134AbbJJMsS (ORCPT ); Sat, 10 Oct 2015 08:48:18 -0400 Subject: Re: [PATCH] of/fdt: fix aliases with baudrate in earlycon To: Stefan Agner , robh+dt@kernel.org, frowand.list@gmail.com, grant.likely@linaro.org References: <1444465770-3103-1-git-send-email-stefan@agner.ch> Cc: galak@codeaurora.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org From: Peter Hurley Message-ID: <5619090F.7040108@hurleysoftware.com> Date: Sat, 10 Oct 2015 08:48:15 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1444465770-3103-1-git-send-email-stefan@agner.ch> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/10/2015 04:29 AM, Stefan Agner wrote: > Many boards use an alias in the stdout-path specification along > with console options after a colon (e.g. serial0:115200n8). When > using earlycon, this specification currently does not work. While > fdt_path_offset supports alias resolution, it does not remove the > console options by itself. Use the fdt_path_offset_namelen variant > and provide the length of the alias to enable aliases with console > options in the stdout-path. > > Signed-off-by: Stefan Agner > --- > Hi, > > Stumbled upon this while testing 32-bit ARM earlycon support. It > seems that this once already came up on the list: > https://lkml.org/lkml/2015/3/13/562 Yeah, looks like my patch got lost somewhere. https://lkml.org/lkml/2015/4/8/604 Regards, Peter Hurley > > drivers/of/fdt.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c > index 6e82bc42..9fc3568 100644 > --- a/drivers/of/fdt.c > +++ b/drivers/of/fdt.c > @@ -813,8 +813,11 @@ static int __init early_init_dt_scan_chosen_serial(void) > if (!p || !l) > return -ENOENT; > > + /* Remove console options if present */ > + l = strchrnul(p, ':') - p; > + > /* Get the node specified by stdout-path */ > - offset = fdt_path_offset(fdt, p); > + offset = fdt_path_offset_namelen(fdt, p, l); > if (offset < 0) > return -ENODEV; > >