Skip to content

Commit 623ee82

Browse files
Darren Trappmartinkpetersen
authored andcommitted
scsi: qla2xxx: Fix FC-NVMe IO abort during driver reset
Signed-off-by: Darren Trapp <[email protected]> Signed-off-by: Himanshu Madhani <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 1cbc0ef commit 623ee82

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

drivers/scsi/qla2xxx/qla_nvme.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,9 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport,
489489

490490
vha = fcport->vha;
491491

492+
if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags))
493+
return rval;
494+
492495
/*
493496
* If we know the dev is going away while the transport is still sending
494497
* IO's return busy back to stall the IO Q. This happens when the
@@ -597,14 +600,18 @@ static int qla_nvme_wait_on_command(srb_t *sp)
597600
return ret;
598601
}
599602

600-
void qla_nvme_abort(struct qla_hw_data *ha, struct srb *sp)
603+
void qla_nvme_abort(struct qla_hw_data *ha, struct srb *sp, int res)
601604
{
602605
int rval;
603606

604-
rval = ha->isp_ops->abort_command(sp);
605-
if (!rval && !qla_nvme_wait_on_command(sp))
606-
ql_log(ql_log_warn, NULL, 0x2112,
607-
"nvme_wait_on_comand timed out waiting on sp=%p\n", sp);
607+
if (!test_bit(ABORT_ISP_ACTIVE, &sp->vha->dpc_flags)) {
608+
rval = ha->isp_ops->abort_command(sp);
609+
if (!rval && !qla_nvme_wait_on_command(sp))
610+
ql_log(ql_log_warn, NULL, 0x2112,
611+
"timed out waiting on sp=%p\n", sp);
612+
} else {
613+
sp->done(sp, res);
614+
}
608615
}
609616

610617
static void qla_nvme_unregister_remote_port(struct work_struct *work)

drivers/scsi/qla2xxx/qla_nvme.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ struct pt_ls4_rx_unsol {
145145
void qla_nvme_register_hba(struct scsi_qla_host *);
146146
int qla_nvme_register_remote(struct scsi_qla_host *, struct fc_port *);
147147
void qla_nvme_delete(struct scsi_qla_host *);
148-
void qla_nvme_abort(struct qla_hw_data *, struct srb *sp);
148+
void qla_nvme_abort(struct qla_hw_data *, struct srb *sp, int res);
149149
void qla24xx_nvme_ls4_iocb(struct scsi_qla_host *, struct pt_ls4_request *,
150150
struct req_que *);
151151
void qla24xx_async_gffid_sp_done(void *, int);

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1734,7 +1734,7 @@ __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res)
17341734
sp_get(sp);
17351735
spin_unlock_irqrestore(qp->qp_lock_ptr,
17361736
flags);
1737-
qla_nvme_abort(ha, sp);
1737+
qla_nvme_abort(ha, sp, res);
17381738
spin_lock_irqsave(qp->qp_lock_ptr,
17391739
flags);
17401740
} else if (GET_CMD_SP(sp) &&

0 commit comments

Comments
 (0)