diff options
author | Bill Kuzeja <William.Kuzeja@stratus.com> | 2018-11-05 11:23:50 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-11-08 21:09:26 -0500 |
commit | f2ffd4e5bc7b629b312be48fbe3c3a2afbd67e4a (patch) | |
tree | b9ec7f03c32103129cc9761c135e4687c9c81eb1 | |
parent | f635e48e866ee1a47d2d42ce012fdcc07bf55853 (diff) |
scsi: qla2xxx: Timeouts occur on surprise removal of QLogic adapter
When doing a surprise removal of an adapter, some in flight I/Os can get
stuck and take a while to complete (they actually time out and are
retried). We are not handling an early error exit from qla2xxx_eh_abort
properly.
Fixes: 45235022da99 ("scsi: qla2xxx: Fix driver unload by shutting down chip")
Signed-off-by: Bill Kuzeja <william.kuzeja@stratus.com>
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 20c85eed1a75..b658b9a5eb1e 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -1749,7 +1749,7 @@ qla2x00_loop_reset(scsi_qla_host_t *vha) | |||
1749 | static void | 1749 | static void |
1750 | __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res) | 1750 | __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res) |
1751 | { | 1751 | { |
1752 | int cnt; | 1752 | int cnt, status; |
1753 | unsigned long flags; | 1753 | unsigned long flags; |
1754 | srb_t *sp; | 1754 | srb_t *sp; |
1755 | scsi_qla_host_t *vha = qp->vha; | 1755 | scsi_qla_host_t *vha = qp->vha; |
@@ -1799,10 +1799,16 @@ __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res) | |||
1799 | if (!sp_get(sp)) { | 1799 | if (!sp_get(sp)) { |
1800 | spin_unlock_irqrestore | 1800 | spin_unlock_irqrestore |
1801 | (qp->qp_lock_ptr, flags); | 1801 | (qp->qp_lock_ptr, flags); |
1802 | qla2xxx_eh_abort( | 1802 | status = qla2xxx_eh_abort( |
1803 | GET_CMD_SP(sp)); | 1803 | GET_CMD_SP(sp)); |
1804 | spin_lock_irqsave | 1804 | spin_lock_irqsave |
1805 | (qp->qp_lock_ptr, flags); | 1805 | (qp->qp_lock_ptr, flags); |
1806 | /* | ||
1807 | * Get rid of extra reference caused | ||
1808 | * by early exit from qla2xxx_eh_abort | ||
1809 | */ | ||
1810 | if (status == FAST_IO_FAIL) | ||
1811 | atomic_dec(&sp->ref_count); | ||
1806 | } | 1812 | } |
1807 | } | 1813 | } |
1808 | sp->done(sp, res); | 1814 | sp->done(sp, res); |