scsi: qla2xxx deadcoding
Subsystems (2)
cover scsi: qla2xxx deadcoding
From: "Dr. David Alan Gilbert" <[email protected]>
Hi,
This is a batch of deadcoding on the qla2xxx driver.
Note the last patch removes two unused module parameters, so I guess if anyone has that in some configs somewhere that might surprise them.
Other than that, it's all simple function deletion.
Build tested only.
Dr. David Alan Gilbert (8):
scsi: qla2xxx: Remove unused qlt_free_qfull_cmds
scsi: qla2xxx: Remove unused qlt_fc_port_deleted
scsi: qla2xxx: Remove unused qlt_83xx_iospace_config
scsi: qla2xxx: Remove unused qla82xx_pci_region_offset
scsi: qla2xxx: Remove unused qla82xx_wait_for_state_change
scsi: qla2xxx: Remove unused ql_log_qp
scsi: qla2xxx: Remove unused qla2x00_gpsc
scsi: qla2xxx: Remove unused module parameters
drivers/scsi/qla2xxx/qla_dbg.c | 53 ------------ drivers/scsi/qla2xxx/qla_dbg.h | 3 - drivers/scsi/qla2xxx/qla_gbl.h | 5 -- drivers/scsi/qla2xxx/qla_gs.c | 90 --------------------- drivers/scsi/qla2xxx/qla_nx.c | 45 ----------- drivers/scsi/qla2xxx/qla_os.c | 12 --- drivers/scsi/qla2xxx/qla_target.c | 129 ------------------------------ drivers/scsi/qla2xxx/qla_target.h | 3 - 8 files changed, 340 deletions(-)
Signature · 1 line
2.49.0
PATCH 1/8 scsi: qla2xxx: Remove unused qlt_free_qfull_cmds
From: "Dr. David Alan Gilbert" <[email protected]>
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.
--- drivers/scsi/qla2xxx/qla_target.c | 75 ------------------------------- drivers/scsi/qla2xxx/qla_target.h | 1 - 2 files changed, 76 deletions(-)
drivers/scsi/qla2xxx/qla_target.c +0 -75
@@ -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)
drivers/scsi/qla2xxx/qla_target.h +0 -1
@@ -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 *);
Signature · 1 line
2.49.0
PATCH 2/8 scsi: qla2xxx: Remove unused qlt_fc_port_deleted
In reply to [email protected]From: "Dr. David Alan Gilbert" <[email protected]>
qlt_fc_port_deleted() has been unused since the last use was removed by 2017's
commit 726b85487067 ("qla2xxx: Add framework for async fabric discovery")
Remove it.
--- drivers/scsi/qla2xxx/qla_target.c | 44 ------------------------------- drivers/scsi/qla2xxx/qla_target.h | 1 - 2 files changed, 45 deletions(-)
drivers/scsi/qla2xxx/qla_target.c +0 -44
@@ -1454,50 +1454,6 @@ static struct fc_port *qlt_create_sess(return sess; } -/* -* max_gen - specifies maximum session generation -* at which this deletion requestion is still valid -*/ -void -qlt_fc_port_deleted (struct scsi_qla_host *vha,fc_port_t *fcport,int max_gen) -{ -struct qla_tgt *tgt = vha->vha_tgt.qla_tgt; -struct fc_port *sess = fcport; -unsigned long flags; - -if (!vha->hw->tgt.tgt_ops) -return ; - -if (!tgt) -return ; - -spin_lock_irqsave (&vha->hw->tgt.sess_lock, flags); -if (tgt->tgt_stop) { -spin_unlock_irqrestore (&vha->hw->tgt.sess_lock, flags); -return ; - } -if (!sess->se_sess) { -spin_unlock_irqrestore (&vha->hw->tgt.sess_lock, flags); -return ; - } - -if (max_gen - sess->generation <0 ) { -spin_unlock_irqrestore (&vha->hw->tgt.sess_lock, flags); -ql_dbg (ql_dbg_tgt_mgt, vha,0xf092 , -"Ignoring stale deletion request for se_sess %p / sess %p" -" for port %8phC, req_gen %d, sess_gen %d\n" , - sess->se_sess, sess, sess->port_name, max_gen, - sess->generation); -return ; - } - -ql_dbg (ql_dbg_tgt_mgt, vha,0xf008 ,"qla_tgt_fc_port_deleted %p" , sess); - - sess->local =1 ; -spin_unlock_irqrestore (&vha->hw->tgt.sess_lock, flags); -qlt_schedule_sess_for_deletion (sess); -} -static inline int test_tgt_sess_count (struct qla_tgt *tgt) {struct qla_hw_data *ha = tgt->ha;
drivers/scsi/qla2xxx/qla_target.h +0 -1
@@ -1014,7 +1014,6 @@ extern int qlt_lport_register(void *, u64, u64, u64,extern void qlt_lport_deregister (struct scsi_qla_host *);extern void qlt_unreg_sess (struct fc_port *);extern void qlt_fc_port_added (struct scsi_qla_host *,fc_port_t *); -extern void qlt_fc_port_deleted (struct scsi_qla_host *,fc_port_t *,int );extern int __init qlt_init (void );extern void qlt_exit (void );extern void qlt_free_session_done (struct work_struct *);
Signature · 1 line
2.49.0
PATCH 3/8 scsi: qla2xxx: Remove unused qlt_83xx_iospace_config
In reply to [email protected]From: "Dr. David Alan Gilbert" <[email protected]>
qlt_83xx_iospace_config() has been unused since the last use was removed by 2017's
commit f54f2cb540b5 ("scsi: qla2xxx: Cleaned up queue configuration code.")
Remove it.
--- drivers/scsi/qla2xxx/qla_target.c | 10 ---------- drivers/scsi/qla2xxx/qla_target.h | 1 - 2 files changed, 11 deletions(-)
drivers/scsi/qla2xxx/qla_target.c +0 -10
@@ -6971,16 +6971,6 @@ qlt_81xx_config_nvram_stage2(struct scsi_qla_host *vha, } } -void -qlt_83xx_iospace_config (struct qla_hw_data *ha) -{ -if (!QLA_TGT_MODE_ENABLED ()) -return ; - - ha->msix_count +=1 ;/* For ATIO Q */ -} - -void qlt_modify_vp_config (struct scsi_qla_host *vha,struct vp_config_entry_24xx *vpmod)
drivers/scsi/qla2xxx/qla_target.h +0 -1
@@ -1081,7 +1081,6 @@ extern void qlt_mem_free(struct qla_hw_data *);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 void qlt_logo_completion_handler (fc_port_t *,int );extern void qlt_do_generation_tick (struct scsi_qla_host *,int *);
Signature · 1 line
2.49.0
PATCH 4/8 scsi: qla2xxx: Remove unused qla82xx_pci_region_offset
In reply to [email protected]From: "Dr. David Alan Gilbert" <[email protected]>
qla82xx_pci_region_offset() has been unused since the last use was removed by 2010's
commit 3711333dfbee ("[SCSI] qla2xxx: Updates for ISP82xx.")
Remove it.
--- drivers/scsi/qla2xxx/qla_gbl.h | 1 - drivers/scsi/qla2xxx/qla_nx.c | 19 ------------------- 2 files changed, 20 deletions(-)
drivers/scsi/qla2xxx/qla_gbl.h +0 -1
@@ -822,7 +822,6 @@ extern int qlafx00_rescan_isp(scsi_qla_host_t *);/* PCI related functions */ extern int qla82xx_pci_config (struct scsi_qla_host *);extern int qla82xx_pci_mem_read_2M (struct qla_hw_data *,u64 ,void *,int ); -extern int qla82xx_pci_region_offset (struct pci_dev *,int );extern int qla82xx_iospace_config (struct qla_hw_data *);/* Initialization related functions */
drivers/scsi/qla2xxx/qla_nx.c +0 -19
@@ -1595,25 +1595,6 @@ qla82xx_get_fw_offs(struct qla_hw_data *ha)return (u8 *)&ha->hablob->fw->data[offset]; } -/* PCI related functions */ -int qla82xx_pci_region_offset (struct pci_dev *pdev,int region) -{ -unsigned long val =0 ; -u32 control; - -switch (region) { -case 0 : - val =0 ; -break ; -case 1 : -pci_read_config_dword (pdev,QLA82XX_PCI_REG_MSIX_TBL , &control); - val = control +QLA82XX_MSIX_TBL_SPACE ; -break ; - } -return val; -} - -int qla82xx_iospace_config (struct qla_hw_data *ha) {
Signature · 1 line
2.49.0
PATCH 5/8 scsi: qla2xxx: Remove unused qla82xx_wait_for_state_change
In reply to [email protected]From: "Dr. David Alan Gilbert" <[email protected]>
qla82xx_wait_for_state_change() was added in 2010 as part of commit 579d12b58abb ("[SCSI] qla2xxx: Added support for quiescence mode for ISP82xx.")
but has remained unused.
Remove it.
--- drivers/scsi/qla2xxx/qla_gbl.h | 1 - drivers/scsi/qla2xxx/qla_nx.c | 26 -------------------------- 2 files changed, 27 deletions(-)
drivers/scsi/qla2xxx/qla_gbl.h +0 -1
@@ -865,7 +865,6 @@ extern int qla82xx_rd_32(struct qla_hw_data *, ulong);/* ISP 8021 IDC */ extern void qla82xx_clear_drv_active (struct qla_hw_data *); -extern uint32_t qla82xx_wait_for_state_change (scsi_qla_host_t *,uint32_t );extern int qla82xx_idc_lock (struct qla_hw_data *);extern void qla82xx_idc_unlock (struct qla_hw_data *);extern int qla82xx_device_state_handler (scsi_qla_host_t *);
drivers/scsi/qla2xxx/qla_nx.c +0 -26
@@ -2915,32 +2915,6 @@ qla82xx_need_qsnt_handler(scsi_qla_host_t *vha) } } -/* -* qla82xx_wait_for_state_change -* Wait for device state to change from given current state -* -* Note: -* IDC lock must not be held upon entry -* -* Return: -* Changed device state. -*/ -uint32_t -qla82xx_wait_for_state_change (scsi_qla_host_t *vha,uint32_t curr_state) -{ -struct qla_hw_data *ha = vha->hw; -uint32_t dev_state; - -do { -msleep (1000 ); -qla82xx_idc_lock (ha); - dev_state =qla82xx_rd_32 (ha,QLA82XX_CRB_DEV_STATE ); -qla82xx_idc_unlock (ha); - }while (dev_state == curr_state); - -return dev_state; -} -void qla8xxx_dev_failed_handler (scsi_qla_host_t *vha) {
Signature · 1 line
2.49.0
PATCH 6/8 scsi: qla2xxx: Remove unused ql_log_qp
In reply to [email protected]From: "Dr. David Alan Gilbert" <[email protected]>
ql_log_qp() was added in 2017 as part of
commit 22d84726e3b8 ("scsi: qla2xxx: Add debug logging routine for qpair") but has remained unused.
Remove it.
(That patch also added ql_dbg_qp but that is still used so is left in).
--- drivers/scsi/qla2xxx/qla_dbg.c | 53 ---------------------------------- drivers/scsi/qla2xxx/qla_dbg.h | 3 -- 2 files changed, 56 deletions(-)
drivers/scsi/qla2xxx/qla_dbg.c +0 -53
@@ -2705,59 +2705,6 @@ ql_dump_buffer(uint level, scsi_qla_host_t *vha, uint id, const void *buf, } } -/* -* This function is for formatting and logging log messages. -* It is to be used when vha is available. It formats the message -* and logs it to the messages file. All the messages will be logged -* irrespective of value of ql2xextended_error_logging. -* parameters: -* level: The level of the log messages to be printed in the -* messages file. -* vha: Pointer to the scsi_qla_host_t -* id: This is a unique id for the level. It identifies the -* part of the code from where the message originated. -* msg: The message to be displayed. -*/ -void -ql_log_qp (uint32_t level,struct qla_qpair *qpair,int32_t id, -const char *fmt, ...) -{ -va_list va; -struct va_format vaf; -char pbuf[128 ]; - -if (level > ql_errlev) -return ; - -ql_ktrace (0 , level, pbuf,NULL , qpair ? qpair->vha :NULL , id, fmt); - -if (!pbuf[0 ])/* set by ql_ktrace */ -ql_dbg_prefix (pbuf,ARRAY_SIZE (pbuf),NULL , - qpair ? qpair->vha :NULL , id); - -va_start (va, fmt); - - vaf.fmt = fmt; - vaf.va = &va; - -switch (level) { -case ql_log_fatal:/* FATAL LOG */ -pr_crit ("%s%pV" , pbuf, &vaf); -break ; -case ql_log_warn: -pr_err ("%s%pV" , pbuf, &vaf); -break ; -case ql_log_info: -pr_warn ("%s%pV" , pbuf, &vaf); -break ; -default : -pr_info ("%s%pV" , pbuf, &vaf); -break ; - } - -va_end (va); -} -/* * This function is for formatting and logging debug information. * It is to be used when vha is available. It formats the message
drivers/scsi/qla2xxx/qla_dbg.h +0 -3
@@ -334,9 +334,6 @@ ql_log(uint, scsi_qla_host_t *vha, uint, const char *fmt, ...);void __attribute__((format (printf,4 ,5 )))ql_log_pci (uint ,struct pci_dev *pdev,uint ,const char *fmt, ...); -void __attribute__((format (printf,4 ,5 ))) -ql_log_qp (uint32_t ,struct qla_qpair *,int32_t ,const char *fmt, ...); -/* Debug Levels */ /* The 0x40000000 is the max value any debug level can have * as ql2xextended_error_logging is of type signed int
Signature · 1 line
2.49.0
PATCH 7/8 scsi: qla2xxx: Remove unused qla2x00_gpsc
In reply to [email protected]From: "Dr. David Alan Gilbert" <[email protected]>
qla2x00_gpsc() was added in 2017 as part of
commit 726b85487067 ("qla2xxx: Add framework for async fabric discovery") but has remained unused.
Remove it.
--- drivers/scsi/qla2xxx/qla_gbl.h | 1 - drivers/scsi/qla2xxx/qla_gs.c | 90 ---------------------------------- 2 files changed, 91 deletions(-)
drivers/scsi/qla2xxx/qla_gbl.h +0 -1
@@ -720,7 +720,6 @@ extern void *qla2x00_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t);extern void *qla24xx_prep_ms_fdmi_iocb (scsi_qla_host_t *,uint32_t ,uint32_t );extern int qla2x00_fdmi_register (scsi_qla_host_t *);extern int qla2x00_gfpn_id (scsi_qla_host_t *,sw_info_t *); -extern int qla2x00_gpsc (scsi_qla_host_t *,sw_info_t *);extern size_t qla2x00_get_sym_node_name (scsi_qla_host_t *,uint8_t *,size_t );extern int qla2x00_chk_ms_status (scsi_qla_host_t *,ms_iocb_entry_t *,struct ct_sns_rsp *,const char *);
drivers/scsi/qla2xxx/qla_gs.c +0 -90
96 lines not on this page · raw message
Signature · 1 line
2.49.0
PATCH 8/8 scsi: qla2xxx: Remove unused module parameters
In reply to [email protected]From: "Dr. David Alan Gilbert" <[email protected]>
ql2xetsenable last use was removed in 2020 by
commit 37efd51f75f3 ("scsi: qla2xxx: Use FC generic update firmware options routine for ISP27xx")
ql2xiidmaenable last use was removed in 2017 by
commit 726b85487067 ("qla2xxx: Add framework for async fabric discovery")
Remove them.
--- drivers/scsi/qla2xxx/qla_gbl.h | 2 -- drivers/scsi/qla2xxx/qla_os.c | 12 ------------ 2 files changed, 14 deletions(-)
drivers/scsi/qla2xxx/qla_gbl.h +0 -2
@@ -164,10 +164,8 @@ extern int ql2xsmartsan;extern int ql2xallocfwdump;extern int ql2xextended_error_logging;extern int ql2xextended_error_logging_ktrace; -extern int ql2xiidmaenable;extern int ql2xmqsupport;extern int ql2xfwloadbin; -extern int ql2xetsenable;extern int ql2xshiftctondsd;extern int ql2xdbwr;extern int ql2xasynctmfenable;
drivers/scsi/qla2xxx/qla_os.c +0 -12
@@ -176,12 +176,6 @@ MODULE_PARM_DESC(ql2xenablehba_err_chk," 1 -- Error isolation enabled only for DIX Type 0\n" " 2 -- Error isolation enabled for all Types\n"); -int ql2xiidmaenable =1 ; -module_param (ql2xiidmaenable, int,S_IRUGO ); -MODULE_PARM_DESC (ql2xiidmaenable, -"Enables iIDMA settings " -"Default is 1 - perform iIDMA. 0 - no iIDMA." ); -int ql2xmqsupport =1 ;module_param (ql2xmqsupport, int,S_IRUGO ); MODULE_PARM_DESC(ql2xmqsupport,
@@ -199,12 +193,6 @@ MODULE_PARM_DESC(ql2xfwloadbin," 1 -- load firmware from flash.\n" " 0 -- use default semantics.\n"); -int ql2xetsenable; -module_param (ql2xetsenable, int,S_IRUGO ); -MODULE_PARM_DESC (ql2xetsenable, -"Enables firmware ETS burst." -"Default is 0 - skip ETS enablement." ); -int ql2xdbwr =1 ;module_param (ql2xdbwr, int,S_IRUGO |S_IWUSR ); MODULE_PARM_DESC(ql2xdbwr,
Signature · 1 line
2.49.0
Martin K. Petersen
AppliedQuoted 4 lines
This is a batch of deadcoding on the qla2xxx driver. Note the last
patch removes two unused module parameters, so I guess if anyone has that in some configs somewhere that might surprise them.
Applied to 6.16/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen
Martin K. Petersen
AppliedQuoted 8 lines · On Tue, 15 Apr 2025 01:27:55 +0100, [email protected] wrote:
This is a batch of deadcoding on the qla2xxx driver.
Note the last patch removes two unused module parameters, so I guess if anyone has that in some configs somewhere that might surprise them.Other than that, it's all simple function deletion.
[...]
Applied to 6.16/scsi-queue, thanks!
[1/8] scsi: qla2xxx: Remove unused qlt_free_qfull_cmds
https://git.kernel.org/mkp/scsi/c/ae7a08bee82b [2/8] scsi: qla2xxx: Remove unused qlt_fc_port_deleted https://git.kernel.org/mkp/scsi/c/cbb2a2ef5801 [3/8] scsi: qla2xxx: Remove unused qlt_83xx_iospace_config https://git.kernel.org/mkp/scsi/c/91453ebecccc [4/8] scsi: qla2xxx: Remove unused qla82xx_pci_region_offset https://git.kernel.org/mkp/scsi/c/89981b47f6fc [5/8] scsi: qla2xxx: Remove unused qla82xx_wait_for_state_change https://git.kernel.org/mkp/scsi/c/2a2f3168c510 [6/8] scsi: qla2xxx: Remove unused ql_log_qp https://git.kernel.org/mkp/scsi/c/33f44a50ca61 [7/8] scsi: qla2xxx: Remove unused qla2x00_gpsc https://git.kernel.org/mkp/scsi/c/45838d3db750 [8/8] scsi: qla2xxx: Remove unused module parameters https://git.kernel.org/mkp/scsi/c/3a37ab0827fd
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering