devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
To: Andrii Anisov <andrii_anisov-uRwfk40T5oI@public.gmane.org>
Cc: Julien Grall <julien.grall-5wv7dgnIgG8@public.gmane.org>,
	xen-devel
	<xen-devel-GuqFBffKawtpuQazS67q72D2FQJk+8+b@public.gmane.org>,
	Stefano Stabellini
	<sstabellini-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Andrew Cooper
	<andrew.cooper3-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>,
	Ian Jackson <ian.jackson-mvvWK6WmYclDPfheJLI6IQ@public.gmane.org>,
	Wei Liu <wei.liu2-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>,
	Jan Beulich <JBeulich-IBi9RG/b67k@public.gmane.org>,
	Konrad Rzeszutek Wilk
	<konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	George Dunlap
	<george.dunlap-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>,
	Tim Deegan <tim-LM2mM/qkH7s@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Duplicated memory node in the Device-Tree (WAS [XEN] Re: Duplicated memory nodes cause the BUG())
Date: Tue, 25 Jul 2017 17:20:54 +0100	[thread overview]
Message-ID: <20170725162054.GD12749@leverpostej> (raw)
In-Reply-To: <c77f71a3-edd9-3700-001b-feee05165454-uRwfk40T5oI@public.gmane.org>

On Tue, Jul 25, 2017 at 06:27:31PM +0300, Andrii Anisov wrote:
> On 25.07.17 17:23, Julien Grall wrote:
> >I think this is by chance rather than by design. The first
> >question to answer is why a Firmware would specify twice the same
> >memory banks? Is it valid from the specification?
> Yep, that is the question.

I beleive that all memory regions described in any memory node's reg
entries should be disjoint (i.e. should not overlap). Per IEEE-1275, reg
entries (within a node) are supposed to be disjoint, and I would expect
this requirement to extend across nodes in the case of memory nodes.

Currently, the DT spec is somewhat sparse in wording, but this can be
corrected.

> >Regardless that, it looks like to me that the device-tree you give
> >to the board should not contain the memory nodes.
> The device-tree is provided by vendor in that form, and u-boot is
> theirs. It seems to me that they do not really care since the kernel
> tolerates duplication.
> 
> >> ps. Linux kernel does tolerate duplicated memory nodes by
> >>merging memory blocks. I.e. memblock_add_range() function is
> >>commented as following:
> >>/**
> >>     * memblock_add_range - add new memblock region
> >>     * @type: memblock type to add new region into
> >>     * @base: base address of the new region
> >>     * @size: size of the new region
> >>     * @nid: nid of the new region
> >>     * @flags: flags of the new region
> >>     *
> >>     * Add new memblock region [@base,@base+@size) into @type. The new
> >>region
> >>     * is allowed to overlap with existing ones - overlaps don't affect
> >>already
> >>     * existing regions.  @type is guaranteed to be minimal (all
> >>neighbouring
> >>     * compatible regions are merged) after the addition.
> >>     *
> >>     * RETURNS:
> >>     * 0 on success, -errno on failure.
> >>     */
> IMO the function description is pretty straight-forward.
> But let us wait for device tree guys feedback.

This might be the designed of *memblock*, but that does not mean that it
is a deliberate part of the DT handling. I beleive this is simply an
implementation detail that happens to mask a DT bug.

Thanks,
Mark.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2017-07-25 16:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <835d808c-9d5e-2dc0-6cf9-8fbecdc49914@epam.com>
     [not found] ` <835d808c-9d5e-2dc0-6cf9-8fbecdc49914-uRwfk40T5oI@public.gmane.org>
2017-07-25 14:23   ` Duplicated memory node in the Device-Tree (WAS [XEN] Re: Duplicated memory nodes cause the BUG()) Julien Grall
     [not found]     ` <6d1fb061-03b0-3b58-e70a-3c0e0777d8d7-5wv7dgnIgG8@public.gmane.org>
2017-07-25 15:27       ` Andrii Anisov
     [not found]         ` <c77f71a3-edd9-3700-001b-feee05165454-uRwfk40T5oI@public.gmane.org>
2017-07-25 15:44           ` Julien Grall
     [not found]             ` <7c1c8267-a065-f8ee-7e20-147d722c59be-5wv7dgnIgG8@public.gmane.org>
2017-07-25 16:02               ` Andrii Anisov
     [not found]                 ` <b454b264-1f04-7446-fe0b-fafa82954353-uRwfk40T5oI@public.gmane.org>
2017-07-25 16:23                   ` Andrew Cooper
     [not found]                     ` <eb0fbb83-a6de-d06e-f230-d06c615b0f88-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>
2017-07-25 16:51                       ` Andrii Anisov
     [not found]                         ` <6e9456a3-7f0f-72e5-b4be-2bd51939d850-uRwfk40T5oI@public.gmane.org>
2017-07-25 17:52                           ` [Xen-devel] " Stefano Stabellini
2017-07-25 18:02                             ` Julien Grall
     [not found]                               ` <041fe162-8944-5c1b-364a-940d21a3c69e-5wv7dgnIgG8@public.gmane.org>
2017-07-25 18:11                                 ` Stefano Stabellini
2017-07-26  9:08                                   ` Andrii Anisov
     [not found]                                     ` <93878809-115f-b29e-2a8c-e18f87b1fb09-uRwfk40T5oI@public.gmane.org>
2017-07-26  9:22                                       ` Julien Grall
     [not found]                                         ` <4ca32f1c-0f6b-c6b3-4902-c25b6350a52a-5wv7dgnIgG8@public.gmane.org>
2017-07-26 12:10                                           ` Andrii Anisov
2017-07-25 16:20           ` Mark Rutland [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=20170725162054.GD12749@leverpostej \
    --to=mark.rutland-5wv7dgnigg8@public.gmane.org \
    --cc=JBeulich-IBi9RG/b67k@public.gmane.org \
    --cc=andrew.cooper3-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org \
    --cc=andrii_anisov-uRwfk40T5oI@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=george.dunlap-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org \
    --cc=ian.jackson-mvvWK6WmYclDPfheJLI6IQ@public.gmane.org \
    --cc=julien.grall-5wv7dgnIgG8@public.gmane.org \
    --cc=konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=sstabellini-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=tim-LM2mM/qkH7s@public.gmane.org \
    --cc=wei.liu2-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org \
    --cc=xen-devel-GuqFBffKawtpuQazS67q72D2FQJk+8+b@public.gmane.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).