]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: scsi_debug: implement IMMED bit
authorDouglas Gilbert <dgilbert@interlog.com>
Sat, 10 Feb 2018 02:36:39 +0000 (21:36 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 14 Feb 2018 02:49:18 +0000 (21:49 -0500)
commit5a0e691a6300a8dad3169680850a1ae79ce4db6f
tree4f5d711653e291b24ceabc9e7a7b0fc5063671db
parentd52c8733b04430021ba8fb390bcbab794bfcd7eb
scsi: scsi_debug: implement IMMED bit

The Start Stop Unit (SSU) command takes in the order of a second to complete
on some SAS SSDs and longer on hard disks. Synchronize Cache (SC) can also
take some time. Both commands have an IMMED bit in their cdbs for those apps
that don't want to wait. This patch introduces a long delay for those commands
when the IMMED bit is clear.  Since SC is a media access command then when the
fake_rw option is active, its cdb processing is skipped and it returns
immediately. The SSU command is not altered by the setting of the fake_rw
option. These actions are not changed by this patch.

Changes since v1:
  - clear the cdb mask of SYNCHRONIZE CACHE(16) cdb in byte 1, bit 0

Changes:
  - add the SYNCHRONIZE CACHE(16) command
  - together with the existing START STOP UNIT and SYNCHRONIZE CACHE(10)
    commands process the IMMED bit in their cdbs
  - if the IMMED bit is set, return immediately
  - if the IMMED bit is clear, treat the delay parameter as having
    a unit of one second
  - in the SYNCHRONIZE CACHE processing do a bounds check

Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_debug.c