mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH 2/4] state: warn when a state node will be overwritten
Date: Mon, 8 May 2017 13:58:34 +0200	[thread overview]
Message-ID: <20170508115834.62fkrws5h3d6skvb@pengutronix.de> (raw)
In-Reply-To: <20170508061525.ky3ceaq3p6zk3yz5@pengutronix.de>

On Mon, May 08, 2017 at 08:15:25AM +0200, Uwe Kleine-König wrote:
> On Thu, May 04, 2017 at 01:02:17PM +0200, Sascha Hauer wrote:
> > People do not seem to know that a state node in the kernel
> > device tree will be overwritten by barebox. Print a warning
> > when this happens so that people can get an idea why changes
> > in the kernel device tree state node do not have any effect.
> > 
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> >  common/state/state.c | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/common/state/state.c b/common/state/state.c
> > index 6db77f2c18..c3c8b768c7 100644
> > --- a/common/state/state.c
> > +++ b/common/state/state.c
> > @@ -416,6 +416,15 @@ static int of_state_fixup(struct device_node *root, void *ctx)
> >  	if (node) {
> >  		/* replace existing node - it will be deleted later */
> >  		parent = node->parent;
> > +
> > +		/*
> > +		 * barebox replaces the state node in the device tree it starts the
> > +		 * kernel with, so a state node that already exists in the device tree
> > +		 * will be overwritten. Warn about this so people do not wonder why
> > +		 * changes in the kernels state node do not have any effect.
> > +		 */
> > +		if (root != of_get_root_node())
> > +			dev_warn(&state->dev, "Warning: Kernel devicetree contains state node, replacing it\n");
> 
> Would it make sense to only issue this warning if there are differences
> between the replacing and the replaced node? Otherwise I think this
> warning will trigger in many cases where it doesn't really matter. At
> least in my projects I take care to have only minimal differences
> between barebox' and linux' device tree and so the latter usually also
> contains the state stuff.

Generally I'm fine with showing the warning only when there are
differences. However, we do not have any code to compare two device tree
branches.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2017-05-08 11:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-04 11:02 state fixes/clarifications Sascha Hauer
2017-05-04 11:02 ` [PATCH 1/4] state: Binding: remove @0 from node name Sascha Hauer
2017-05-04 11:02 ` [PATCH 2/4] state: warn when a state node will be overwritten Sascha Hauer
2017-05-08  6:15   ` Uwe Kleine-König
2017-05-08 11:58     ` Sascha Hauer [this message]
2017-05-04 11:02 ` [PATCH 3/4] state: Make an alias mandatory Sascha Hauer
2017-05-04 11:02 ` [PATCH 4/4] state: Create alias in of_state_fixup() Sascha Hauer

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=20170508115834.62fkrws5h3d6skvb@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox