From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org,
Yoder Stuart-B08248 <stuart.yoder@freescale.com>
Subject: Re: [RFC][PATCH 6/8] Walnut DTS
Date: Tue, 17 Jul 2007 07:47:26 +1000 [thread overview]
Message-ID: <1184622446.25235.89.camel@localhost.localdomain> (raw)
In-Reply-To: <28A3F6B9-512B-4D86-8E0D-A7680CCE2354@kernel.crashing.org>
On Mon, 2007-07-16 at 16:34 +0200, Segher Boessenkool wrote:
> >>> + #address-cells = <0>;
> >>> + #size-cells = <0>;
> >>
> >> No need for these.
> >
> > Isn't a good practice to put #address-cells in interrupt controller
> > nodes?
>
> It is not.
Well, that's debatable... but yes, a strict reading of the spec would
say that you should put neither #address-cells nor #size-cells in a leaf
interrupt controller.
> > If the device tree has an interrupt map defined the interrupt
> > parent 'unit interrupt specifier' has to be interpreted according
> > to the #address-cells of the interrupt parent.
>
> And "#address-cells" is defaulted to 0 if it is absent,
> for the purpose of interrupt mapping (but not for its
> other purposes).
This is a bit confusing though, which is why I tend to prefer having it
explicitely in the interrupt controller node :-) I tend to dislike
"magic" defaults, we've had problems with them in the past and will have
in the future, I much prefer having things explicit whenever possible.
> Typically, such interrupt controllers
> don't have device tree children so it doesn't make sense
> to give them an "#address-cells" anyway.
Somewhat...
> > It seems like
> > typical practice in the current DTS files to explicitly define this
> > in the interrupt controller.
>
> That "typical practice" is inspired by the need to explicitly
> put #address-cells and #size-cells into the device tree if you
> want Linux to properly parse the device tree, even if the default
> values would work perfectly (if Linux would work correctly,
> that is).
Linux does handle default values in some areas. The problem with default
values is that they are badly defined and the spec contains gray areas
and contradictions as to what the default values should be in some
circumstances. As a general matter, I dislike default values because
they somewhat require background knowledge of what default values should
be in different contexts to "read" a device-tree. To be simple, I
believe default values are a bad idea.
> There are no child nodes, and no binding that says there can
> be any; neither #address-cells not #size-cells should be there.
You are being way too pedantic here. The interrupt-tree uses those two
properties, thus "there is no child node" is open to interpretation.
There is no child device node, but there are child interrupt nodes, and
since the interrupt-tree uses #address/size-cells, it does make some
sense to specify them.
Yes, there is a default value when absent, but the simple fact that the
default is different depending if you are doing a device walk or an
interrupt tree walk is very confusing. As I said above, the default
values are a source of more problem than anything else and I tend to
think they should be banned.
I would personally be inclined to define that whatever spec we come up
with always require #address-cells/#size-cells for any node that can
have either device children or interrupt children, and ban default
values alltogether.
Cheers,
Ben.
next prev parent reply other threads:[~2007-07-16 21:47 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-11 13:52 [RFC][PATCH 0/8] arch/powerpc support for Walnut Board Josh Boyer
2007-07-11 13:53 ` [RFC][PATCH 1/8] 4xx Kconfig cleanup Josh Boyer
2007-07-11 13:55 ` [RFC][PATCH 2/8] 4xx boot wrapper reworks Josh Boyer
2007-07-11 13:56 ` [RFC][PATCH 3/8] 4xx MMU Josh Boyer
2007-07-11 20:56 ` Arnd Bergmann
2007-07-11 21:15 ` Josh Boyer
2007-07-12 7:09 ` Kumar Gala
2007-07-12 12:40 ` Josh Boyer
2007-07-11 13:57 ` [RFC][PATCH 4/8] 4xx decrementer fixes Josh Boyer
2007-07-11 13:58 ` [RFC][PATCH 5/8] Fix 4xx build Josh Boyer
2007-07-11 21:00 ` Arnd Bergmann
2007-07-11 13:59 ` [RFC][PATCH 6/8] Walnut DTS Josh Boyer
2007-07-11 14:26 ` Stefan Roese
2007-07-11 14:37 ` Josh Boyer
2007-07-11 17:49 ` Segher Boessenkool
2007-07-11 17:55 ` Josh Boyer
2007-07-11 18:07 ` Segher Boessenkool
2007-07-18 1:02 ` David Gibson
2007-07-12 15:13 ` Yoder Stuart-B08248
2007-07-16 14:34 ` Segher Boessenkool
2007-07-16 21:47 ` Benjamin Herrenschmidt [this message]
2007-07-16 21:55 ` Scott Wood
2007-07-16 22:11 ` Benjamin Herrenschmidt
2007-07-16 22:18 ` Scott Wood
2007-07-16 22:34 ` Benjamin Herrenschmidt
2007-07-16 21:55 ` Yoder Stuart-B08248
2007-07-16 22:12 ` Benjamin Herrenschmidt
2007-07-17 2:39 ` Josh Boyer
2007-07-17 14:26 ` Segher Boessenkool
2007-07-17 14:15 ` Segher Boessenkool
2007-07-17 21:25 ` Benjamin Herrenschmidt
2007-07-17 22:25 ` Scott Wood
2007-07-17 22:58 ` Benjamin Herrenschmidt
2007-07-18 13:53 ` Segher Boessenkool
2007-07-18 16:47 ` Scott Wood
2007-07-19 16:54 ` Segher Boessenkool
2007-07-18 13:48 ` Segher Boessenkool
2007-07-11 14:02 ` [RFC][PATCH 7/8] Walnut defconfig Josh Boyer
2007-07-11 14:03 ` [RFC][PATCH 8/8] Walnut board support Josh Boyer
2007-07-11 14:04 ` [RFC][PATCH 9/8] Walnut zImage wrapper Josh Boyer
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=1184622446.25235.89.camel@localhost.localdomain \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=segher@kernel.crashing.org \
--cc=stuart.yoder@freescale.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 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).