On Tue, 21 Sep 2004, David Brownell wrote: > > As one example, consider the problem you've been having with deadlocks > > involving dpm_sem. That entire design is misconceived. It forces dpm_sem > > to be a single chokepoint for the whole driver model. > > Right. The deadlocks are because the PM lists are protected using > that semaphore, rather than a spinlock, and because the pmcore code > uses the semaphore for too many other things. The (bogus) assumption > is that those other things never involve changing those lists (like > by adding/removing devices). Ergo self-deadlock.
Or put it another way: if the semaphore was used for _everything_, and not just by the PM core but by drivers as well so that the entire driver model was completely serialized, then again there wouldn't be any deadlock. > I'll disagree about dpm_sem; uniformity isn't the problem, it's lock scope. > Per-device locking of some kind is certainly needed to handle device power > management (lest tasks interfere on a given device). Ah, but if _all_ those tasks, in addition to power management, used dpm_sem then there wouldn't be any interference. Just blockage and slowdowns. (Not that I'm advocating this -- per-device locking like in USB is the best way to go.) By the way, the PM lists aren't necessary. By using the existing list pointers in the device structure it's possible to do a proper tree traversal with bounded stack usage. I don't know if anyone's interested in that... (And today I came up with a way to do suspend/resume without using locktree and without using multiple passes for locking. I can describe it later if you care to hear about it.) > > In the end, it may turn out to be necessary for the entire driver model to > > adopt the form of locking that usbcore now uses, or something very similar > > to it. > > Wouldn't surprise me at all. But getting there by incremental improvements > isn't going to be straightforward. And locking is subsidiary to having a > usable/correct model. I can't argue with that. The only name in the drivers/base/power/* files in Patrick Mochel; is anybody else working on solving these issues? (Is he, for that matter?) Alan Stern ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
