public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] of/fdt: fix aliases with baudrate in earlycon
@ 2015-10-10  8:29 Stefan Agner
  2015-10-10 12:48 ` Peter Hurley
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Agner @ 2015-10-10  8:29 UTC (permalink / raw)
  To: robh+dt, frowand.list, grant.likely
  Cc: galak, devicetree, linux-kernel, Stefan Agner

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 <stefan@agner.ch>
---
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

--
Stefan


 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;
 
-- 
2.6.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] of/fdt: fix aliases with baudrate in earlycon
  2015-10-10  8:29 [PATCH] of/fdt: fix aliases with baudrate in earlycon Stefan Agner
@ 2015-10-10 12:48 ` Peter Hurley
  2015-10-13 20:16   ` Rob Herring
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Hurley @ 2015-10-10 12:48 UTC (permalink / raw)
  To: Stefan Agner, robh+dt, frowand.list, grant.likely
  Cc: galak, devicetree, linux-kernel

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 <stefan@agner.ch>
> ---
> 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;
>  
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] of/fdt: fix aliases with baudrate in earlycon
  2015-10-10 12:48 ` Peter Hurley
@ 2015-10-13 20:16   ` Rob Herring
  0 siblings, 0 replies; 3+ messages in thread
From: Rob Herring @ 2015-10-13 20:16 UTC (permalink / raw)
  To: Peter Hurley
  Cc: Stefan Agner, Frank Rowand, Grant Likely, Kumar Gala,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org

On Sat, Oct 10, 2015 at 7:48 AM, Peter Hurley <peter@hurleysoftware.com> wrote:
> 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 <stefan@agner.ch>
>> ---
>> 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

Sorry about that. I forgot about it after getting the dtc dependency
done I guess.

I've now applied this version.

Rob

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-13 20:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-10  8:29 [PATCH] of/fdt: fix aliases with baudrate in earlycon Stefan Agner
2015-10-10 12:48 ` Peter Hurley
2015-10-13 20:16   ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox