From: grant.likely@secretlab.ca (Grant Likely)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] drivercore: Add driver probe deferral mechanism
Date: Thu, 13 Oct 2011 12:28:27 -0600 [thread overview]
Message-ID: <20111013182827.GL18574@ponder.secretlab.ca> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1110131413410.2026-100000@iolanthe.rowland.org>
On Thu, Oct 13, 2011 at 02:16:42PM -0400, Alan Stern wrote:
> On Thu, 13 Oct 2011, Grant Likely wrote:
>
> > For the deferred case; here is an example of the additional
> > constraint. Consider the following hierarchy:
> >
> > -A
> > +-B
> > | +-C
> > | +-D
> > |
> > +-E
> > +-F
> > +-G
> >
> > dpm_list could be ordered in at least the following ways (depending on
> > exactly when devices get registered). There are many permutation, but
> > children are always be listed after its direct parent.
> >
> > 1) ABECDFG (breadth first)
> > 2) AEBFGCD (breadth first)
> > 3) ABCDEFG (depth first)
> > 4) AEFGBCD (depth first)
> >
> > Now, assume that device B depends on device F, and also assume that
> > there is no way either to express that in the hierarchy or even for
> > the constraint to be known at device registration time (the is exactly
> > the situation we're dealing with on embedded platforms). Only the
> > driver for B knows that it needs a resource provided by F's driver.
> > So, the situation becomes that the ordering of dpm_list must now also
> > be sorted so that non-tree dependencies are also accounted for. Of
> > the list above, only sort order 4 meets the new constraint.
> >
> > The question then becomes, how can the dpm_list get resorted
> > dynamically at runtime to ensure that the new constraints are always
> > met without breaking old ones. Here are some options I can think of:
>
> This was a long message and I haven't absorbed the whole thing.
heh; I did get rather verbose there.
> However it's worth pointing out right at the start that we already have
> device_pm_move_before(), device_pm_move_after(), and
> device_pm_move_last(). They are intended specifically to provide
> drivers with a way of making sure that dpm_list is in the right order
> -- people have been aware of these issues for some time.
I saw those. I also notice that they are only used by device_move()
when reparenting a device (which is another wrinkle I hadn't though
about). Reparenting a device becomes problematic if the probe order
is also represented in the list. If device_move() gets called, then
any implicit probe-order sorting for that device would be lost.
I also notice that device_move disregards any children when moving a
device, which could also be a problem.
Although it looks like the only users of device_move are:
drivers/media/video/pvrusb2/pvrusb2-v4l2.c
drivers/s390/cio/device.c
net/bluetooth/hci_sysfs.c
net/bluetooth/rfcomm/tty.c
So it may not be significant to adapt.
g.
next prev parent reply other threads:[~2011-10-13 18:28 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1317963790-29426-1-git-send-email-manjugk@ti.com>
[not found] ` <1317963790-29426-2-git-send-email-manjugk@ti.com>
2011-10-07 6:43 ` [PATCH 1/5] drivercore: add new error value for deferred probe Greg KH
2011-10-07 10:00 ` Mark Brown
2011-10-07 22:12 ` Grant Likely
2011-10-07 23:28 ` Valdis.Kletnieks at vt.edu
2011-10-08 0:12 ` Greg KH
2011-10-09 22:59 ` Grant Likely
2011-10-10 1:06 ` Greg KH
2011-10-12 6:18 ` G, Manjunath Kondaiah
2011-10-13 4:10 ` Grant Likely
[not found] ` <1317963790-29426-3-git-send-email-manjugk@ti.com>
2011-10-07 6:49 ` [PATCH 2/5] drivercore: Add driver probe deferral mechanism Greg KH
2011-10-07 20:57 ` Josh Triplett
2011-10-07 21:23 ` Greg KH
2011-10-08 4:03 ` Josh Triplett
2011-10-08 15:55 ` Greg KH
2011-10-08 18:18 ` Josh Triplett
2011-10-10 17:37 ` Andrei Warkentin
2011-10-11 12:29 ` Ming Lei
2011-10-13 4:09 ` Grant Likely
2011-10-13 14:18 ` Ming Lei
2011-10-13 14:31 ` Alan Stern
2011-10-13 15:21 ` Ming Lei
2011-10-13 16:04 ` Alan Stern
2011-10-14 0:13 ` Ming Lei
2011-10-13 17:15 ` Grant Likely
2011-10-13 18:16 ` Alan Stern
2011-10-13 18:28 ` Grant Likely [this message]
2011-10-14 15:39 ` Alan Stern
2011-10-14 16:17 ` Grant Likely
2011-10-14 16:33 ` Alan Stern
2011-10-14 17:20 ` Grant Likely
2011-10-14 17:33 ` Alan Stern
2011-10-14 18:25 ` Grant Likely
2011-10-14 18:39 ` Alan Stern
2011-10-14 19:07 ` Grant Likely
2011-10-14 18:56 ` David Daney
2011-10-14 19:03 ` Grant Likely
2011-10-14 19:09 ` David Daney
2011-10-14 15:37 ` Alan Stern
2011-10-12 7:04 ` G, Manjunath Kondaiah
2011-10-07 21:28 ` Grant Likely
2011-10-07 6:50 ` [PATCH 0/5] Driver Probe Deferral Mechanism Greg KH
2011-10-07 7:37 ` G, Manjunath Kondaiah
[not found] ` <1317963790-29426-5-git-send-email-manjugk@ti.com>
2011-10-07 10:06 ` [PATCH 4/5] gpiolib: handle deferral probe error Alan Cox
2011-10-07 22:09 ` Grant Likely
2011-10-12 6:14 ` G, Manjunath Kondaiah
2011-10-13 4:12 ` 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=20111013182827.GL18574@ponder.secretlab.ca \
--to=grant.likely@secretlab.ca \
--cc=linux-arm-kernel@lists.infradead.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).