linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
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: Wed, 18 Jul 2007 07:25:57 +1000	[thread overview]
Message-ID: <1184707558.25235.159.camel@localhost.localdomain> (raw)
In-Reply-To: <C2D29334-489F-49B0-8220-0D94E89FEAC3@kernel.crashing.org>


> Yes, I shouldn't say "defaulted" -- a unit interrupt specifier
> simply has no unit address part, in an interrupt domain that
> doesn't correspond to a "normal" bus.  But saying it like this
> is a little bit inexact, and it uses more words.
> 
> > which is why I tend to prefer having it
> > explicitely in the interrupt controller node :-)
> 
> Which is simply incorrect.

It's absolutely not. Please, stop that moronic pin-head behaviour and
find me a single case where that would actually be a problem of any sort
or form.

> You mean, the magic default values you used for #address-cells
> and #size-cells?  That was simply a bug, someone forgot to read
> the documentation...

No, defaults are crap, period. This is a general thing. Besides, the
spec itself has issues about the default values (remember those blurbs
about PCI and ISA supposedly having different defaults ?) In any way,
defaults are a bad idea and I'm happy to say don't use them.

> For this?  No way:
> 
> [From the base spec]:
> 
> “#address-cells” S
> 	Standard property name to define the package’s address format.
> 	prop-encoded-array: Integer, encoded with encode-int.
> 
> 	This property applies to packages that define a physical
> 	address space, i.e., those packages with “decode-unit”
> 	methods. The property value specifies the number of cells
> 	that are used to encode a physical address within that
> 	address space. The value of this property affects the other
> 	functions, commands, and methods that deal with physical
> 	addresses. In a package with a “decode-unit” method, a missing
> 	“#address-cells” property signifies that the number of
> 	address cells is two.

And you omit the various bus bindings that have come up with different
defaults...

> See?  The flat device tree unfortunately has no decode-unit, but
> it is still pretty clear which nodes "define a physical address
> space" and which do not.
> 
> There is nothing badly defined here.

See above. Besides, as I said, default values are crap. And no, it's not
obvious which nodes define a physical address space or not, at least not
for a generic parser. Defaults are a bad idea, just get it and move on
and stop arguing just for the sake of arguing. Pointing out the letter
of the spec is not a constructive attitude here.

> Nothing in the "interrupt mapping" spec redefines #address-cells
> (OF isn't all that stupid you know); it simply says that a /unit
> interrupt specifier/ has no /unit address/ part if there is no
> #address-cells.  The algorithm in paragraph 7 makes it super
> clear how exactly this should work.

No, the algorithm provided isn't clear and is buggy. I have implemented
it so I know what I'm talking about. The fact that basically you end up
with "different" defaults for what is essentially the value
#address-cells depending on whether you are walking the device-tree for
address resolution or for interrupt resolution is stupid. Thus, the
solution is simple: don't do defaults. Explicit values are good.

> > and the spec contains gray areas
> > and contradictions as to what the default values should be in some
> > circumstances.
> 
> In some areas, perhaps.  And it would be nice to bring those
> areas to the attention of the working group, instead of just
> to complain.

The working group is dead and some of the ex members of it expressed
their lack of interest in pursuing these matters.

> Linux will have to keep supporting them for "real OF", so
> requiring an explicit #address-cells where its value is 2
> doesn't really help much.  I'm not opposed to this though,
> for flat device trees at least (I think it's a good thing
> for OF trees as well, but for different reasons; and that's
> beside the point here).
> 
> On the other hand, requiring an #address-cells where it is
> supposed to be absent, and you only want it so you can wrap
> your head around the interrupt mapping recommended practice
> in a more confusing and confused way, is simply WRONG.

No, it's not, It's purely having an explicit representation of what was
a stupid default behaviour.

> If it would, the interrupt mapping spec would have had to say
> how the semantics of #address-cells were changed (and they
> weren't, and they shouldn't, and this is such a laughable idea
> I wonder why anyone would suggest it did).

That's bullshit. The semantics are exactly the same. You obviously
decided to be immune to any kind of common sense today.

> What the interrupt mapping spec defines is how to _use_ the
> value of #address-cells, and how to interpret its absence;
> what should be put in #address-cells for separate nodes is
> defined elsewhere (namely, in the base spec, and in relevant
> device bindings).

There is no such crackpot interpretation. A unit interrupt specifier
contains ... an address. An address format/size is defined by a
#address-cells. Period. That's not an "interpretation", that's the
basic, primary semantic of #address-cells. The fact that the absence of
#address-cells will give a different "default" for the address size
depending on "how" you walk the tree is just a plain wrong bad idea. I
see no reason why it would be or cause or be in any way shape or form
wrong or against the "spirit" of the spec (if not the letter) to
explicitely specify in the case of leaf interrupt controllers, that
their #address-cells is 0 and be done with it.

Ben.

  reply	other threads:[~2007-07-17 21:26 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
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 [this message]
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=1184707558.25235.159.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).