All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: linux-kernel@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org,
	Rob Herring <rob.herring@calxeda.com>
Subject: Re: [PATCH] of: When constructing the bus id consider assigned-addresses as well
Date: Thu, 29 Nov 2012 16:26:48 +0000	[thread overview]
Message-ID: <20121129162648.80DBC3E0912@localhost> (raw)
In-Reply-To: <20121126182054.GA30177@obsidianresearch.com>

On Mon, 26 Nov 2012 11:20:54 -0700, Jason Gunthorpe <jgunthorpe@obsidianresearch.com> wrote:
> On Mon, Nov 26, 2012 at 02:03:16PM +0000, Grant Likely wrote:
> > On Wed, 21 Nov 2012 14:02:40 -0700, Jason Gunthorpe <jgunthorpe@obsidianresearch.com> wrote:
> > > 'assigned-addresses' is used for certain PCI device type nodes in
> > > lieu of 'reg',  since this is enforced by of/address.c, have
> > > of_device_make_bus_id look there as well.
> > > 
> > > Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> > 
> > If it is a PCI device, then of_device_make_bus_id() shouldn't come into
> > play. PCI devices already have their own naming scheme. Only
> > platform_bus device creation uses of_device_make_bus_id(). What am I
> > missing?
> 
> In my embedded case I have a complex PCI-E connected SOC device.
> 
> This is modeled in OF by having a PCI-E bus, a PCI-E device node, and
> then all of the SOC devices (I2C, GPIO, drivers, etc) placed under the
> PCI-E device node.
> 
> The PCI driver that matches the device just turns it on and calls
> of_platform_populate(..) with its own node as an argument.
> 
> So of_device_make_bus_id isn't called on a PCI-E device node, it is
> called on the platform_device children of that node, and due to the
> way the other code works, and what the OF rules seem to be, those
> childen all use assigned-addresses. Without this patch the code just
> assigns monotonic ids to those nodes.

Hmmm. okay that makes sense, but something still isn't quite right. So
of_translate_address should take care of drilling down through the bus
layers, and when it gets to the PCI node it /should/ use
of_bus_pci_translate to handle traversing down to the parent node (which
uses the 'assigned-addresses' for the pci node.

However, in your case, of_device_make_bus_id() isn't using that code
path and you're getting a generic name instead (with no relation to the
device address).  Correct?

If that is the case, then the solution is to figure out why
of_translate_address() doesn't currently handle your situation and fix
it. It is not a good idea to add assigned-addresses specific parsing
code to that function since that won't work for any of the other bus
types.

g.

  reply	other threads:[~2012-11-29 16:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21 21:02 [PATCH] of: When constructing the bus id consider assigned-addresses as well Jason Gunthorpe
2012-11-26 14:03 ` Grant Likely
2012-11-26 18:20   ` Jason Gunthorpe
2012-11-29 16:26     ` Grant Likely [this message]
2012-11-29 19:38       ` Jason Gunthorpe
2012-11-30  9:48         ` Grant Likely
2012-12-01  0:49           ` Jason Gunthorpe
2012-12-03 14:27             ` 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=20121129162648.80DBC3E0912@localhost \
    --to=grant.likely@secretlab.ca \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob.herring@calxeda.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.