diff options
author | Uma Krishnan <ukrishn@linux.vnet.ibm.com> | 2017-06-22 05:14:56 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-06-26 22:01:09 +0300 |
commit | a1ea04b3ebd9ae5c1cd5bf48be37aba0d93c1acc (patch) | |
tree | 39287f6bd6f90ac40ea84d4163fc2c25c9c960e8 /drivers/scsi/cxlflash/common.h | |
parent | a002bf830f5df3e622e32fdbde1756bcbb6aedad (diff) | |
download | linux-a1ea04b3ebd9ae5c1cd5bf48be37aba0d93c1acc.tar.xz |
scsi: cxlflash: Flush pending commands in cleanup path
When the AFU is reset in an error path, pending scsi commands can be
silently dropped without completion or a formal abort. This puts the onus
on the cxlflash driver to notify mid-layer and indicating that the command
can be retried.
Once the card has been quiesced, the hardware send queue lock is acquired
to prevent any data movement while the pending commands are processed.
Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/cxlflash/common.h')
-rw-r--r-- | drivers/scsi/cxlflash/common.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/scsi/cxlflash/common.h b/drivers/scsi/cxlflash/common.h index 3eaa3be43d24..11a5b0a10a34 100644 --- a/drivers/scsi/cxlflash/common.h +++ b/drivers/scsi/cxlflash/common.h @@ -157,7 +157,9 @@ struct afu_cmd { struct list_head queue; u32 hwq_index; - u8 cmd_tmf:1; + u8 cmd_tmf:1, + cmd_aborted:1; + struct list_head list; /* Pending commands link */ /* As per the SISLITE spec the IOARCB EA has to be 16-byte aligned. @@ -176,6 +178,7 @@ static inline struct afu_cmd *sc_to_afucz(struct scsi_cmnd *sc) struct afu_cmd *afuc = sc_to_afuc(sc); memset(afuc, 0, sizeof(*afuc)); + INIT_LIST_HEAD(&afuc->queue); return afuc; } |