From: grant.likely@secretlab.ca (Grant Likely)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: DT: don't try to access physical address zero
Date: Wed, 8 Jun 2011 19:46:13 -0600 [thread overview]
Message-ID: <20110609014613.GA1112@ponder.secretlab.ca> (raw)
In-Reply-To: <alpine.LFD.2.00.1106082138420.2142@xanadu.home>
On Wed, Jun 08, 2011 at 09:40:47PM -0400, Nicolas Pitre wrote:
> From: Nicolas Pitre <nicolas.pitre@linaro.org>
>
> If the DT physical address is zero, this is equivalent to no DT.
> Especially when the actual RAM physical address is not located at zero,
> the result of phys_to_virt() would point to la-la-land and crash the
> kernel, which crash is completely silent this early during boot.
>
> Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
> CC: Grant Likely <grant.likely@secretlab.ca>
Hmmm, I thought I had fixed that.
This is obviously correct.
Acked-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
> index a701e42..0cdd7b4 100644
> --- a/arch/arm/kernel/devtree.c
> +++ b/arch/arm/kernel/devtree.c
> @@ -76,6 +76,9 @@ struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
> unsigned long dt_root;
> const char *model;
>
> + if (!dt_phys)
> + return NULL;
> +
> devtree = phys_to_virt(dt_phys);
>
> /* check device tree validity */
prev parent reply other threads:[~2011-06-09 1:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-09 1:40 [PATCH] ARM: DT: don't try to access physical address zero Nicolas Pitre
2011-06-09 1:46 ` Grant Likely [this message]
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=20110609014613.GA1112@ponder.secretlab.ca \
--to=grant.likely@secretlab.ca \
--cc=linux-arm-kernel@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 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).