lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130128085651.GA2568@aaronlu.sh.intel.com>
Date:	Mon, 28 Jan 2013 16:56:51 +0800
From:	Aaron Lu <aaron.lu@...el.com>
To:	Alan Stern <stern@...land.harvard.edu>
Cc:	Jens Axboe <axboe@...nel.dk>, "Rafael J. Wysocki" <rjw@...k.pl>,
	James Bottomley <James.Bottomley@...senpartnership.com>,
	linux-pm@...r.kernel.org, linux-scsi@...r.kernel.org,
	linux-kernel@...r.kernel.org, Aaron Lu <aaron.lwe@...il.com>,
	Shane Huang <shane.huang@....com>
Subject: Re: [PATCH v7 4/4] sd: change to auto suspend mode

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@...el.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@...el.com>
> > Signed-off-by: Aaron Lu <aaron.lu@...el.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ