Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

-340
-53
drivers/scsi/qla2xxx/qla_dbg.c
··· 2706 2706 } 2707 2707 2708 2708 /* 2709 - * This function is for formatting and logging log messages. 2710 - * It is to be used when vha is available. It formats the message 2711 - * and logs it to the messages file. All the messages will be logged 2712 - * irrespective of value of ql2xextended_error_logging. 2713 - * parameters: 2714 - * level: The level of the log messages to be printed in the 2715 - * messages file. 2716 - * vha: Pointer to the scsi_qla_host_t 2717 - * id: This is a unique id for the level. It identifies the 2718 - * part of the code from where the message originated. 2719 - * msg: The message to be displayed. 2720 - */ 2721 - void 2722 - ql_log_qp(uint32_t level, struct qla_qpair *qpair, int32_t id, 2723 - const char *fmt, ...) 2724 - { 2725 - va_list va; 2726 - struct va_format vaf; 2727 - char pbuf[128]; 2728 - 2729 - if (level > ql_errlev) 2730 - return; 2731 - 2732 - ql_ktrace(0, level, pbuf, NULL, qpair ? qpair->vha : NULL, id, fmt); 2733 - 2734 - if (!pbuf[0]) /* set by ql_ktrace */ 2735 - ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), NULL, 2736 - qpair ? qpair->vha : NULL, id); 2737 - 2738 - va_start(va, fmt); 2739 - 2740 - vaf.fmt = fmt; 2741 - vaf.va = &va; 2742 - 2743 - switch (level) { 2744 - case ql_log_fatal: /* FATAL LOG */ 2745 - pr_crit("%s%pV", pbuf, &vaf); 2746 - break; 2747 - case ql_log_warn: 2748 - pr_err("%s%pV", pbuf, &vaf); 2749 - break; 2750 - case ql_log_info: 2751 - pr_warn("%s%pV", pbuf, &vaf); 2752 - break; 2753 - default: 2754 - pr_info("%s%pV", pbuf, &vaf); 2755 - break; 2756 - } 2757 - 2758 - va_end(va); 2759 - } 2760 - 2761 - /* 2762 2709 * This function is for formatting and logging debug information. 2763 2710 * It is to be used when vha is available. It formats the message 2764 2711 * and logs it to the messages file.
-3
drivers/scsi/qla2xxx/qla_dbg.h
··· 334 334 void __attribute__((format (printf, 4, 5))) 335 335 ql_log_pci(uint, struct pci_dev *pdev, uint, const char *fmt, ...); 336 336 337 - void __attribute__((format (printf, 4, 5))) 338 - ql_log_qp(uint32_t, struct qla_qpair *, int32_t, const char *fmt, ...); 339 - 340 337 /* Debug Levels */ 341 338 /* The 0x40000000 is the max value any debug level can have 342 339 * as ql2xextended_error_logging is of type signed int
-5
drivers/scsi/qla2xxx/qla_gbl.h
··· 164 164 extern int ql2xallocfwdump; 165 165 extern int ql2xextended_error_logging; 166 166 extern int ql2xextended_error_logging_ktrace; 167 - extern int ql2xiidmaenable; 168 167 extern int ql2xmqsupport; 169 168 extern int ql2xfwloadbin; 170 - extern int ql2xetsenable; 171 169 extern int ql2xshiftctondsd; 172 170 extern int ql2xdbwr; 173 171 extern int ql2xasynctmfenable; ··· 718 720 extern void *qla24xx_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t); 719 721 extern int qla2x00_fdmi_register(scsi_qla_host_t *); 720 722 extern int qla2x00_gfpn_id(scsi_qla_host_t *, sw_info_t *); 721 - extern int qla2x00_gpsc(scsi_qla_host_t *, sw_info_t *); 722 723 extern size_t qla2x00_get_sym_node_name(scsi_qla_host_t *, uint8_t *, size_t); 723 724 extern int qla2x00_chk_ms_status(scsi_qla_host_t *, ms_iocb_entry_t *, 724 725 struct ct_sns_rsp *, const char *); ··· 819 822 /* PCI related functions */ 820 823 extern int qla82xx_pci_config(struct scsi_qla_host *); 821 824 extern int qla82xx_pci_mem_read_2M(struct qla_hw_data *, u64, void *, int); 822 - extern int qla82xx_pci_region_offset(struct pci_dev *, int); 823 825 extern int qla82xx_iospace_config(struct qla_hw_data *); 824 826 825 827 /* Initialization related functions */ ··· 862 866 863 867 /* ISP 8021 IDC */ 864 868 extern void qla82xx_clear_drv_active(struct qla_hw_data *); 865 - extern uint32_t qla82xx_wait_for_state_change(scsi_qla_host_t *, uint32_t); 866 869 extern int qla82xx_idc_lock(struct qla_hw_data *); 867 870 extern void qla82xx_idc_unlock(struct qla_hw_data *); 868 871 extern int qla82xx_device_state_handler(scsi_qla_host_t *);
-90
drivers/scsi/qla2xxx/qla_gs.c
··· 2626 2626 } 2627 2627 2628 2628 /** 2629 - * qla2x00_gpsc() - FCS Get Port Speed Capabilities (GPSC) query. 2630 - * @vha: HA context 2631 - * @list: switch info entries to populate 2632 - * 2633 - * Returns 0 on success. 2634 - */ 2635 - int 2636 - qla2x00_gpsc(scsi_qla_host_t *vha, sw_info_t *list) 2637 - { 2638 - int rval; 2639 - uint16_t i; 2640 - struct qla_hw_data *ha = vha->hw; 2641 - ms_iocb_entry_t *ms_pkt; 2642 - struct ct_sns_req *ct_req; 2643 - struct ct_sns_rsp *ct_rsp; 2644 - struct ct_arg arg; 2645 - 2646 - if (!IS_IIDMA_CAPABLE(ha)) 2647 - return QLA_FUNCTION_FAILED; 2648 - if (!ha->flags.gpsc_supported) 2649 - return QLA_FUNCTION_FAILED; 2650 - 2651 - rval = qla2x00_mgmt_svr_login(vha); 2652 - if (rval) 2653 - return rval; 2654 - 2655 - arg.iocb = ha->ms_iocb; 2656 - arg.req_dma = ha->ct_sns_dma; 2657 - arg.rsp_dma = ha->ct_sns_dma; 2658 - arg.req_size = GPSC_REQ_SIZE; 2659 - arg.rsp_size = GPSC_RSP_SIZE; 2660 - arg.nport_handle = vha->mgmt_svr_loop_id; 2661 - 2662 - for (i = 0; i < ha->max_fibre_devices; i++) { 2663 - /* Issue GFPN_ID */ 2664 - /* Prepare common MS IOCB */ 2665 - ms_pkt = qla24xx_prep_ms_iocb(vha, &arg); 2666 - 2667 - /* Prepare CT request */ 2668 - ct_req = qla24xx_prep_ct_fm_req(ha->ct_sns, GPSC_CMD, 2669 - GPSC_RSP_SIZE); 2670 - ct_rsp = &ha->ct_sns->p.rsp; 2671 - 2672 - /* Prepare CT arguments -- port_name */ 2673 - memcpy(ct_req->req.gpsc.port_name, list[i].fabric_port_name, 2674 - WWN_SIZE); 2675 - 2676 - /* Execute MS IOCB */ 2677 - rval = qla2x00_issue_iocb(vha, ha->ms_iocb, ha->ms_iocb_dma, 2678 - sizeof(ms_iocb_entry_t)); 2679 - if (rval != QLA_SUCCESS) { 2680 - /*EMPTY*/ 2681 - ql_dbg(ql_dbg_disc, vha, 0x2059, 2682 - "GPSC issue IOCB failed (%d).\n", rval); 2683 - } else if ((rval = qla2x00_chk_ms_status(vha, ms_pkt, ct_rsp, 2684 - "GPSC")) != QLA_SUCCESS) { 2685 - /* FM command unsupported? */ 2686 - if (rval == QLA_INVALID_COMMAND && 2687 - (ct_rsp->header.reason_code == 2688 - CT_REASON_INVALID_COMMAND_CODE || 2689 - ct_rsp->header.reason_code == 2690 - CT_REASON_COMMAND_UNSUPPORTED)) { 2691 - ql_dbg(ql_dbg_disc, vha, 0x205a, 2692 - "GPSC command unsupported, disabling " 2693 - "query.\n"); 2694 - ha->flags.gpsc_supported = 0; 2695 - rval = QLA_FUNCTION_FAILED; 2696 - break; 2697 - } 2698 - rval = QLA_FUNCTION_FAILED; 2699 - } else { 2700 - list->fp_speed = qla2x00_port_speed_capability( 2701 - be16_to_cpu(ct_rsp->rsp.gpsc.speed)); 2702 - ql_dbg(ql_dbg_disc, vha, 0x205b, 2703 - "GPSC ext entry - fpn " 2704 - "%8phN speeds=%04x speed=%04x.\n", 2705 - list[i].fabric_port_name, 2706 - be16_to_cpu(ct_rsp->rsp.gpsc.speeds), 2707 - be16_to_cpu(ct_rsp->rsp.gpsc.speed)); 2708 - } 2709 - 2710 - /* Last device exit. */ 2711 - if (list[i].d_id.b.rsvd_1 != 0) 2712 - break; 2713 - } 2714 - 2715 - return (rval); 2716 - } 2717 - 2718 - /** 2719 2629 * qla2x00_gff_id() - SNS Get FC-4 Features (GFF_ID) query. 2720 2630 * 2721 2631 * @vha: HA context
-45
drivers/scsi/qla2xxx/qla_nx.c
··· 1595 1595 return (u8 *)&ha->hablob->fw->data[offset]; 1596 1596 } 1597 1597 1598 - /* PCI related functions */ 1599 - int qla82xx_pci_region_offset(struct pci_dev *pdev, int region) 1600 - { 1601 - unsigned long val = 0; 1602 - u32 control; 1603 - 1604 - switch (region) { 1605 - case 0: 1606 - val = 0; 1607 - break; 1608 - case 1: 1609 - pci_read_config_dword(pdev, QLA82XX_PCI_REG_MSIX_TBL, &control); 1610 - val = control + QLA82XX_MSIX_TBL_SPACE; 1611 - break; 1612 - } 1613 - return val; 1614 - } 1615 - 1616 - 1617 1598 int 1618 1599 qla82xx_iospace_config(struct qla_hw_data *ha) 1619 1600 { ··· 2913 2932 "HW State: DEV_QUIESCENT.\n"); 2914 2933 qla82xx_wr_32(ha, QLA82XX_CRB_DEV_STATE, QLA8XXX_DEV_QUIESCENT); 2915 2934 } 2916 - } 2917 - 2918 - /* 2919 - * qla82xx_wait_for_state_change 2920 - * Wait for device state to change from given current state 2921 - * 2922 - * Note: 2923 - * IDC lock must not be held upon entry 2924 - * 2925 - * Return: 2926 - * Changed device state. 2927 - */ 2928 - uint32_t 2929 - qla82xx_wait_for_state_change(scsi_qla_host_t *vha, uint32_t curr_state) 2930 - { 2931 - struct qla_hw_data *ha = vha->hw; 2932 - uint32_t dev_state; 2933 - 2934 - do { 2935 - msleep(1000); 2936 - qla82xx_idc_lock(ha); 2937 - dev_state = qla82xx_rd_32(ha, QLA82XX_CRB_DEV_STATE); 2938 - qla82xx_idc_unlock(ha); 2939 - } while (dev_state == curr_state); 2940 - 2941 - return dev_state; 2942 2935 } 2943 2936 2944 2937 void
-12
drivers/scsi/qla2xxx/qla_os.c
··· 176 176 " 1 -- Error isolation enabled only for DIX Type 0\n" 177 177 " 2 -- Error isolation enabled for all Types\n"); 178 178 179 - int ql2xiidmaenable = 1; 180 - module_param(ql2xiidmaenable, int, S_IRUGO); 181 - MODULE_PARM_DESC(ql2xiidmaenable, 182 - "Enables iIDMA settings " 183 - "Default is 1 - perform iIDMA. 0 - no iIDMA."); 184 - 185 179 int ql2xmqsupport = 1; 186 180 module_param(ql2xmqsupport, int, S_IRUGO); 187 181 MODULE_PARM_DESC(ql2xmqsupport, ··· 192 198 " interface.\n" 193 199 " 1 -- load firmware from flash.\n" 194 200 " 0 -- use default semantics.\n"); 195 - 196 - int ql2xetsenable; 197 - module_param(ql2xetsenable, int, S_IRUGO); 198 - MODULE_PARM_DESC(ql2xetsenable, 199 - "Enables firmware ETS burst." 200 - "Default is 0 - skip ETS enablement."); 201 201 202 202 int ql2xdbwr = 1; 203 203 module_param(ql2xdbwr, int, S_IRUGO|S_IWUSR);
-129
drivers/scsi/qla2xxx/qla_target.c
··· 1454 1454 return sess; 1455 1455 } 1456 1456 1457 - /* 1458 - * max_gen - specifies maximum session generation 1459 - * at which this deletion requestion is still valid 1460 - */ 1461 - void 1462 - qlt_fc_port_deleted(struct scsi_qla_host *vha, fc_port_t *fcport, int max_gen) 1463 - { 1464 - struct qla_tgt *tgt = vha->vha_tgt.qla_tgt; 1465 - struct fc_port *sess = fcport; 1466 - unsigned long flags; 1467 - 1468 - if (!vha->hw->tgt.tgt_ops) 1469 - return; 1470 - 1471 - if (!tgt) 1472 - return; 1473 - 1474 - spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); 1475 - if (tgt->tgt_stop) { 1476 - spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); 1477 - return; 1478 - } 1479 - if (!sess->se_sess) { 1480 - spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); 1481 - return; 1482 - } 1483 - 1484 - if (max_gen - sess->generation < 0) { 1485 - spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); 1486 - ql_dbg(ql_dbg_tgt_mgt, vha, 0xf092, 1487 - "Ignoring stale deletion request for se_sess %p / sess %p" 1488 - " for port %8phC, req_gen %d, sess_gen %d\n", 1489 - sess->se_sess, sess, sess->port_name, max_gen, 1490 - sess->generation); 1491 - return; 1492 - } 1493 - 1494 - ql_dbg(ql_dbg_tgt_mgt, vha, 0xf008, "qla_tgt_fc_port_deleted %p", sess); 1495 - 1496 - sess->local = 1; 1497 - spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); 1498 - qlt_schedule_sess_for_deletion(sess); 1499 - } 1500 - 1501 1457 static inline int test_tgt_sess_count(struct qla_tgt *tgt) 1502 1458 { 1503 1459 struct qla_hw_data *ha = tgt->ha; ··· 5495 5539 spin_unlock_irqrestore(&vha->hw->tgt.q_full_lock, flags); 5496 5540 } 5497 5541 5498 - int 5499 - qlt_free_qfull_cmds(struct qla_qpair *qpair) 5500 - { 5501 - struct scsi_qla_host *vha = qpair->vha; 5502 - struct qla_hw_data *ha = vha->hw; 5503 - unsigned long flags; 5504 - struct qla_tgt_cmd *cmd, *tcmd; 5505 - struct list_head free_list, q_full_list; 5506 - int rc = 0; 5507 - 5508 - if (list_empty(&ha->tgt.q_full_list)) 5509 - return 0; 5510 - 5511 - INIT_LIST_HEAD(&free_list); 5512 - INIT_LIST_HEAD(&q_full_list); 5513 - 5514 - spin_lock_irqsave(&vha->hw->tgt.q_full_lock, flags); 5515 - if (list_empty(&ha->tgt.q_full_list)) { 5516 - spin_unlock_irqrestore(&vha->hw->tgt.q_full_lock, flags); 5517 - return 0; 5518 - } 5519 - 5520 - list_splice_init(&vha->hw->tgt.q_full_list, &q_full_list); 5521 - spin_unlock_irqrestore(&vha->hw->tgt.q_full_lock, flags); 5522 - 5523 - spin_lock_irqsave(qpair->qp_lock_ptr, flags); 5524 - list_for_each_entry_safe(cmd, tcmd, &q_full_list, cmd_list) { 5525 - if (cmd->q_full) 5526 - /* cmd->state is a borrowed field to hold status */ 5527 - rc = __qlt_send_busy(qpair, &cmd->atio, cmd->state); 5528 - else if (cmd->term_exchg) 5529 - rc = __qlt_send_term_exchange(qpair, NULL, &cmd->atio); 5530 - 5531 - if (rc == -ENOMEM) 5532 - break; 5533 - 5534 - if (cmd->q_full) 5535 - ql_dbg(ql_dbg_io, vha, 0x3006, 5536 - "%s: busy sent for ox_id[%04x]\n", __func__, 5537 - be16_to_cpu(cmd->atio.u.isp24.fcp_hdr.ox_id)); 5538 - else if (cmd->term_exchg) 5539 - ql_dbg(ql_dbg_io, vha, 0x3007, 5540 - "%s: Term exchg sent for ox_id[%04x]\n", __func__, 5541 - be16_to_cpu(cmd->atio.u.isp24.fcp_hdr.ox_id)); 5542 - else 5543 - ql_dbg(ql_dbg_io, vha, 0x3008, 5544 - "%s: Unexpected cmd in QFull list %p\n", __func__, 5545 - cmd); 5546 - 5547 - list_move_tail(&cmd->cmd_list, &free_list); 5548 - 5549 - /* piggy back on hardware_lock for protection */ 5550 - vha->hw->tgt.num_qfull_cmds_alloc--; 5551 - } 5552 - spin_unlock_irqrestore(qpair->qp_lock_ptr, flags); 5553 - 5554 - cmd = NULL; 5555 - 5556 - list_for_each_entry_safe(cmd, tcmd, &free_list, cmd_list) { 5557 - list_del(&cmd->cmd_list); 5558 - /* This cmd was never sent to TCM. There is no need 5559 - * to schedule free or call free_cmd 5560 - */ 5561 - qlt_free_cmd(cmd); 5562 - } 5563 - 5564 - if (!list_empty(&q_full_list)) { 5565 - spin_lock_irqsave(&vha->hw->tgt.q_full_lock, flags); 5566 - list_splice(&q_full_list, &vha->hw->tgt.q_full_list); 5567 - spin_unlock_irqrestore(&vha->hw->tgt.q_full_lock, flags); 5568 - } 5569 - 5570 - return rc; 5571 - } 5572 - 5573 5542 static void 5574 5543 qlt_send_busy(struct qla_qpair *qpair, struct atio_from_isp *atio, 5575 5544 uint16_t status) ··· 6970 7089 icb->firmware_options_1 |= cpu_to_le32(BIT_14); 6971 7090 } 6972 7091 } 6973 - 6974 - void 6975 - qlt_83xx_iospace_config(struct qla_hw_data *ha) 6976 - { 6977 - if (!QLA_TGT_MODE_ENABLED()) 6978 - return; 6979 - 6980 - ha->msix_count += 1; /* For ATIO Q */ 6981 - } 6982 - 6983 7092 6984 7093 void 6985 7094 qlt_modify_vp_config(struct scsi_qla_host *vha,
-3
drivers/scsi/qla2xxx/qla_target.h
··· 1014 1014 extern void qlt_lport_deregister(struct scsi_qla_host *); 1015 1015 extern void qlt_unreg_sess(struct fc_port *); 1016 1016 extern void qlt_fc_port_added(struct scsi_qla_host *, fc_port_t *); 1017 - extern void qlt_fc_port_deleted(struct scsi_qla_host *, fc_port_t *, int); 1018 1017 extern int __init qlt_init(void); 1019 1018 extern void qlt_exit(void); 1020 1019 extern void qlt_free_session_done(struct work_struct *); ··· 1081 1082 extern int qlt_stop_phase1(struct qla_tgt *); 1082 1083 extern void qlt_stop_phase2(struct qla_tgt *); 1083 1084 extern irqreturn_t qla83xx_msix_atio_q(int, void *); 1084 - extern void qlt_83xx_iospace_config(struct qla_hw_data *); 1085 - extern int qlt_free_qfull_cmds(struct qla_qpair *); 1086 1085 extern void qlt_logo_completion_handler(fc_port_t *, int); 1087 1086 extern void qlt_do_generation_tick(struct scsi_qla_host *, int *); 1088 1087