lkml.org 
[lkml]   [2012]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC 4/5] scsi, pm, use autosuspend for scsi runtime PM
Date
So that the timeout can be adjusted for each device, make it easy to
implement request and open/close based runtime PM.

Signed-off-by: Huang Ying <ying.huang@intel.com>
---
drivers/scsi/scsi_pm.c | 2 +-
drivers/scsi/scsi_sysfs.c | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/scsi/scsi_pm.c
+++ b/drivers/scsi/scsi_pm.c
@@ -157,7 +157,7 @@ static int scsi_runtime_idle(struct devi
/* Insert hooks here for targets, hosts, and transport classes */

if (scsi_is_sdev_device(dev))
- err = pm_schedule_suspend(dev, 100);
+ err = pm_runtime_autosuspend(dev);
else
err = pm_runtime_suspend(dev);
return err;
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -887,6 +887,8 @@ int scsi_sysfs_add_sdev(struct scsi_devi
pm_runtime_set_active(&sdev->sdev_gendev);
pm_runtime_forbid(&sdev->sdev_gendev);
pm_runtime_enable(&sdev->sdev_gendev);
+ pm_runtime_set_autosuspend_delay(&sdev->sdev_gendev, 100);
+ pm_runtime_use_autosuspend(&sdev->sdev_gendev);
scsi_autopm_put_target_sync(starget);

/* The following call will keep sdev active indefinitely, until

\
 
 \ /
  Last update: 2012-02-06 08:35    [W:0.107 / U:0.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site