lkml.org 
[lkml]   [2012]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v3 2/7] scsi: pm: use autosuspend if device supports it
Date
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



\
 
 \ /
  Last update: 2012-07-26 15:41    [W:0.073 / U:23.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site