linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aaron Lu <aaron.lu@intel.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Jens Axboe <axboe@kernel.dk>, "Rafael J. Wysocki" <rjw@sisk.pl>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	linux-pm@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org, Aaron Lu <aaron.lwe@gmail.com>,
	Shane Huang <shane.huang@amd.com>
Subject: Re: [PATCH v7 4/4] sd: change to auto suspend mode
Date: Mon, 28 Jan 2013 16:56:51 +0800	[thread overview]
Message-ID: <20130128085651.GA2568@aaronlu.sh.intel.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1301181613060.1190-100000@iolanthe.rowland.org>

On Fri, Jan 18, 2013 at 04:25:10PM -0500, Alan Stern wrote:
> On Wed, 16 Jan 2013, Aaron Lu wrote:
> 
> > From: Lin Ming <ming.m.lin@intel.com>
> > 
> > Uses block layer runtime pm helper functions in
> > scsi_runtime_suspend/resume.
> > Remove scsi_autopm_* from sd open/release path and check_events path.
> > And remove the quiesce call in runtime suspend path, as we know there is
> > no request to quiesce for the device.
> > 
> > Signed-off-by: Lin Ming <ming.m.lin@intel.com>
> > Signed-off-by: Aaron Lu <aaron.lu@intel.com>
> 
> > --- a/drivers/scsi/scsi_sysfs.c
> > +++ b/drivers/scsi/scsi_sysfs.c
> > @@ -893,6 +893,8 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
> >  	 */
> >  	scsi_autopm_get_device(sdev);
> >  
> > +	blk_pm_runtime_init(rq, &sdev->sdev_gendev);
> > +
> >  	error = device_add(&sdev->sdev_gendev);
> >  	if (error) {
> >  		sdev_printk(KERN_INFO, sdev,
> 
> Someone just asked about the default autosuspend delay, and I realized
> your patch series doesn't set one.  Since we don't know the properties
> of the disk drive at this point (or even whether the device is a disk
> drive), the only safe course is to call
> 
> 	pm_runtime_set_autosuspend_delay(&sdev->sdev_gendev, -1);
> 
> before calling blk_pm_runtime_init().  Then autosuspends will be 
> prevented until userspace writes a non-negative value into the device's 
> control/autosuspend_delay_ms file.

Shall we do it inside blk_pm_runtime_init? This way, we do not need to
do it for every driver. And for drivers that do know a proper value for
autosuspend delay, they can call pm_runtime_set_autosuspend_delay
somewhere after blk_pm_runtime_init.

Thanks,
Aaron


  parent reply	other threads:[~2013-01-28  8:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-16  9:02 [PATCH v7 0/4] block layer runtime pm Aaron Lu
2013-01-16  9:02 ` [PATCH v7 1/4] block: add a flag to identify PM request Aaron Lu
2013-01-16  9:02 ` [PATCH v7 2/4] block: add runtime pm helpers Aaron Lu
2013-01-16  9:02 ` [PATCH v7 3/4] block: implement runtime pm strategy Aaron Lu
2013-01-16 15:30   ` Alan Stern
2013-01-17  5:13     ` Aaron Lu
2013-01-17 15:11       ` Alan Stern
2013-01-18  8:27         ` Aaron Lu
2013-01-18 15:26           ` Alan Stern
2013-01-19  6:24             ` Aaron Lu
2013-01-19 18:11               ` Alan Stern
2013-01-28  9:21                 ` Aaron Lu
2013-01-28 15:11                   ` Alan Stern
2013-01-17  6:31     ` Aaron Lu
2013-01-16  9:02 ` [PATCH v7 4/4] sd: change to auto suspend mode Aaron Lu
2013-01-18 21:25   ` Alan Stern
2013-01-21 12:44     ` Aaron Lu
2013-01-28  8:56     ` Aaron Lu [this message]
2013-01-28 15:12       ` Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130128085651.GA2568@aaronlu.sh.intel.com \
    --to=aaron.lu@intel.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=aaron.lwe@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=shane.huang@amd.com \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).