lkml.org 
[lkml]   [2011]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] [SCSI] sd: fix runtime status check in sd_shutdown
On Wed, 14 Dec 2011, Lin Ming wrote:

> Commit af8db15 disabled device's runtime PM during shutdown.
> So sd's runtime status can't be checked with pm_runtime_suspended(dev)
> any more.
>
> Fix it by checking runtime status with pm_runtime_status_suspended(dev).
>
> Signed-off-by: Lin Ming <ming.m.lin@intel.com>
> ---
> drivers/scsi/sd.c | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index 7b3f807..284b087 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -2742,7 +2742,12 @@ static void sd_shutdown(struct device *dev)
> if (!sdkp)
> return; /* this can happen */
>
> - if (pm_runtime_suspended(dev))
> + /*
> + * Check runtime status with pm_runtime_status_suspended(dev)
> + * instead of pm_runtime_suspended(dev),
> + * because device_shutdown() has disabled the device's runtime PM.
> + */
> + if (pm_runtime_status_suspended(dev))
> goto exit;
>
> if (sdkp->WCE) {

This is no longer needed. See commit
fe6b91f47080eb17d21cbf2a39311877d57f6938 (PM / Driver core: leave
runtime PM enabled during system shutdown).

Alan Stern



\
 
 \ /
  Last update: 2011-12-14 17:53    [W:0.024 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site