Re: [RFC] Implementation of SCSI dynamic power management

2008-01-10 Thread Oliver Neukum
Am Mittwoch, 9. Januar 2008 21:36:20 schrieb Alan Stern: > On Wed, 9 Jan 2008, Oliver Neukum wrote: > > > Am Mittwoch, 9. Januar 2008 18:22:51 schrieb Alan Stern: > > > On Wed, 9 Jan 2008, Oliver Neukum wrote: > > > > > > > This has an interesting implication. As the storage driver can share > >

Re: [RFC] Implementation of SCSI dynamic power management

2008-01-09 Thread Alan Stern
On Wed, 9 Jan 2008, Oliver Neukum wrote: > Am Mittwoch, 9. Januar 2008 18:22:51 schrieb Alan Stern: > > On Wed, 9 Jan 2008, Oliver Neukum wrote: > > > > > This has an interesting implication. As the storage driver can share > > > a device with in principle any other usb driver, we must audit all

Re: [RFC] Implementation of SCSI dynamic power management

2008-01-09 Thread Oliver Neukum
Am Mittwoch, 9. Januar 2008 18:22:51 schrieb Alan Stern: > On Wed, 9 Jan 2008, Oliver Neukum wrote: > > > This has an interesting implication. As the storage driver can share > > a device with in principle any other usb driver, we must audit all usb > > drivers if we wish to adopt this patch. > >

Re: [RFC] Implementation of SCSI dynamic power management

2008-01-09 Thread Alan Stern
On Wed, 9 Jan 2008, Oliver Neukum wrote: > This has an interesting implication. As the storage driver can share > a device with in principle any other usb driver, we must audit all usb > drivers if we wish to adopt this patch. > All a device's interfaces must be resumed when the storage interface

Re: [RFC] Implementation of SCSI dynamic power management

2008-01-09 Thread Oliver Neukum
Am Montag, 7. Januar 2008 20:42:23 schrieb Alan Stern: > When all the devices under a host are suspended, the LLD is informed > (via a new "autosuspend" method in the host template) so that it can > put the host adapter in a low-power state.  Likewise, a new > "autoresume" method is called when

Re: [linux-pm] Re: [RFC] Implementation of SCSI dynamic power management

2008-01-09 Thread Alan Stern
On Tue, 8 Jan 2008, Pavel Machek wrote: > > In fact suspend methods already do take an argument specifying the > > reason they were called. It wouldn't be hard to add a couple of extra > > PM_EVENT_* values for manual suspend and autosuspend. The problem is > > that resume methods don't take a

Re: [linux-pm] Re: [RFC] Implementation of SCSI dynamic power management

2008-01-08 Thread Pavel Machek
> > > When all the devices under a host are suspended, the LLD is informed > > > (via a new "autosuspend" method in the host template) so that it can > > > > That is most certainly a mistake. > > Why? > > > Is there a good reason to not modify > > to extend suspend() to take an extra argument

Re: [RFC] Implementation of SCSI dynamic power management

2008-01-08 Thread Alan Stern
On Tue, 8 Jan 2008, Stefan Richter wrote: > > How about something more like this: > > > > * Resume (return to an operational power level) the specified host, > > * and prevent autosuspends from other software layers until the > > * template autosuspend method has been called again. > > *

Re: [RFC] Implementation of SCSI dynamic power management

2008-01-08 Thread Stefan Richter
Alan Stern wrote: > On Tue, 8 Jan 2008, Oliver Neukum wrote: >> Am Montag, 7. Januar 2008 20:42:23 schrieb Alan Stern: >> > /** >> > + * autoresume - perform dynamic (runtime) host resume [...] >> This seems to be a bit misleading. It seems to me that you must cancel >> any outstanding request

Re: [RFC] Implementation of SCSI dynamic power management

2008-01-08 Thread Oliver Neukum
Am Dienstag, 8. Januar 2008 16:16:43 schrieb Alan Stern: > > What about the SG_IO ioctl() ? It seems to me that you must not autosuspend > > a device after that ioctl() has been used until the file handle is closed. > > That's an open problem.  The patch does block autosuspends as long as > an sg

Re: [RFC] Implementation of SCSI dynamic power management

2008-01-08 Thread Oliver Neukum
Am Dienstag, 8. Januar 2008 16:12:52 schrieb Alan Stern: > On Tue, 8 Jan 2008, Oliver Neukum wrote: > > > Am Montag, 7. Januar 2008 20:42:23 schrieb Alan Stern: > > >  /** > > > + * autoresume - perform dynamic (runtime) host resume > > > + [EMAIL PROTECTED]: host to resume > > > + * > > > + *

Re: [RFC] Implementation of SCSI dynamic power management

2008-01-08 Thread Alan Stern
On Tue, 8 Jan 2008, Oliver Neukum wrote: > Am Montag, 7. Januar 2008 20:42:23 schrieb Alan Stern: > > This patch applies to 2.6.24-rc6.  Comments and suggestions are > > welcome. > > What about the SG_IO ioctl() ? It seems to me that you must not autosuspend > a device after that ioctl() has bee

Re: [RFC] Implementation of SCSI dynamic power management

2008-01-08 Thread Alan Stern
On Tue, 8 Jan 2008, Oliver Neukum wrote: > Am Montag, 7. Januar 2008 20:42:23 schrieb Alan Stern: > >  /** > > + * autoresume - perform dynamic (runtime) host resume > > + [EMAIL PROTECTED]: host to resume > > + * > > + * Resume (return to an operational power level) the specified host. >

Re: [RFC] Implementation of SCSI dynamic power management

2008-01-08 Thread Oliver Neukum
Am Dienstag, 8. Januar 2008 16:06:53 schrieb Alan Stern: > Eventually parts of the autosuspend mechanism will go there.  But first > I thought we should have a proof-of-concept version working for at > least two different subsystems (such as SCSI and USB), so that we can > understand what should go

Re: [RFC] Implementation of SCSI dynamic power management

2008-01-08 Thread Alan Stern
On Tue, 8 Jan 2008, Oliver Neukum wrote: > Am Dienstag, 8. Januar 2008 04:56:03 schrieb Alan Stern: > > > You'll have to add this method whenever a new subsystem is affected > > > by power management. > > > > Sorry, I don't understand your point.  If you mean that we'll have to > > add autosuspen

Re: [RFC] Implementation of SCSI dynamic power management

2008-01-08 Thread Oliver Neukum
Am Montag, 7. Januar 2008 20:42:23 schrieb Alan Stern: > This patch applies to 2.6.24-rc6.  Comments and suggestions are > welcome. What about the SG_IO ioctl() ? It seems to me that you must not autosuspend a device after that ioctl() has been used until the file handle is closed. Regar

Re: [RFC] Implementation of SCSI dynamic power management

2008-01-08 Thread Oliver Neukum
Am Montag, 7. Januar 2008 20:42:23 schrieb Alan Stern: >  /** > + * autoresume - perform dynamic (runtime) host resume > + [EMAIL PROTECTED]: host to resume > + * > + * Resume (return to an operational power level) the specified host. > + * Return 0 if the resume was successful, otherwi

Re: [RFC] Implementation of SCSI dynamic power management

2008-01-08 Thread Oliver Neukum
Am Dienstag, 8. Januar 2008 04:56:03 schrieb Alan Stern: > > You'll have to add this method whenever a new subsystem is affected > > by power management. > > Sorry, I don't understand your point.  If you mean that we'll have to > add autosuspend and autoresume code to every driver that wants to >

Re: [RFC] Implementation of SCSI dynamic power management

2008-01-07 Thread Alan Stern
On Mon, 7 Jan 2008, Oliver Neukum wrote: > Am Montag, 7. Januar 2008 22:34:52 schrieb Alan Stern: > > On Mon, 7 Jan 2008, Oliver Neukum wrote: > > > > > Am Montag, 7. Januar 2008 20:42:23 schrieb Alan Stern: > > > > When all the devices under a host are suspended, the LLD is informed > > > > (vi

Re: [RFC] Implementation of SCSI dynamic power management

2008-01-07 Thread Oliver Neukum
Am Montag, 7. Januar 2008 22:34:52 schrieb Alan Stern: > On Mon, 7 Jan 2008, Oliver Neukum wrote: > > > Am Montag, 7. Januar 2008 20:42:23 schrieb Alan Stern: > > > When all the devices under a host are suspended, the LLD is informed > > > (via a new "autosuspend" method in the host template) so

Re: [RFC] Implementation of SCSI dynamic power management

2008-01-07 Thread Alan Stern
On Mon, 7 Jan 2008, Oliver Neukum wrote: > Am Montag, 7. Januar 2008 20:42:23 schrieb Alan Stern: > > When all the devices under a host are suspended, the LLD is informed > > (via a new "autosuspend" method in the host template) so that it can > > That is most certainly a mistake. Why? > Is th

Re: [RFC] Implementation of SCSI dynamic power management

2008-01-07 Thread Oliver Neukum
Am Montag, 7. Januar 2008 20:42:23 schrieb Alan Stern: > When all the devices under a host are suspended, the LLD is informed > (via a new "autosuspend" method in the host template) so that it can That is most certainly a mistake. Is there a good reason to not modify to extend suspend() to take a

[RFC] Implementation of SCSI dynamic power management

2008-01-07 Thread Alan Stern
This patch is a first pass at SCSI dynamic (or runtime) PM. The new code is enabled by a Kconfig option, CONFIG_SCSI_DYNAMIC_PM, in the top SCSI menu. If the option isn't selected then the overhead is essentially zero (in a few places code that was in-line gets moved out-of-line, but not in a