aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fnic
diff options
context:
space:
mode:
authorHiral Shah <hishah@cisco.com>2014-04-18 15:28:18 -0400
committerChristoph Hellwig <hch@lst.de>2014-05-19 07:32:55 -0400
commit668186637e013f41bb3b275fa1a3b993b4da2ccb (patch)
treea9b7fd8865c80d67472c06145864d3ee79da32af /drivers/scsi/fnic
parentc8ff03c6da96850e19fcaf359d1ae408308ad9d0 (diff)
fnic: Failing to queue aborts due to Q full cause terminate driver timeout
In fnic abort handler, abort queuing can be failed when hardware queue is full. The command state is left as abort queued. The command with abort queued state will never be queued next time for abort or termiantion. Fix restores the command state in above case. Signed-off-by: Hiral Shah <hishah@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Narsimhulu Musini <nmusini@cisco.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/fnic')
-rw-r--r--drivers/scsi/fnic/fnic_scsi.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
index 0521436d05d6..ea28b5ca4c73 100644
--- a/drivers/scsi/fnic/fnic_scsi.c
+++ b/drivers/scsi/fnic/fnic_scsi.c
@@ -1312,8 +1312,9 @@ static void fnic_cleanup_io(struct fnic *fnic, int exclude_id)
1312 1312
1313cleanup_scsi_cmd: 1313cleanup_scsi_cmd:
1314 sc->result = DID_TRANSPORT_DISRUPTED << 16; 1314 sc->result = DID_TRANSPORT_DISRUPTED << 16;
1315 FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, "fnic_cleanup_io:" 1315 FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
1316 " DID_TRANSPORT_DISRUPTED\n"); 1316 "%s: sc duration = %lu DID_TRANSPORT_DISRUPTED\n",
1317 __func__, (jiffies - start_time));
1317 1318
1318 if (atomic64_read(&fnic->io_cmpl_skip)) 1319 if (atomic64_read(&fnic->io_cmpl_skip))
1319 atomic64_dec(&fnic->io_cmpl_skip); 1320 atomic64_dec(&fnic->io_cmpl_skip);
@@ -1733,6 +1734,7 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
1733 struct fnic_stats *fnic_stats; 1734 struct fnic_stats *fnic_stats;
1734 struct abort_stats *abts_stats; 1735 struct abort_stats *abts_stats;
1735 struct terminate_stats *term_stats; 1736 struct terminate_stats *term_stats;
1737 enum fnic_ioreq_state old_ioreq_state;
1736 int tag; 1738 int tag;
1737 DECLARE_COMPLETION_ONSTACK(tm_done); 1739 DECLARE_COMPLETION_ONSTACK(tm_done);
1738 1740
@@ -1793,6 +1795,7 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
1793 * the completion wont be done till mid-layer, since abort 1795 * the completion wont be done till mid-layer, since abort
1794 * has already started. 1796 * has already started.
1795 */ 1797 */
1798 old_ioreq_state = CMD_STATE(sc);
1796 CMD_STATE(sc) = FNIC_IOREQ_ABTS_PENDING; 1799 CMD_STATE(sc) = FNIC_IOREQ_ABTS_PENDING;
1797 CMD_ABTS_STATUS(sc) = FCPIO_INVALID_CODE; 1800 CMD_ABTS_STATUS(sc) = FCPIO_INVALID_CODE;
1798 1801
@@ -1816,6 +1819,8 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
1816 if (fnic_queue_abort_io_req(fnic, sc->request->tag, task_req, 1819 if (fnic_queue_abort_io_req(fnic, sc->request->tag, task_req,
1817 fc_lun.scsi_lun, io_req)) { 1820 fc_lun.scsi_lun, io_req)) {
1818 spin_lock_irqsave(io_lock, flags); 1821 spin_lock_irqsave(io_lock, flags);
1822 if (CMD_STATE(sc) == FNIC_IOREQ_ABTS_PENDING)
1823 CMD_STATE(sc) = old_ioreq_state;
1819 io_req = (struct fnic_io_req *)CMD_SP(sc); 1824 io_req = (struct fnic_io_req *)CMD_SP(sc);
1820 if (io_req) 1825 if (io_req)
1821 io_req->abts_done = NULL; 1826 io_req->abts_done = NULL;
@@ -1859,12 +1864,8 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
1859 if (CMD_ABTS_STATUS(sc) == FCPIO_INVALID_CODE) { 1864 if (CMD_ABTS_STATUS(sc) == FCPIO_INVALID_CODE) {
1860 spin_unlock_irqrestore(io_lock, flags); 1865 spin_unlock_irqrestore(io_lock, flags);
1861 if (task_req == FCPIO_ITMF_ABT_TASK) { 1866 if (task_req == FCPIO_ITMF_ABT_TASK) {
1862 FNIC_SCSI_DBG(KERN_INFO,
1863 fnic->lport->host, "Abort Driver Timeout\n");
1864 atomic64_inc(&abts_stats->abort_drv_timeouts); 1867 atomic64_inc(&abts_stats->abort_drv_timeouts);
1865 } else { 1868 } else {
1866 FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host,
1867 "Terminate Driver Timeout\n");
1868 atomic64_inc(&term_stats->terminate_drv_timeouts); 1869 atomic64_inc(&term_stats->terminate_drv_timeouts);
1869 } 1870 }
1870 CMD_FLAGS(sc) |= FNIC_IO_ABT_TERM_TIMED_OUT; 1871 CMD_FLAGS(sc) |= FNIC_IO_ABT_TERM_TIMED_OUT;