mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 04:21:03 -04:00
Merge patch series "scsi: qla2xxx deadcoding"
linux@treblig.org says: 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. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Link: https://lore.kernel.org/r/20250415002803.135909-1-linux@treblig.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
@@ -720,7 +718,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 *);
|
||||
@@ -822,7 +819,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 */
|
||||
@@ -866,7 +862,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 *);
|
||||
|
||||
@@ -2625,96 +2625,6 @@ qla2x00_port_speed_capability(uint16_t speed)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* qla2x00_gpsc() - FCS Get Port Speed Capabilities (GPSC) query.
|
||||
* @vha: HA context
|
||||
* @list: switch info entries to populate
|
||||
*
|
||||
* Returns 0 on success.
|
||||
*/
|
||||
int
|
||||
qla2x00_gpsc(scsi_qla_host_t *vha, sw_info_t *list)
|
||||
{
|
||||
int rval;
|
||||
uint16_t i;
|
||||
struct qla_hw_data *ha = vha->hw;
|
||||
ms_iocb_entry_t *ms_pkt;
|
||||
struct ct_sns_req *ct_req;
|
||||
struct ct_sns_rsp *ct_rsp;
|
||||
struct ct_arg arg;
|
||||
|
||||
if (!IS_IIDMA_CAPABLE(ha))
|
||||
return QLA_FUNCTION_FAILED;
|
||||
if (!ha->flags.gpsc_supported)
|
||||
return QLA_FUNCTION_FAILED;
|
||||
|
||||
rval = qla2x00_mgmt_svr_login(vha);
|
||||
if (rval)
|
||||
return rval;
|
||||
|
||||
arg.iocb = ha->ms_iocb;
|
||||
arg.req_dma = ha->ct_sns_dma;
|
||||
arg.rsp_dma = ha->ct_sns_dma;
|
||||
arg.req_size = GPSC_REQ_SIZE;
|
||||
arg.rsp_size = GPSC_RSP_SIZE;
|
||||
arg.nport_handle = vha->mgmt_svr_loop_id;
|
||||
|
||||
for (i = 0; i < ha->max_fibre_devices; i++) {
|
||||
/* Issue GFPN_ID */
|
||||
/* Prepare common MS IOCB */
|
||||
ms_pkt = qla24xx_prep_ms_iocb(vha, &arg);
|
||||
|
||||
/* Prepare CT request */
|
||||
ct_req = qla24xx_prep_ct_fm_req(ha->ct_sns, GPSC_CMD,
|
||||
GPSC_RSP_SIZE);
|
||||
ct_rsp = &ha->ct_sns->p.rsp;
|
||||
|
||||
/* Prepare CT arguments -- port_name */
|
||||
memcpy(ct_req->req.gpsc.port_name, list[i].fabric_port_name,
|
||||
WWN_SIZE);
|
||||
|
||||
/* Execute MS IOCB */
|
||||
rval = qla2x00_issue_iocb(vha, ha->ms_iocb, ha->ms_iocb_dma,
|
||||
sizeof(ms_iocb_entry_t));
|
||||
if (rval != QLA_SUCCESS) {
|
||||
/*EMPTY*/
|
||||
ql_dbg(ql_dbg_disc, vha, 0x2059,
|
||||
"GPSC issue IOCB failed (%d).\n", rval);
|
||||
} else if ((rval = qla2x00_chk_ms_status(vha, ms_pkt, ct_rsp,
|
||||
"GPSC")) != QLA_SUCCESS) {
|
||||
/* FM command unsupported? */
|
||||
if (rval == QLA_INVALID_COMMAND &&
|
||||
(ct_rsp->header.reason_code ==
|
||||
CT_REASON_INVALID_COMMAND_CODE ||
|
||||
ct_rsp->header.reason_code ==
|
||||
CT_REASON_COMMAND_UNSUPPORTED)) {
|
||||
ql_dbg(ql_dbg_disc, vha, 0x205a,
|
||||
"GPSC command unsupported, disabling "
|
||||
"query.\n");
|
||||
ha->flags.gpsc_supported = 0;
|
||||
rval = QLA_FUNCTION_FAILED;
|
||||
break;
|
||||
}
|
||||
rval = QLA_FUNCTION_FAILED;
|
||||
} else {
|
||||
list->fp_speed = qla2x00_port_speed_capability(
|
||||
be16_to_cpu(ct_rsp->rsp.gpsc.speed));
|
||||
ql_dbg(ql_dbg_disc, vha, 0x205b,
|
||||
"GPSC ext entry - fpn "
|
||||
"%8phN speeds=%04x speed=%04x.\n",
|
||||
list[i].fabric_port_name,
|
||||
be16_to_cpu(ct_rsp->rsp.gpsc.speeds),
|
||||
be16_to_cpu(ct_rsp->rsp.gpsc.speed));
|
||||
}
|
||||
|
||||
/* Last device exit. */
|
||||
if (list[i].d_id.b.rsvd_1 != 0)
|
||||
break;
|
||||
}
|
||||
|
||||
return (rval);
|
||||
}
|
||||
|
||||
/**
|
||||
* qla2x00_gff_id() - SNS Get FC-4 Features (GFF_ID) query.
|
||||
*
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
@@ -2934,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)
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
@@ -5539,81 +5495,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)
|
||||
@@ -7090,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)
|
||||
|
||||
@@ -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 *);
|
||||
@@ -1082,8 +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 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 *);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user