From: James Hogan <james.hogan@imgtec.com>
To: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Cc: <linux-kernel@vger.kernel.org>,
Grant Likely <grant.likely@secretlab.ca>,
Arnd Bergmann <arnd@arndb.de>,
Rob Herring <rob.herring@calxeda.com>
Subject: Re: [PATCH 1/2] metag: copy devicetree to non-init memory
Date: Thu, 21 Feb 2013 09:34:45 +0000 [thread overview]
Message-ID: <5125EA35.7060602@imgtec.com> (raw)
In-Reply-To: <5125E3F2.7070402@synopsys.com>
Hi Vineet,
On 21/02/13 09:08, Vineet Gupta wrote:
> On Wednesday 20 February 2013 08:22 PM, James Hogan wrote:
>> Make a copy of the device tree blob in non-init memory. It is required
>> when using built-in device tree files that the platform code copies the
>> blob to non-init memory prior to calling unflatten_device_tree(),
>> otherwise the strings that the device tree refer to will get poisoned
>> and potentially reused, breaking later reading of the device tree
>> post-init (such as compatible matching in modules, debugfs, and the
>> procfs interface).
>
> While the patch conceptually looks correct, I'm not sure why any user of DT -
> post-init would refer to DT bindings using of_fdt_* API which use the flat tree,
> instead of the binary tree (more efficient in space/usage). Is this to support
> some in-transition drivers and other code.
The strings aren't copied when the devicetree is unflattened, so the
unflattened version still points into initdata, so all the strings "in"
the unflattened version are wiped when it's freed too.
Documentation/kbuild/makefiles.txt has this to say:
> dtc
> Create flattend device tree blob object suitable for linking
> into vmlinux. Device tree blobs linked into vmlinux are placed
> in an init section in the image. Platform code *must* copy the
> blob to non-init memory prior to calling unflatten_device_tree().
Other architectures using the builtin dtb also do the copy. I presume
it's in initdata in the first place to avoid keeping the built-in one
around if one is provided by the bootloader instead.
Cheers
James
next prev parent reply other threads:[~2013-02-21 9:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-20 14:52 [PATCH 0/2] metag: copy flattened devicetree to non-init memory James Hogan
2013-02-20 14:52 ` [PATCH 1/2] metag: copy " James Hogan
2013-02-21 9:08 ` Vineet Gupta
2013-02-21 9:34 ` James Hogan [this message]
2013-02-21 11:18 ` Vineet Gupta
2013-02-21 11:19 ` Vineet Gupta
2013-02-21 11:28 ` James Hogan
2013-02-20 14:52 ` [PATCH 2/2] metag: prom.h: remove declaration of metag_dt_memblock_reserve() James Hogan
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=5125EA35.7060602@imgtec.com \
--to=james.hogan@imgtec.com \
--cc=Vineet.Gupta1@synopsys.com \
--cc=arnd@arndb.de \
--cc=grant.likely@secretlab.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=rob.herring@calxeda.com \
/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.