scsi: cxlflash: Support WS16 unmap
authorMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
Thu, 22 Jun 2017 02:16:33 +0000 (21:16 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 26 Jun 2017 19:01:13 +0000 (15:01 -0400)
commit3223c01aa1cec60d59bd218aca5e202b558d225a
treee00bfee5a8984b6ff929564eacfc2aaaa4da509d
parentbc88ac47d5cb11c7dd9896781f793fae519d53fa
scsi: cxlflash: Support WS16 unmap

The cxlflash driver supports performing a write-same16 to scrub virtual
luns when they are released by a user. To date, AFUs for adapters that
are supported by cxlflash do not have the capability to unmap as part of
the WS operation. This can lead to fragmented flash devices which results
in performance degradation.

Future AFUs can optionally support unmap write-same commands and reflects
this support via the context control register. This provides userspace
applications with direct visibility such that they need not depend on a
host API.

Detect unmap support during cxlflash initialization by reading the context
control register associated with the primary hardware queue. Update the
existing write_same16() routine to set the unmap bit in the CDB when unmap
is supported by the host.

Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/cxlflash/common.h
drivers/scsi/cxlflash/main.c
drivers/scsi/cxlflash/sislite.h
drivers/scsi/cxlflash/vlun.c