- To: Aaron Lu <aaron.lu@xxxxxxx>
- Subject: Re: [PATCH v3 2/7] scsi: pm: use autosuspend if device supports it
- From: Oliver Neukum <oneukum@xxxxxxx>
- Date: Thu, 26 Jul 2012 15:01:15 +0200
- Cc: James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>, Jeff Garzik <jgarzik@xxxxxxxxx>, Lin Ming <minggr@xxxxxxxxx>, Jeff Wu <jeff.wu@xxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, linux-pm@xxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, linux-ide@xxxxxxxxxxxxxxx, Aaron Lu <aaron.lwe@xxxxxxxxx>
- In-reply-to: <20120726124326.GA2022@localhost.localdomain>
- Organization: SUSE
- User-agent: KMail/4.8.4 (Linux/3.5.0-12-desktop+; KDE/4.8.4; x86_64; ; )
On Thursday 26 July 2012 20:43:32 Aaron Lu wrote:
> > What is the purpose of this approach?
>
> The purpose is to let scsi layer driver(sd, sr, etc.) use the same pm
> api(scsi_autopm_put_device) to put the device to runtime suspended
> state.
> When the device is ready to be suspended, if it does not make use of
> autosuspend, call pm_runtime_put_sync for it; if it makes use of
> autosuspend, call the autosuspend runtime pm apis for it.
>
> > You need a very good reason to have an API do two different things
> > based on this.
>
> If you see the above reason not good, I'll prepare an updated version
> to create a new api to cover the autosuspend case, something like:
> void scsi_autopm_put_device_autosuspend(struct scsi_device *sdev)
> {
> pm_runtime_mark_last_busy(&sdev->sdev_gendev);
> pm_runtime_put_autosuspend(&sdev->sdev_gendev);
> }
> Does this look right?
Much better :-)
Regards
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[SCSI Target Devel]
[Linux SCSI Target Infrastructure]
[Kernel Newbies]
[Share Photos]
[IDE]
[Security]
[Git]
[Netfilter]
[Bugtraq]
[Photos]
[Yosemite]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Linux ATA RAID]
[Linux IIO]
[Samba]
[Video 4 Linux]
[Device Mapper]
[Linux Resources]