lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111013182827.GL18574@ponder.secretlab.ca>
Date:	Thu, 13 Oct 2011 12:28:27 -0600
From:	Grant Likely <grant.likely@...retlab.ca>
To:	Alan Stern <stern@...land.harvard.edu>
Cc:	Ming Lei <tom.leiming@...il.com>,
	Andrei Warkentin <awarkentin@...are.com>,
	Greg KH <greg@...ah.com>, Dilan Lee <dilee@...dia.com>,
	"G, Manjunath Kondaiah" <manjugk@...com>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org,
	Josh Triplett <josh@...htriplett.org>, Manjunath@...per.es,
	linux-omap@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	Linux PM List <linux-pm@...r.kernel.org>,
	"Rafael J. Wysocki" <rjw@...k.pl>
Subject: Re: [PATCH 2/5] drivercore: Add driver probe deferral mechanism

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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ