aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/qla2xxx/qla_nvme.c15
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c16
2 files changed, 7 insertions, 24 deletions
diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index 4c1112107e88..22e3fba28e51 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -131,11 +131,8 @@ static void qla_nvme_sp_ls_done(void *ptr, int res)
131 struct nvmefc_ls_req *fd; 131 struct nvmefc_ls_req *fd;
132 struct nvme_private *priv; 132 struct nvme_private *priv;
133 133
134 if (atomic_read(&sp->ref_count) == 0) { 134 if (WARN_ON_ONCE(atomic_read(&sp->ref_count) == 0))
135 ql_log(ql_log_warn, sp->fcport->vha, 0x2123,
136 "SP reference-count to ZERO on LS_done -- sp=%p.\n", sp);
137 return; 135 return;
138 }
139 136
140 atomic_dec(&sp->ref_count); 137 atomic_dec(&sp->ref_count);
141 138
@@ -160,6 +157,9 @@ static void qla_nvme_sp_done(void *ptr, int res)
160 nvme = &sp->u.iocb_cmd; 157 nvme = &sp->u.iocb_cmd;
161 fd = nvme->u.nvme.desc; 158 fd = nvme->u.nvme.desc;
162 159
160 if (WARN_ON_ONCE(atomic_read(&sp->ref_count) == 0))
161 return;
162
163 atomic_dec(&sp->ref_count); 163 atomic_dec(&sp->ref_count);
164 164
165 if (res == QLA_SUCCESS) { 165 if (res == QLA_SUCCESS) {
@@ -199,13 +199,8 @@ static void qla_nvme_abort_work(struct work_struct *work)
199 return; 199 return;
200 } 200 }
201 201
202 if (atomic_read(&sp->ref_count) == 0) { 202 if (WARN_ON_ONCE(atomic_read(&sp->ref_count) == 0))
203 WARN_ON(1);
204 ql_log(ql_log_info, fcport->vha, 0xffff,
205 "%s: command already aborted on sp: %p\n",
206 __func__, sp);
207 return; 203 return;
208 }
209 204
210 rval = ha->isp_ops->abort_command(sp); 205 rval = ha->isp_ops->abort_command(sp);
211 206
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 73ddd02d1a39..e1c82a0a9745 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -716,14 +716,8 @@ qla2x00_sp_compl(void *ptr, int res)
716 struct scsi_cmnd *cmd = GET_CMD_SP(sp); 716 struct scsi_cmnd *cmd = GET_CMD_SP(sp);
717 struct completion *comp = sp->comp; 717 struct completion *comp = sp->comp;
718 718
719 if (atomic_read(&sp->ref_count) == 0) { 719 if (WARN_ON_ONCE(atomic_read(&sp->ref_count) == 0))
720 ql_dbg(ql_dbg_io, sp->vha, 0x3015,
721 "SP reference-count to ZERO -- sp=%p cmd=%p.\n",
722 sp, GET_CMD_SP(sp));
723 if (ql2xextended_error_logging & ql_dbg_io)
724 WARN_ON(atomic_read(&sp->ref_count) == 0);
725 return; 720 return;
726 }
727 721
728 atomic_dec(&sp->ref_count); 722 atomic_dec(&sp->ref_count);
729 723
@@ -827,14 +821,8 @@ qla2xxx_qpair_sp_compl(void *ptr, int res)
827 struct scsi_cmnd *cmd = GET_CMD_SP(sp); 821 struct scsi_cmnd *cmd = GET_CMD_SP(sp);
828 struct completion *comp = sp->comp; 822 struct completion *comp = sp->comp;
829 823
830 if (atomic_read(&sp->ref_count) == 0) { 824 if (WARN_ON_ONCE(atomic_read(&sp->ref_count) == 0))
831 ql_dbg(ql_dbg_io, sp->fcport->vha, 0x3079,
832 "SP reference-count to ZERO -- sp=%p cmd=%p.\n",
833 sp, GET_CMD_SP(sp));
834 if (ql2xextended_error_logging & ql_dbg_io)
835 WARN_ON(atomic_read(&sp->ref_count) == 0);
836 return; 825 return;
837 }
838 826
839 atomic_dec(&sp->ref_count); 827 atomic_dec(&sp->ref_count);
840 828