lkml.org 
[lkml]   [2012]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 2/7] scsi: pm: use autosuspend if device supports it
Date
If the device is using autosuspend, when scsi_autopm_put_device is
called for it, use autosuspend runtime pm calls instead of the sync
call.

Signed-off-by: Aaron Lu <aaron.lu@amd.com>
---
drivers/scsi/scsi_pm.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_pm.c b/drivers/scsi/scsi_pm.c
index dc0ad85..7c93723 100644
--- a/drivers/scsi/scsi_pm.c
+++ b/drivers/scsi/scsi_pm.c
@@ -197,7 +197,13 @@ EXPORT_SYMBOL_GPL(scsi_autopm_get_device);

void scsi_autopm_put_device(struct scsi_device *sdev)
{
- pm_runtime_put_sync(&sdev->sdev_gendev);
+ if (sdev->sdev_gendev.power.use_autosuspend) {
+ pm_runtime_mark_last_busy(&sdev->sdev_gendev);
+ pm_runtime_put_autosuspend(&sdev->sdev_gendev);
+ } else {
+ pm_runtime_put_sync(&sdev->sdev_gendev);
+ }
+
}
EXPORT_SYMBOL_GPL(scsi_autopm_put_device);

--
1.7.11.3



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