]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: qla2xxx: Remove unused qlt_free_qfull_cmds()
authorDr. David Alan Gilbert <linux@treblig.org>
Tue, 15 Apr 2025 00:27:56 +0000 (01:27 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 22 Apr 2025 01:49:16 +0000 (21:49 -0400)
qlt_free_qfull_cmds() was added in 2014 as part of commit 33e799775593
("qla2xxx: Add support for QFull throttling and Term Exchange retry") but
has remained unused.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://lore.kernel.org/r/20250415002803.135909-2-linux@treblig.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_target.c
drivers/scsi/qla2xxx/qla_target.h

index 11eadb3bd36e5c33d06fc34e4e3d5d3cb1f9ed86..8a892ac9541732e7d33a1ec09ce41d5a0930fa76 100644 (file)
@@ -5539,81 +5539,6 @@ qlt_alloc_qfull_cmd(struct scsi_qla_host *vha,
        spin_unlock_irqrestore(&vha->hw->tgt.q_full_lock, flags);
 }
 
-int
-qlt_free_qfull_cmds(struct qla_qpair *qpair)
-{
-       struct scsi_qla_host *vha = qpair->vha;
-       struct qla_hw_data *ha = vha->hw;
-       unsigned long flags;
-       struct qla_tgt_cmd *cmd, *tcmd;
-       struct list_head free_list, q_full_list;
-       int rc = 0;
-
-       if (list_empty(&ha->tgt.q_full_list))
-               return 0;
-
-       INIT_LIST_HEAD(&free_list);
-       INIT_LIST_HEAD(&q_full_list);
-
-       spin_lock_irqsave(&vha->hw->tgt.q_full_lock, flags);
-       if (list_empty(&ha->tgt.q_full_list)) {
-               spin_unlock_irqrestore(&vha->hw->tgt.q_full_lock, flags);
-               return 0;
-       }
-
-       list_splice_init(&vha->hw->tgt.q_full_list, &q_full_list);
-       spin_unlock_irqrestore(&vha->hw->tgt.q_full_lock, flags);
-
-       spin_lock_irqsave(qpair->qp_lock_ptr, flags);
-       list_for_each_entry_safe(cmd, tcmd, &q_full_list, cmd_list) {
-               if (cmd->q_full)
-                       /* cmd->state is a borrowed field to hold status */
-                       rc = __qlt_send_busy(qpair, &cmd->atio, cmd->state);
-               else if (cmd->term_exchg)
-                       rc = __qlt_send_term_exchange(qpair, NULL, &cmd->atio);
-
-               if (rc == -ENOMEM)
-                       break;
-
-               if (cmd->q_full)
-                       ql_dbg(ql_dbg_io, vha, 0x3006,
-                           "%s: busy sent for ox_id[%04x]\n", __func__,
-                           be16_to_cpu(cmd->atio.u.isp24.fcp_hdr.ox_id));
-               else if (cmd->term_exchg)
-                       ql_dbg(ql_dbg_io, vha, 0x3007,
-                           "%s: Term exchg sent for ox_id[%04x]\n", __func__,
-                           be16_to_cpu(cmd->atio.u.isp24.fcp_hdr.ox_id));
-               else
-                       ql_dbg(ql_dbg_io, vha, 0x3008,
-                           "%s: Unexpected cmd in QFull list %p\n", __func__,
-                           cmd);
-
-               list_move_tail(&cmd->cmd_list, &free_list);
-
-               /* piggy back on hardware_lock for protection */
-               vha->hw->tgt.num_qfull_cmds_alloc--;
-       }
-       spin_unlock_irqrestore(qpair->qp_lock_ptr, flags);
-
-       cmd = NULL;
-
-       list_for_each_entry_safe(cmd, tcmd, &free_list, cmd_list) {
-               list_del(&cmd->cmd_list);
-               /* This cmd was never sent to TCM.  There is no need
-                * to schedule free or call free_cmd
-                */
-               qlt_free_cmd(cmd);
-       }
-
-       if (!list_empty(&q_full_list)) {
-               spin_lock_irqsave(&vha->hw->tgt.q_full_lock, flags);
-               list_splice(&q_full_list, &vha->hw->tgt.q_full_list);
-               spin_unlock_irqrestore(&vha->hw->tgt.q_full_lock, flags);
-       }
-
-       return rc;
-}
-
 static void
 qlt_send_busy(struct qla_qpair *qpair, struct atio_from_isp *atio,
     uint16_t status)
index 354fca2e7feb27f1e430af3099881e2d1ddc218f..71cf0236ea7d1773a8d7eed5fc32bf88e46a0dc3 100644 (file)
@@ -1083,7 +1083,6 @@ extern int qlt_stop_phase1(struct qla_tgt *);
 extern void qlt_stop_phase2(struct qla_tgt *);
 extern irqreturn_t qla83xx_msix_atio_q(int, void *);
 extern void qlt_83xx_iospace_config(struct qla_hw_data *);
-extern int qlt_free_qfull_cmds(struct qla_qpair *);
 extern void qlt_logo_completion_handler(fc_port_t *, int);
 extern void qlt_do_generation_tick(struct scsi_qla_host *, int *);