Home Home > GIT Browse > SLE12-SP4-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2019-06-06 10:40:58 +0200
committerHannes Reinecke <hare@suse.de>2019-06-06 10:41:10 +0200
commitcbfbea0dbc015c089a26971d1549d56a25f3c19e (patch)
treeb525fb64d2eba4b142e7e87ecf8cefeff2e20278
parentf5309b327f499cb678cdc4fcac55051d1cddd231 (diff)
scsi: qla2xxx: Split the __qla2x00_abort_all_cmds() function
(bsc#1137444).
-rw-r--r--patches.drivers/scsi-qla2xxx-Split-the-__qla2x00_abort_all_cmds-func.patch128
-rw-r--r--series.conf1
2 files changed, 129 insertions, 0 deletions
diff --git a/patches.drivers/scsi-qla2xxx-Split-the-__qla2x00_abort_all_cmds-func.patch b/patches.drivers/scsi-qla2xxx-Split-the-__qla2x00_abort_all_cmds-func.patch
new file mode 100644
index 0000000000..c7855fe074
--- /dev/null
+++ b/patches.drivers/scsi-qla2xxx-Split-the-__qla2x00_abort_all_cmds-func.patch
@@ -0,0 +1,128 @@
+From: Bart Van Assche <bvanassche@acm.org>
+Date: Thu, 29 Nov 2018 10:25:11 -0800
+Subject: [PATCH] scsi: qla2xxx: Split the __qla2x00_abort_all_cmds() function
+Git-commit: c4e521b654e15e372a6429e269e7e907b4698224
+Patch-mainline: v5.0-rc1
+References: bsc#1137444
+
+Nesting in __qla2x00_abort_all_cmds() is way too deep. Reduce the nesting
+level by introducing a helper function. This patch does not change any
+functionality.
+
+[hare: resolved merge conflict manually]
+
+Reviewed-by: Laurence Oberman <loberman@redhat.com>
+Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com>
+Signed-off-by: Bart Van Assche <bvanassche@acm.org>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Acked-by: Hannes Reinecke <hare@suse.com>
+---
+ drivers/scsi/qla2xxx/qla_os.c | 82 +++++++++++++++++++------------------------
+ 1 file changed, 37 insertions(+), 45 deletions(-)
+
+diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
+index b658b9a5eb1e..5f78f14e84db 100644
+--- a/drivers/scsi/qla2xxx/qla_os.c
++++ b/drivers/scsi/qla2xxx/qla_os.c
+@@ -1746,10 +1746,45 @@ qla2x00_loop_reset(scsi_qla_host_t *vha)
+ return QLA_SUCCESS;
+ }
+
++static void qla2x00_abort_srb(struct qla_qpair *qp, srb_t *sp, const int res,
++ unsigned long *flags)
++ __releases(qp->qp_lock_ptr)
++ __acquires(qp->qp_lock_ptr)
++{
++ scsi_qla_host_t *vha = qp->vha;
++ struct qla_hw_data *ha = vha->hw;
++
++ if (sp->type == SRB_NVME_CMD || sp->type == SRB_NVME_LS) {
++ if (!sp_get(sp)) {
++ /* got sp */
++ spin_unlock_irqrestore(qp->qp_lock_ptr, *flags);
++ qla_nvme_abort(ha, sp, res);
++ spin_lock_irqsave(qp->qp_lock_ptr, *flags);
++ }
++ } else if (GET_CMD_SP(sp) && !ha->flags.eeh_busy &&
++ !test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) &&
++ !qla2x00_isp_reg_stat(ha) && sp->type == SRB_SCSI_CMD) {
++ /*
++ * Don't abort commands in adapter during EEH recovery as it's
++ * not accessible/responding.
++ *
++ * Get a reference to the sp and drop the lock. The reference
++ * ensures this sp->done() call and not the call in
++ * qla2xxx_eh_abort() ends the SCSI cmd (with result 'res').
++ */
++ if (!sp_get(sp)) {
++ spin_unlock_irqrestore(qp->qp_lock_ptr, *flags);
++ qla2xxx_eh_abort(GET_CMD_SP(sp));
++ spin_lock_irqsave(qp->qp_lock_ptr, *flags);
++ }
++ }
++ sp->done(sp, res);
++}
++
+ static void
+ __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res)
+ {
+- int cnt, status;
++ int cnt;
+ unsigned long flags;
+ srb_t *sp;
+ scsi_qla_host_t *vha = qp->vha;
+@@ -1768,50 +1803,7 @@ __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res)
+ req->outstanding_cmds[cnt] = NULL;
+ switch (sp->cmd_type) {
+ case TYPE_SRB:
+- if (sp->type == SRB_NVME_CMD ||
+- sp->type == SRB_NVME_LS) {
+- if (!sp_get(sp)) {
+- /* got sp */
+- spin_unlock_irqrestore
+- (qp->qp_lock_ptr,
+- flags);
+- qla_nvme_abort(ha, sp, res);
+- spin_lock_irqsave
+- (qp->qp_lock_ptr, flags);
+- }
+- } else if (GET_CMD_SP(sp) &&
+- !ha->flags.eeh_busy &&
+- (!test_bit(ABORT_ISP_ACTIVE,
+- &vha->dpc_flags)) &&
+- !qla2x00_isp_reg_stat(ha) &&
+- (sp->type == SRB_SCSI_CMD)) {
+- /*
+- * Don't abort commands in adapter
+- * during EEH recovery as it's not
+- * accessible/responding.
+- *
+- * Get a reference to the sp and drop
+- * the lock. The reference ensures this
+- * sp->done() call and not the call in
+- * qla2xxx_eh_abort() ends the SCSI cmd
+- * (with result 'res').
+- */
+- if (!sp_get(sp)) {
+- spin_unlock_irqrestore
+- (qp->qp_lock_ptr, flags);
+- 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);
++ qla2x00_abort_srb(qp, sp, res, &flags);
+ break;
+ case TYPE_TGT_CMD:
+ if (!vha->hw->tgt.tgt_ops || !tgt ||
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 5cbf7a0635..83f3b3cd70 100644
--- a/series.conf
+++ b/series.conf
@@ -20674,6 +20674,7 @@
patches.fixes/scsi-target-drop-unused-pi_prot_format-attribute-sto.patch
patches.drivers/scsi-qla2xxx-Introduce-a-switch-case-statement-in-ql.patch
patches.drivers/scsi-csiostor-remove-flush_scheduled_work
+ patches.drivers/scsi-qla2xxx-Split-the-__qla2x00_abort_all_cmds-func.patch
patches.arch/s390-scsi-zfcp-fix-posting-too-many-status-read-buffers.patch
patches.drivers/scsi-lpfc-Fix-panic-when-FW-log-buffsize-is-not-init.patch
patches.drivers/scsi-lpfc-update-manufacturer-attribute-to-reflect-B.patch