]> git.baikalelectronics.ru Git - kernel.git/commit
NVMe: Fix START_STOP_UNIT Scsi->NVMe translation.
authorDan McLeran <daniel.mcleran@intel.com>
Fri, 6 Jun 2014 14:27:27 +0000 (08:27 -0600)
committerMatthew Wilcox <matthew.r.wilcox@intel.com>
Fri, 13 Jun 2014 17:11:00 +0000 (13:11 -0400)
commitfb7c50ad15232eef62aa41ea857f4be27c07a642
treeb80c4ea77518d15176b66cf165b1ddbfa8faa8aa
parentf5b988ef69b2396d337e13fa4908c33ee2a8f8ca
NVMe: Fix START_STOP_UNIT Scsi->NVMe translation.

This patch contains several fixes for Scsi START_STOP_UNIT. The previous
code did not account for signed vs. unsigned arithmetic which resulted
in an invalid lowest power state caculation when the device only supports
1 power state.

The code for Power Condition == 2 (Idle) was not following the spec. The
spec calls for setting the device to specific power states, depending
upon Power Condition Modifier, without accounting for the number of
power states supported by the device.

The code for Power Condition == 3 (Standby) was using a hard-coded '0'
which is replaced with the macro POWER_STATE_0.

Signed-off-by: Dan McLeran <daniel.mcleran@intel.com>
Reviewed-by: Vishal Verma <vishal.l.verma@linux.intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
drivers/block/nvme-scsi.c