From efc7a288382cffc76d6cdb9678f643db37991906 Mon Sep 17 00:00:00 2001 From: "Anil Chintalapati (achintal)" Date: Tue, 23 Dec 2014 19:40:00 +0000 Subject: fnic: IOMMU Fault occurs when IO and abort IO is out of order When I/O is aborted by mid-layer, fnic FW will complete the I/O before completing the abort task. In some cases abort request is completed before the I/O, which could lead to inconsistent driver and firmware states. In this case firmware reset would clear the inconsistent state. Signed-off-by: Anil Chintalapati Signed-off-by: Sesidhar Baddela Signed-off-by: Hiral Shah Signed-off-by: Christoph Hellwig --- drivers/scsi/fnic/fnic_scsi.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'drivers/scsi/fnic/fnic_scsi.c') diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c index 2097de42a147..155b286f1a9d 100644 --- a/drivers/scsi/fnic/fnic_scsi.c +++ b/drivers/scsi/fnic/fnic_scsi.c @@ -1892,6 +1892,21 @@ int fnic_abort_cmd(struct scsi_cmnd *sc) goto fnic_abort_cmd_end; } + /* IO out of order */ + + if (!(CMD_FLAGS(sc) & (FNIC_IO_ABORTED | FNIC_IO_DONE))) { + spin_unlock_irqrestore(io_lock, flags); + FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, + "Issuing Host reset due to out of order IO\n"); + + if (fnic_host_reset(sc) == FAILED) { + FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, + "fnic_host_reset failed.\n"); + } + ret = FAILED; + goto fnic_abort_cmd_end; + } + CMD_STATE(sc) = FNIC_IOREQ_ABTS_COMPLETE; /* -- cgit