Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2ffd4e5 authored by Bill Kuzeja's avatar Bill Kuzeja Committed by Martin K. Petersen
Browse files

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: 45235022 ("scsi: qla2xxx: Fix driver unload by shutting down chip")
Signed-off-by: default avatarBill Kuzeja <william.kuzeja@stratus.com>
Reviewed-by: default avatarLaurence Oberman <loberman@redhat.com>
Acked-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent f635e48e
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1749,7 +1749,7 @@ qla2x00_loop_reset(scsi_qla_host_t *vha)
static void
__qla2x00_abort_all_cmds(struct qla_qpair *qp, int res)
{
	int cnt;
	int cnt, status;
	unsigned long flags;
	srb_t *sp;
	scsi_qla_host_t *vha = qp->vha;
@@ -1799,10 +1799,16 @@ __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res)
					if (!sp_get(sp)) {
						spin_unlock_irqrestore
							(qp->qp_lock_ptr, flags);
						qla2xxx_eh_abort(
						status = qla2xxx_eh_abort(
							GET_CMD_SP(sp));
						spin_lock_irqsave
							(qp->qp_lock_ptr, flags);
						/*
						 * Get rid of extra reference caused
						 * by early exit from qla2xxx_eh_abort
						 */
						if (status == FAST_IO_FAIL)
							atomic_dec(&sp->ref_count);
					}
				}
				sp->done(sp, res);