summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_nvme.c
diff options
context:
space:
mode:
authorDuane Grigsby <duane.grigsby@cavium.com>2017-08-24 00:04:58 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2017-08-25 04:29:19 +0200
commitcf19c45dba19757e5016cb1acc5ef1529005f8c3 (patch)
treebdafceae9d3b31387ed70a9469dcd493bd920e45 /drivers/scsi/qla2xxx/qla_nvme.c
parentscsi: qla2xxx: Update fw_started flags at qpair creation. (diff)
downloadlinux-cf19c45dba19757e5016cb1acc5ef1529005f8c3.tar.xz
linux-cf19c45dba19757e5016cb1acc5ef1529005f8c3.zip
scsi: qla2xxx: Add command completion for error path
The driver held spinlocks during callbacks for NVME errors which resulted in a deadlock because recovery LS cmds needed the same lock. Signed-off-by: Duane Grigsby <duane.grigsby@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_nvme.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_nvme.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index 97a7b222b549..5692ae128655 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -154,6 +154,16 @@ static void qla_nvme_sp_ls_done(void *ptr, int res)
qla2x00_rel_sp(sp);
}
+void qla_nvme_cmpl_io(struct srb_iocb *nvme)
+{
+ srb_t *sp;
+ struct nvmefc_fcp_req *fd = nvme->u.nvme.desc;
+
+ sp = container_of(nvme, srb_t, u.iocb_cmd);
+ fd->done(fd);
+ qla2xxx_rel_qpair_sp(sp->qpair, sp);
+}
+
static void qla_nvme_sp_done(void *ptr, int res)
{
srb_t *sp = ptr;
@@ -175,7 +185,8 @@ static void qla_nvme_sp_done(void *ptr, int res)
fd->status = 0;
fd->rcv_rsplen = nvme->u.nvme.rsp_pyld_len;
- fd->done(fd);
+ list_add_tail(&nvme->u.nvme.entry, &sp->qpair->nvme_done_list);
+ return;
rel:
qla2xxx_rel_qpair_sp(sp->qpair, sp);
}