LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: Russell King <linux@arm.linux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	devicetree-discuss@lists.ozlabs.org,
	lkml <linux-kernel@vger.kernel.org>,
	Lennert Buytenhek <buytenh@wantstofly.org>,
	Olof Johansson <olof@lixom.net>,
	john.linn@xilinx.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 4/6] arm/dt: probe for platforms via the device tree
Date: Mon, 31 Jan 2011 16:03:24 -0700	[thread overview]
Message-ID: <AANLkTi=Kfb6TVUqN9aogq8A5WskNfwW=s7Dswgf2MC8i@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1101311709280.8580@xanadu.home>

On Mon, Jan 31, 2011 at 3:27 PM, Nicolas Pitre <nicolas.pitre@linaro.org> wrote:
> On Mon, 31 Jan 2011, Grant Likely wrote:
>
>> If a dtb is passed to the kernel then the kernel needs to iterate
>> through compiled-in mdescs looking for one that matches and move the
>> dtb data to a safe location before it gets accidentally overwritten by
>> the kernel.
>>
>> This patch creates a new function, setup_machine_fdt() which is
>> analogous to the setup_machine_atags() created in the previous patch.
>> It does all the early setup needed to use a device tree machine
>> description.  It also creates arm_unflatten_device_tree() which copies
>> the dtb into an allocated buffer and unflattens it into the live-tree
>> representation.
>>
>> v2: Changed to save the dtb by copying into an allocated buffer.
>>     - Since the dtb will very likely be passed in the first 16k of ram
>>       where the interrupt vectors live, memblock_reserve() is
>>       insufficient to protect the dtb data.
>
> This is wrong.  The vector page can be allocated anywhere.  It is
> currently allocated with memblock_alloc(), so if you memblock_reserve()
> the dtb soon enough then it should be safe and the vector page or
> whatever will be allocated somewhere else.

Ah, thanks.  Did not know that.

> What was the actual problem?

I was seeing the first page in memory getting zeroed partway through
the boot process which wiped out the dtb.  I haven't yet narrowed down
to the exact point that it gets overwritten.  It is late enough that
all the early setup dt code works, but before init_machine gets
called.

I'm also seeing a problem with /proc/device-tree getting corrupted on
qemu which I cannot reproduce on Tegra hardware.  Still investigating
this one.

g.

  reply	other threads:[~2011-01-31 23:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-31 21:03 [PATCH v2 0/6] Basic ARM device support Grant Likely
2011-01-31 21:03 ` [PATCH v2 1/6] arm/dt: Make __vet_atags also accept a dtb image Grant Likely
2011-01-31 21:04 ` [PATCH v2 2/6] arm/dt: Allow CONFIG_OF on ARM Grant Likely
2011-01-31 21:04 ` [PATCH v2 3/6] arm/dt: consolidate atags setup into setup_machine_atags Grant Likely
2011-01-31 21:04 ` [PATCH v2 4/6] arm/dt: probe for platforms via the device tree Grant Likely
2011-01-31 22:27   ` Nicolas Pitre
2011-01-31 23:03     ` Grant Likely [this message]
2011-01-31 21:04 ` [PATCH v2 5/6] arm/dt: Basic versatile devicetree support Grant Likely
2011-01-31 21:04 ` [PATCH v2 6/6] arm/dt: Basic tegra " Grant Likely

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='AANLkTi=Kfb6TVUqN9aogq8A5WskNfwW=s7Dswgf2MC8i@mail.gmail.com' \
    --to=grant.likely@secretlab.ca \
    --cc=buytenh@wantstofly.org \
    --cc=catalin.marinas@arm.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=john.linn@xilinx.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=nicolas.pitre@linaro.org \
    --cc=olof@lixom.net \
    --subject='Re: [PATCH v2 4/6] arm/dt: probe for platforms via the device tree' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).