All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eugeniy.Paltsev@synopsys.com (Eugeniy Paltsev)
To: linux-snps-arc@lists.infradead.org
Subject: [PATCH] earlycon: initialise baud field of earlycon device structure
Date: Wed, 16 Aug 2017 11:52:42 +0000	[thread overview]
Message-ID: <1502884362.2586.32.camel@synopsys.com> (raw)
In-Reply-To: <CAL_Jsq+=LQ0kXtBx7xXJEb0FtfqwQRZoUYtG0oDFnUj_VfoG1A@mail.gmail.com>

Hi Rob,

On Tue, 2017-08-15@14:26 -0500, Rob Herring wrote:
> On Tue, Aug 15, 2017 at 12:21 PM, Eugeniy Paltsev
> <Eugeniy.Paltsev@synopsys.com> wrote:
> > [snip]
> > @@ -282,7 +283,15 @@ int __init of_setup_earlycon(const struct
> > earlycon_id *match,
> >?????????????????}
> >?????????}
> >?
> > +???????val = of_get_flat_dt_prop(node, "baud", NULL);
>?
> No, we already have a defined way to set the baud, we don't need a
> property in addition. Plus you didn't document it.

I guess by defined way to set the baud you mean setting baud after
device alias
in stdout-path property (like stdout-path = "serial:115200n8"), right?

The idea was to reuse "baud" property from serial node to set the
earlycon baud:

chosen {
????...
????stdout-path = &serial;
};

serial: uart at ... {
????...
????baud = <115200>;   /* Get baud from here */
};

> > +???????if (val)
> > +???????????????early_console_dev.baud = be32_to_cpu(*val);
> > +
> >?????????if (options) {
> > +???????????????err = kstrtoul(options, 10, &baud);
> > +???????????????if (!err)
> > +???????????????????????early_console_dev.baud = baud;
>?
> This seems fine to do here, but then we should also parse the other
> standard options here too. And we should make sure we're not doing it
> twice.
I added only baud parsing here because we parse only baud from standard
options
when register_earlycon is used. (see parse_options function which is
called
from register_earlycon)

But I can add other standard options parsing here (probably using
uart_parse_options + uart_set_options).?
What do you think?

> > +
> >?????????????????strlcpy(early_console_dev.options, options,
> >?????????????????????????sizeof(early_console_dev.options));
> >?????????}
> > --
> > 2.9.3
--?
?Eugeniy Paltsev

WARNING: multiple messages have this Message-ID (diff)
From: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
To: "robherring2@gmail.com" <robherring2@gmail.com>
Cc: "linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"jslaby@suse.com" <jslaby@suse.com>,
	"Eugeniy.Paltsev@synopsys.com" <Eugeniy.Paltsev@synopsys.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-snps-arc@lists.infradead.org"
	<linux-snps-arc@lists.infradead.org>
Subject: Re: [PATCH] earlycon: initialise baud field of earlycon device structure
Date: Wed, 16 Aug 2017 11:52:42 +0000	[thread overview]
Message-ID: <1502884362.2586.32.camel@synopsys.com> (raw)
In-Reply-To: <CAL_Jsq+=LQ0kXtBx7xXJEb0FtfqwQRZoUYtG0oDFnUj_VfoG1A@mail.gmail.com>

Hi Rob,

On Tue, 2017-08-15 at 14:26 -0500, Rob Herring wrote:
> On Tue, Aug 15, 2017 at 12:21 PM, Eugeniy Paltsev
> <Eugeniy.Paltsev@synopsys.com> wrote:
> > [snip]
> > @@ -282,7 +283,15 @@ int __init of_setup_earlycon(const struct
> > earlycon_id *match,
> >                 }
> >         }
> > 
> > +       val = of_get_flat_dt_prop(node, "baud", NULL);
> 
> No, we already have a defined way to set the baud, we don't need a
> property in addition. Plus you didn't document it.

I guess by defined way to set the baud you mean setting baud after
device alias
in stdout-path property (like stdout-path = "serial:115200n8"), right?

The idea was to reuse "baud" property from serial node to set the
earlycon baud:

chosen {
    ...
    stdout-path = &serial;
};

serial: uart@... {
    ...
    baud = <115200>;   /* Get baud from here */
};

> > +       if (val)
> > +               early_console_dev.baud = be32_to_cpu(*val);
> > +
> >         if (options) {
> > +               err = kstrtoul(options, 10, &baud);
> > +               if (!err)
> > +                       early_console_dev.baud = baud;
> 
> This seems fine to do here, but then we should also parse the other
> standard options here too. And we should make sure we're not doing it
> twice.
I added only baud parsing here because we parse only baud from standard
options
when register_earlycon is used. (see parse_options function which is
called
from register_earlycon)

But I can add other standard options parsing here (probably using
uart_parse_options + uart_set_options). 
What do you think?

> > +
> >                 strlcpy(early_console_dev.options, options,
> >                         sizeof(early_console_dev.options));
> >         }
> > --
> > 2.9.3
-- 
 Eugeniy Paltsev

  reply	other threads:[~2017-08-16 11:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-15 17:21 [PATCH] earlycon: initialise baud field of earlycon device structure Eugeniy Paltsev
2017-08-15 17:21 ` Eugeniy Paltsev
2017-08-15 19:26 ` Rob Herring
2017-08-15 19:26   ` Rob Herring
2017-08-16 11:52   ` Eugeniy Paltsev [this message]
2017-08-16 11:52     ` Eugeniy Paltsev
2017-08-16 13:46     ` Rob Herring
2017-08-16 13:46       ` Rob Herring
2017-08-16 15:26       ` Eugeniy Paltsev
2017-08-16 15:26         ` Eugeniy Paltsev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1502884362.2586.32.camel@synopsys.com \
    --to=eugeniy.paltsev@synopsys.com \
    --cc=linux-snps-arc@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.