devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Greg KH <greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>,
	Li Yang-R58472 <r58472-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: "devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org"
	<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Jia Hongtao-B38951
	<B38951-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Subject: Re: [PATCH V3 5/6] Avoid duplicate probe for of platform devices
Date: Wed, 11 Jul 2012 19:01:41 +0100	[thread overview]
Message-ID: <20120711180141.B01733E07D1@localhost> (raw)
In-Reply-To: <20120709145831.GB3961-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>

On Mon, 9 Jul 2012 07:58:31 -0700, Greg KH <greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org> wrote:
> On Mon, Jul 09, 2012 at 03:46:59AM +0000, Li Yang-R58472 wrote:
> > > > I don't understand, why is this just showing up now?  What changed to
> > > > cause this?  Couldn't that be the real problem here?
> > > >
> > > 
> > > The issue is showing up because we now probe devices twice.
> > > Previously, we just probe devices once. But now we changed the way of pci
> > > init which makes pci controllers should be probed earlier than other
> > > devices.
> > > So we have to probe pci nodes separately. Probe more than once is the
> > > root
> > > cause of this issue.
> > > 
> > > The pci patchset I mentioned please refer to:
> > > http://patchwork.ozlabs.org/patch/163742/
> > 
> > Let me try to clarify a little bit.  The of platform bus normally
> > traverse the device tree to add all the devices.  The change which
> > caused problem is that we need to probe PCIe RC devices at a earlier
> > stage of initialization.
> 
> That sounds, wrong.

Yes, really really wrong; starting with terminology...

> > So we added these PCIe RC devices earlier than the normal device tree
> > traversal process.  These PCIe RC devices will be scanned again during
> > the normal traversal and cause duplicated devices being added.  Our
> > proposal is to deal with duplicated devices automatically and make it
> > possible to scan the device tree multiple times for devices to be
> > added. 

... This isn't *probing* twice; it is *registration*.  That's cause
confusion on this thread.

> Then you need to put something in your own tree scanning logic to not
> try to register devices multiple times.  How about a simple flag in your
> device structure instead of having to muck around in the driver core
> internals?

Right.  If you're going to create the pci bus devices early, then you
need to explicitly inhibit creation of them later... but still; why do
the PCI bus devices need to be registered separately from the rest of the
devices on the simple-bus?  Why not just move *all* device registration
earlier?

> 
> Although one should seriously question the need to want to recan the bus
> and register devices at different times of the boot process...

Yes; the model they're trying to use sounds wrong.

g.

      parent reply	other threads:[~2012-07-11 18:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-08  9:43 [PATCH V3 5/6] Avoid duplicate probe for of platform devices Jia Hongtao
2012-06-11 15:33 ` Rob Herring
2012-06-12  2:16   ` Jia Hongtao-B38951
     [not found]   ` <4FD60FB1.7050106-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-07-06  2:05     ` Jia Hongtao-B38951
2012-07-06  4:26       ` Greg KH
     [not found]         ` <20120706042611.GA1841-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2012-07-06  6:07           ` Jia Hongtao-B38951
2012-07-06 16:17             ` Greg KH
     [not found]               ` <20120706161718.GA26894-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2012-07-09  2:34                 ` Jia Hongtao-B38951
     [not found]                   ` <412C8208B4A0464FA894C5F0C278CD5D01A1E694-TcFNo7jSaXPiTqIcKZ1S2K4g8xLGJsHaLnY5E4hWTkheoWH0uzbU5w@public.gmane.org>
2012-07-09  3:46                     ` Li Yang-R58472
2012-07-09 13:58                       ` Rob Herring
2012-07-10  2:29                         ` Jia Hongtao-B38951
2012-07-09 14:58                       ` Greg KH
     [not found]                         ` <20120709145831.GB3961-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2012-07-11 18:01                           ` Grant Likely [this message]

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=20120711180141.B01733E07D1@localhost \
    --to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
    --cc=B38951-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=r58472-KZfg59tc24xl57MIdRCFDg@public.gmane.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;
as well as URLs for NNTP newsgroup(s).