Re: [linux-usb-devel] Re: The evilness of struct usb_device->auto_pm

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

 



Am Freitag 28 September 2007 schrieb Rafael J. Wysocki:
> On Friday, 28 September 2007 09:04, Oliver Neukum wrote:
> > Am Donnerstag 27 September 2007 schrieb Rafael J. Wysocki:
> > > On Thursday, 27 September 2007 21:59, Oliver Neukum wrote:
> > > > Am Donnerstag 27 September 2007 schrieb Rafael J. Wysocki:
> > > > > On Thursday, 27 September 2007 21:37, Oliver Neukum wrote:
> > > > > > Am Donnerstag 27 September 2007 schrieb Rafael J. Wysocki:
> > > > > > > > But there's a problem, in that the resume methods don't take a message 
> > > > > > > > parameter.  So they wouldn't know whether they were doing a runtime 
> > > > > > > > resume or a system resume.
> > > > > > > 
> > > > > > > This is a general problem with the .resume() routines.
> > > > > > > 
> > > > > > > If you want to use one for runtime resume, the driver needs to preserve
> > > > > > > information allowing it to figure out what kind of resume is going to happen.
> > > > > > 
> > > > > > How? Suppose you
> > > > > > 
> > > > > > 1) runtime suspend
> > > > > > 2) whole system suspend
> > > > > > 3) whole system resume
> > > > > > 
> > > > > > What kind of resume do you do?
> > > > > 
> > > > > System resume, I'd guess.
> > > > 
> > > > How do you know unless resume() tells you to do so?
> > > > 
> > > > > Anyway, if we are going to stop using the freezer during suspend, the locking
> > > > > requirements will probably have to unified between the runtime and system
> > > > > suspend.
> > > > 
> > > > Even so, eg. for storage devices you should unquiesce them in case of runtime
> > > > suspend, which makes no sense otherwise.
> > > 
> > > OK
> > > 
> > > What exactly would you like to do?
> > 
> > Put the stuff into struct device and move the autosuspend code into
> > driver core.
> 
> Well, I thought that it would be nicer if drivers handled autosuspend in a
> transparent (from the point of view of the core) way.

That is possible only for drivers which are leaves in the device tree.

> Now, it seems to follow from what you're saying that this is not possible in
> general, because of USB mass storage devices that need some special handling.

No, they need the ordinary handling. All a device's children must be suspended
if a device is suspended.

> I'm not familiar with the USB code, so can you please tell me how the USB
> autosuspend is handled at present and what exactly the problem with that is?

The drivers for interfaces manage a count. If all a device's interfaces' count
goes to zero, the device is suspended. The drivers are notified through the
normal suspend() method. But children of these devices are not notified.

	Regards
		Oliver

_______________________________________________
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