mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: David Jander <david@protonic.nl>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>,
	Barebox List <barebox@lists.infradead.org>,
	Marco Franchi <marco.franchi@nxp.com>,
	Shawn Guo <shawnguo@kernel.org>
Subject: Device-tree node renames break barebox/kernel compatibility...
Date: Tue, 12 Jun 2018 14:23:08 +0200	[thread overview]
Message-ID: <20180612142308.4a048a14@erd980> (raw)


Hi Sascha,

I know this is old already, and I was surprised that I couldn't find any
complaints about this yet, but I recently came across this patch in the kernel:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/?id=df5cc9d0b42d15fa33b30440cca7a11ca7ba35a4

...which was adopted in barebox as this:

https://git.pengutronix.de/cgit/barebox/patch/dts/src/arm/imx6qdl.dtsi?id=2e9cce8fb1f577088e2b20ae2f461130e13ad190

As I don't know the exact reason as to why this was necessary, or why this is
an issue at all, I just wanted to point out the fact that this leads to some
breakage in barebox new and old. The sensible code comes from u-boot
originally so maybe it is there where blame is to be found, but I can't find
this code on latest u-boot anymore...

The specific problem I observed is here:
https://git.pengutronix.de/cgit/barebox/tree/net/eth.c#n299

But I guess this can cause other similar problems elsewhere... If you agree
that all these potential places are broken, I'd like to know what the correct
fix should be and I'd be happy to submit patches.

The thing is: barebox has its own device-tree but nevertheless should patch
the devicetree of any given Linux kernel to boot. In the aforementioned piece
of code, barebox will identify an ethernet node by its full DT-path from it's
own device tree (!) and associate a MAC address with that device. Later, when
a kernel (+ its DT) is loaded, that DT is fixed-up with the MAC address saved
earlier by searching for the ethernet node by full DT-path name.
Due to the above patches, these path names (which in theory should be
immutable, since the ethernet device is still connected to the same instance
of the same bus at the same physical address) just happen to be different
between different versions of the kernel and the bootloader. This is awful,
because now old bootloaders cannot load newer kernels and newer bootloaders
cannot load older kernels... again!

I still hope that someone tells my that my board code is broken and that I
should not do things like this to start. If not, how should this issue be
solved?

Best regards,

-- 
David Jander
Protonic Holland.

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

             reply	other threads:[~2018-06-12 12:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-12 12:23 David Jander [this message]
2018-06-12 12:47 ` Sascha Hauer
2018-06-12 13:46   ` David Jander
2018-06-13  6:42     ` Sascha Hauer
2018-06-13  6:50       ` David Jander
2018-06-13 16:57         ` Fabio Estevam

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=20180612142308.4a048a14@erd980 \
    --to=david@protonic.nl \
    --cc=barebox@lists.infradead.org \
    --cc=fabio.estevam@nxp.com \
    --cc=marco.franchi@nxp.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox