]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: Set request queue runtime PM status back to active on resume
authorMika Westerberg <mika.westerberg@linux.intel.com>
Thu, 18 Feb 2016 08:54:12 +0000 (10:54 +0200)
committerTejun Heo <tj@kernel.org>
Fri, 19 Feb 2016 15:52:45 +0000 (10:52 -0500)
commitcb0f1d308b4a172af06749249bbd0d0995d112d8
treef940f3cfecd128b13f49df7bc308ef7e8245bcb3
parent92dfa81a7f99b1f206f76a2d8dee659a9a71a11a
scsi: Set request queue runtime PM status back to active on resume

We treat system suspend of SCSI devices pretty much the same as runtime
suspend. If the device is already runtime suspended we leave it to that
state during system suspend. On resume from system sleep we then resume the
device and correct the runtime PM status back to "active".

There is a problem with this because runtime PM status of the request queue
in question is not changed (it will be in "suspended" state). When SCSI
disk driver (sd.c) resumes the disk it sends START message to the device
and because the request queue is still in "suspended" state
blk_pm_peek_request() returns NULL preventing resume of the disk.

The issue can be reproduced with following commands:

  # echo auto > /sys/block/sda/device/power/control
  # echo 15000 > /sys/block/sda/device/power/autosuspend_delay_ms
  [   57.191706] sd 0:0:0:0: [sda] Synchronizing SCSI cache
  [   57.380015] sd 0:0:0:0: [sda] Stopping disk

Now suspend the machine:

  # rtcwake -s10 -mmem

This ends up in soft lockup because resume is not proceeding accordingly
and userspace is never restarted. Also there is nothing printed to the
console.

Fix this by forcing request queue status to "active" before the disk is
resumed.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/scsi/scsi_pm.c