Alan Stern wrote:

Part of the problem may be that the meaning of suspend() isn't clearly
defined. Does it mean the driver is supposed to reduce the device's power
usage, or does it mean that the available power is going to be reduced by
someone else so the driver should simply prepare the device?

Did you see what the struct device_driver suspend() method does? It's more clearly defined, but that's not what the rest of the system does. It's only used for platform busses, and even there it doesn't seem to even handle the "veto" notion well. It's got an extra argument, which is yet another type-unsafe "u32" value.

And then there's PCI suspend, defined clearly since 2.4 to be the former:
drivers are responsible for calling pci_set_power_state().


On the other hand, suppose we go ahead and implement a power-off state in usbcore (by turning off the power to the device's parent port). If a hub and its child device are both in USB suspend, then there's no way to power-off the child without waking the hub.

Which isn't necessarily a problem, except that it's not implemented...


If the power-off request was for that single device alone we can simply return an error. If the power-off request was system-wide then the error won't matter; when the power to the parent hub is turned off, the power to the child will be too.

So I'm not sure what the right approach is.

One thing that's interesting about that example is that it shows that the current suspend() API is insufficient ... there's no way to express the distinction between "notify about system-wide power loss" and "request for per-device powerdown".

- Dave






------------------------------------------------------- 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

Reply via email to