Re: Re: Possible problem with device_move()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 3 Aug 2007, Rafael J. Wysocki wrote:

> > > Why not?  If the device can indicate something like "place me after that one"
> > > to the code creating the list, we can handle that too. 
> > 
> > Yes, but currently we don't have any way of indicating that.  And if we 
> > did, it work work just as well with the current dpm_active list, right?
> 
> Well, I don't know. :-)
> 
> It seems the problem is _exactly_ that we have no means to represent the
> dependencies between devices other than the order of registration and/or
> the parent-child relationships.

Yes.

> Now, the simplest things that comes to mind is to do what we're doing (ie.
> use the order of registration) with a modification allowing the exceptional
> devices to have a "please move me to the end of list" flag set.  The PM core
> would then browse the list during suspend and move the devices marked like
> this to the end of dpm_active along with their children, if need be.

Code is more flexible than flags.  Why not export a function drivers
can call, or better yet, a handful of functions to do different things?  
It ought to suffice for drivers to call them during probing or
registration, rather than every time the system is suspended.  They
also could be called after device_move() -- and to prevent races we
should export pm_sleep_[un]lock().

Suggested functions:

     1. Move A in front of B, together with all of A's ancestors which
	aren't already ahead of B (or maybe require that A's parent be
	ahead of B already).

     2. Move device A to the end (A must not have any children).

Anything else?  I think this will cover all the cases we currently are 
concerned about.

Alan Stern

_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm

[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux