From: Grant Likely <grant.likely@secretlab.ca>
To: Andres Salomon <dilinger@queued.net>
Cc: Daniel Drake <dsd@laptop.org>,
linux-kernel@vger.kernel.org,
devicetree-discuss@lists.ozlabs.org,
"David S. Miller" <davem@davemloft.net>,
sparclinux@vger.kernel.org
Subject: Re: [PATCH] of/pdt: allow DT device matching by fixing 'name' brokenness (v2)
Date: Wed, 23 Feb 2011 22:38:14 -0700 [thread overview]
Message-ID: <20110224053814.GA6046@angua.secretlab.ca> (raw)
In-Reply-To: <20110223203649.4fcbe1db@queued.net>
On Wed, Feb 23, 2011 at 08:36:49PM -0800, Andres Salomon wrote:
> On Wed, 23 Feb 2011 21:06:38 -0700
> Grant Likely <grant.likely@secretlab.ca> wrote:
>
> > > If the pkg2path hook isn't set and we're not sparc, we fall back to
> > > dp->name. That sucks, but I don't know of a better way to do
> > > things.
> >
> > More that sucks, it is just plain *wrong*. :-)
> >
> > so, to sum up, of_pdt_build_tree goes through the following process:
> >
> > 1) dp = of_pdt_create_node
> > - dp->name = of_pdt_get_one_property(node, "name"); /* name w/o
> > addr */
> >
> > 2) (SPARC) dp->path_component_name = build_path_component(dp);
> > - format <node name>@<address>
> > - uses dp->name value
> > - not on OLPC
>
> Also:
> - returns only the node name, not the full path
> - implemented differently depending upon bus type (see
> pci_path_component/sbus_path_component/ebus_path_component/ambapp_path_component)
> - sparc32 implemented differently versus sparc64
>
> >
> > 3) dp->full_name = of_pdt_build_full_name(dp)
> > - (SPARC) use dp->path_component_name
> > - (OLPC) depend on value from of_pdt_try_pkg2path(node);
> > - (others) fake it with an incorrect value?
> >
> > Am I correct?
>
> No.
>
> (others) use of_pdt_try_pkg2path
Regardless, in all cases the semantics are absolutely clear; all
platforms *must* have a reliable way of obtaining the full path and
the path_component_name. It it doesn't then it is fundamentally
broken.
> The reason why we fall back to dp->name is because I don't know what
> other architectures out there might not have package-to-path. I'm
> perfectly fine with falling back to a WARN or BUG.
Respin to fallback on WARN() and bail out. I'd be okay with merging a
patch that does that. Falling back to dp->name is absolutely incorrect.
I agree that API refinements can be deferred to 2.6.39.
g.
next prev parent reply other threads:[~2011-02-24 5:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-23 23:03 Andres Salomon
2011-02-23 23:28 ` Grant Likely
2011-02-24 0:16 ` Andres Salomon
2011-02-24 4:06 ` Grant Likely
2011-02-24 4:36 ` Andres Salomon
2011-02-24 5:38 ` Grant Likely [this message]
2011-02-24 6:38 ` [PATCH] of/pdt: allow DT device matching by fixing 'name' brokenness (v4) Andres Salomon
2011-02-24 0:34 ` [PATCH] of/pdt: allow DT device matching by fixing 'name' brokenness (v3) Andres Salomon
2011-02-24 2:47 ` Grant Likely
2011-02-24 2:51 ` Andres Salomon
2011-02-24 3:25 ` Grant Likely
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=20110224053814.GA6046@angua.secretlab.ca \
--to=grant.likely@secretlab.ca \
--cc=davem@davemloft.net \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=dilinger@queued.net \
--cc=dsd@laptop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sparclinux@vger.kernel.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
Powered by JetHome