On Tue, 13 Sep 2005, David Brownell wrote:

> The parameter isn't needed, or even usable, without the recursion
> removed in the previous patch.

These patches look great, and I intend to go through them carefully.  At 
first glance, there appears to be a small problem in the pm-usbsusp patch:

 static int usb_generic_suspend(struct device *dev, pm_message_t message)
 {
        struct usb_interface    *intf;
        struct usb_driver       *driver;
        int                     status;
 
-       if (dev->driver == &usb_generic_driver)
-               return usb_suspend_device (to_usb_device(dev), message);
+       /* USB devices enter SUSPEND state through their hubs, but can be
+        * marked for FREEZE as soon as their children are already idled.
+        */
+       if (dev->driver == &usb_generic_driver) {
+               if (dev->power.power_state.event == message.event)
+                       return 0;
+               /* we need to rule out bogus requests through sysfs */
+               status = device_for_each_child(dev, NULL, verify_suspended);
+               if (status)
+                       return status;
+               if (message.event == PM_EVENT_FREEZE) {
+                       dev->power.power_state = message;
+                       return 0;
+               }
+               return usb_suspend_device (to_usb_device(dev));
+       }

You skip calling usb_suspend_device for FREEZE events.  That's good for
external devices, but it's not good for root hubs.  They really do need to
be suspended even for FREEZE events, since FREEZE requires no interrupts
or DMA.  This will be easy to fix, of course.


Bringing up this next point may be a mistake, but bear with me...  Now
that we're switching to a model where the recursion for sleep transitions
is handled entirely by the PM core (and recursion for runtime PM is
handled by some as-yet unspecified means), there appears to be no longer
any need for the "locktree" protocol.  Do you agree?

Alan Stern



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to