public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: David Kahn <dmk@flex.com>
Cc: David Miller <davem@davemloft.net>,
	hch@infradead.org, wmb@firmworks.com, devel@laptop.org,
	linux-kernel@vger.kernel.org, jg@laptop.org
Subject: Re: [PATCH] Open Firmware device tree virtual filesystem
Date: Tue, 02 Jan 2007 15:02:17 +1100	[thread overview]
Message-ID: <1167710537.6165.28.camel@localhost.localdomain> (raw)
In-Reply-To: <45988210.7070300@flex.com>

On Sun, 2006-12-31 at 19:37 -0800, David Kahn wrote:
> Folks,
> 
> If we reused the current code in fs/proc/proc_devtree.c
> and re-wrote the underlying of_* routines for i386 only,
> (in the hope of removing the complexity not needed for
> this implementation) would that be an acceptable
> implementation?
> 
> In other words, the of_* routines continue to define the
> interface between kernel and the firmware/OS
> layer. Although that code in proc_devtree.c defining
> the functions duplicate_name() and fixup_name() is still
> troubling to me.

The main problem with the current powerpc interface to the device-tree
(though as I said earlier, it's very handy for drivers) is that
get_property() doesn't take a buffer pointer. Thus, it's not very
suitable for an interface that involves calling into OF to retreive the
properties. It's really an interface designed around the idea that the
tree is in kernel memory, and the lifetime of the properties is tied to
the lifetime of the node.
 
> IMHO, the directory entries in the filesystem
> should be in the form "node-name@unit-address" (eg: /pci@1f,0,
> "pci" is the node name, "@" is the separator character defined
> by IEEE 1275, and "1f,0" is the unit-address,
> which are always guaranteed to be unique.

They should be. The problem is buggy OF implementations. For example,
both IBM and Apple OFs have the nasty habit of having under the CPU
nodes an "l2-cache" node with no unit-address -and- a property with the
same name (which contains just a phandle to that l2-cache node btw). 
There are other examples too (some pmacs have a duplicate i2c bus with
some one of the copies containing only a subset of the devices)

In general, we don't fabricate the @unit-address part, we use OF's own
package-to-path (unlike sparc which I think doesn't always have that
method), and thus we have to deal with implementations that return no
unit-address or duplicate names.

> It's
> not possible to have two ambiguously fully qualified nodes in the OFW
> device tree, otherwise you would never be able to select
> a specific one by name.

Well, it happens to be the case though. The code is to work around that.
A normal bug-free tree should never trigger the workarounds.

Ben.



  parent reply	other threads:[~2007-01-02  4:04 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-31  1:38 [PATCH] Open Firmware device tree virtual filesystem Mitch Bradley
2006-12-31  5:19 ` David Miller
2006-12-31  9:36   ` Mitch Bradley
2006-12-31  9:52     ` David Miller
2006-12-31 10:11     ` David Kahn
2006-12-31 10:49       ` David Miller
2006-12-31 11:47         ` Rene Rebe
2006-12-31 11:53         ` David Kahn
2007-01-01  3:48           ` Segher Boessenkool
2007-01-02  3:56           ` Benjamin Herrenschmidt
2007-01-02 18:43             ` Richard Smith
2006-12-31 15:41         ` Christoph Hellwig
2006-12-31 20:46           ` David Miller
2007-01-01  3:37             ` David Kahn
2007-01-01  8:54               ` David Miller
2007-01-02  4:02               ` Benjamin Herrenschmidt [this message]
2007-01-02 12:28                 ` Segher Boessenkool
2007-01-01  3:33           ` Segher Boessenkool
2007-01-01  8:57             ` David Miller
2007-01-01 17:48               ` Segher Boessenkool
2007-01-01 23:08                 ` David Miller
2007-01-01 23:52                   ` Segher Boessenkool
2007-01-02  3:31                     ` David Miller
2007-01-02 11:26                       ` Segher Boessenkool
2007-01-02  1:40                   ` David Kahn
2007-01-02  3:36                     ` David Miller
2007-01-01 18:10               ` Mitch Bradley
2007-01-01 19:21                 ` Jan Engelhardt
2007-01-02  4:05               ` Benjamin Herrenschmidt
2007-01-02  4:30                 ` David Miller
2007-01-02  4:57                   ` Benjamin Herrenschmidt
2007-01-02  5:01                     ` David Miller
2007-01-02  5:09                       ` Benjamin Herrenschmidt
2007-01-02  5:44                         ` David Miller
2007-01-02 12:36                     ` Segher Boessenkool
2007-01-02 11:03                   ` Segher Boessenkool
2007-01-02  3:53     ` Benjamin Herrenschmidt
2007-01-02 12:22       ` Segher Boessenkool
2007-01-02 20:12         ` Benjamin Herrenschmidt
2007-01-02 21:28           ` Segher Boessenkool
2007-01-02 21:32             ` Benjamin Herrenschmidt
2007-01-02 21:40               ` Segher Boessenkool
2007-01-02 22:10                 ` David Miller
2007-01-02 22:05             ` David Miller
2007-01-03  0:48               ` Segher Boessenkool
2007-01-03  4:34                 ` David Miller
2007-01-03 15:23                   ` Segher Boessenkool
2007-01-04  2:15                     ` David Miller
2007-01-02  3:45   ` Benjamin Herrenschmidt
2007-01-02  3:49     ` David Miller
2007-01-02 11:45     ` Segher Boessenkool
2007-01-02 20:07       ` Benjamin Herrenschmidt
2006-12-31 13:24 ` Pekka Enberg
2006-12-31 18:55   ` Mitch Bradley
2006-12-31 14:12 ` Jan Engelhardt
2006-12-31 20:45   ` David Miller
2006-12-31 21:30     ` Jan Engelhardt
2007-01-02  3:43     ` Benjamin Herrenschmidt
2007-01-02 11:37       ` Segher Boessenkool
2007-01-02 13:22         ` Stefan Reinauer
2007-01-02 20:08         ` Benjamin Herrenschmidt
2007-01-02 20:11           ` Mitch Bradley
2007-01-02 20:48             ` Benjamin Herrenschmidt
2007-01-02 21:37               ` Segher Boessenkool
2007-01-02 21:47                 ` Benjamin Herrenschmidt
2007-01-03  0:35                   ` Segher Boessenkool
2007-01-03  0:44                     ` Benjamin Herrenschmidt
2007-01-03  1:14                       ` Segher Boessenkool
2007-01-03  4:35                         ` David Miller
2007-01-02 22:07                 ` David Miller
2007-01-03  0:52                   ` Segher Boessenkool
2007-01-03  1:13                     ` Jan Engelhardt
2007-01-03  4:38                       ` David Miller
2007-01-03  5:05                         ` Benjamin Herrenschmidt
2007-01-03 15:59                           ` Segher Boessenkool
2007-01-03 15:31                         ` Segher Boessenkool
2007-01-03  4:34                     ` David Miller
2007-01-02 21:15           ` Segher Boessenkool
2007-01-02 21:59             ` David Miller
2007-01-01  3:40   ` Segher Boessenkool
2007-01-01  4:21 ` Segher Boessenkool
  -- strict thread matches above, loose matches on Subject: below --
2007-01-11 17:39 ron minnich
2007-01-11 17:53 ` Mitch Bradley
2007-01-11 17:55   ` ron minnich
2007-01-11 18:36     ` Segher Boessenkool
2007-01-11 18:20 ` Stefan Reinauer
2007-01-11 18:47   ` Segher Boessenkool
2007-01-11 19:12     ` ron minnich
2007-01-11 19:11   ` ron minnich

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=1167710537.6165.28.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=devel@laptop.org \
    --cc=dmk@flex.com \
    --cc=hch@infradead.org \
    --cc=jg@laptop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wmb@firmworks.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