From 18063500292cd4f8bb528db3ac5083fb5ef0bde1 Mon Sep 17 00:00:00 2001 From: Nilesh Javali Date: Thu, 23 Jul 2026 10:33:32 +0530 Subject: [PATCH] qla2x00t-32gbit: Extend execute_fw mailbox to include 29xx Add IS_QLA29XX() to the BPM capability macros and to the execute-firmware mailbox command so that NVMe enable, minimum speed negotiation, 128 Gbps speed reporting, EDIF hardware detection, and FW-semaphore retry logic all apply to 29xx adapters. Signed-off-by: Nilesh Javali Reviewed-by: Hannes Reinecke Link: https://patch.msgid.link/20260723050413.3897522-16-njavali@marvell.com Signed-off-by: Martin K. Petersen (Oracle) [ commit c1c1cf13c4a429f6e59c8768a229d3d039973588 upstream ] --- qla2x00t-32gbit/qla_attr.c | 12 ++++++++++-- qla2x00t-32gbit/qla_def.h | 5 +++-- qla2x00t-32gbit/qla_gs.c | 16 +++++++++++++--- qla2x00t-32gbit/qla_isr.c | 2 +- qla2x00t-32gbit/qla_mbx.c | 23 +++++++++++++---------- 5 files changed, 40 insertions(+), 18 deletions(-) diff --git a/qla2x00t-32gbit/qla_attr.c b/qla2x00t-32gbit/qla_attr.c index bcbffee8f..678aaebec 100644 --- a/qla2x00t-32gbit/qla_attr.c +++ b/qla2x00t-32gbit/qla_attr.c @@ -1875,10 +1875,11 @@ qla2x00_min_supported_speed_show(struct device *dev, scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); struct qla_hw_data *ha = vha->hw; - if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha)) + if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha) && !IS_QLA29XX(ha)) return scnprintf(buf, PAGE_SIZE, "\n"); return scnprintf(buf, PAGE_SIZE, "%s\n", + ha->min_supported_speed == 7 ? "128Gps" : ha->min_supported_speed == 6 ? "64Gps" : ha->min_supported_speed == 5 ? "32Gps" : ha->min_supported_speed == 4 ? "16Gps" : @@ -1894,10 +1895,11 @@ qla2x00_max_supported_speed_show(struct device *dev, scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); struct qla_hw_data *ha = vha->hw; - if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha)) + if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha) && !IS_QLA29XX(ha)) return scnprintf(buf, PAGE_SIZE, "\n"); return scnprintf(buf, PAGE_SIZE, "%s\n", + ha->max_supported_speed == 3 ? "128Gps" : ha->max_supported_speed == 2 ? "64Gps" : ha->max_supported_speed == 1 ? "32Gps" : ha->max_supported_speed == 0 ? "16Gps" : "unknown"); @@ -1978,6 +1980,7 @@ static const struct { { PORT_SPEED_16GB, "16" }, { PORT_SPEED_32GB, "32" }, { PORT_SPEED_64GB, "64" }, + { PORT_SPEED_128GB, "128" }, { PORT_SPEED_10GB, "10" }, }; @@ -2826,6 +2829,9 @@ qla2x00_get_host_speed(struct Scsi_Host *shost) case PORT_SPEED_64GB: speed = FC_PORTSPEED_64GBIT; break; + case PORT_SPEED_128GB: + speed = FC_PORTSPEED_128GBIT; + break; default: speed = FC_PORTSPEED_UNKNOWN; break; @@ -3591,6 +3597,8 @@ qla2x00_get_host_supported_speeds(scsi_qla_host_t *vha, uint speeds) { uint supported_speeds = FC_PORTSPEED_UNKNOWN; + if (speeds & FDMI_PORT_SPEED_128GB) + supported_speeds |= FC_PORTSPEED_128GBIT; if (speeds & FDMI_PORT_SPEED_64GB) supported_speeds |= FC_PORTSPEED_64GBIT; if (speeds & FDMI_PORT_SPEED_32GB) diff --git a/qla2x00t-32gbit/qla_def.h b/qla2x00t-32gbit/qla_def.h index 2c797f93f..bfb1fc515 100644 --- a/qla2x00t-32gbit/qla_def.h +++ b/qla2x00t-32gbit/qla_def.h @@ -4394,6 +4394,7 @@ struct qla_hw_data { #define PORT_SPEED_16GB 0x05 #define PORT_SPEED_32GB 0x06 #define PORT_SPEED_64GB 0x07 +#define PORT_SPEED_128GB 0x08 #define PORT_SPEED_10GB 0x13 uint16_t link_data_rate; /* F/W operating speed */ uint16_t set_data_rate; /* Set by user */ @@ -5645,9 +5646,9 @@ struct sff_8247_a0 { /* BPM -- Buffer Plus Management support. */ #define IS_BPM_CAPABLE(ha) \ (IS_QLA25XX(ha) || IS_QLA81XX(ha) || IS_QLA83XX(ha) || \ - IS_QLA27XX(ha) || IS_QLA28XX(ha)) + IS_QLA27XX(ha) || IS_QLA28XX(ha) || IS_QLA29XX(ha)) #define IS_BPM_RANGE_CAPABLE(ha) \ - (IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha)) + (IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha) || IS_QLA29XX(ha)) #define IS_BPM_ENABLED(vha) \ (ql2xautodetectsfp && !vha->vp_idx && IS_BPM_CAPABLE(vha->hw)) diff --git a/qla2x00t-32gbit/qla_gs.c b/qla2x00t-32gbit/qla_gs.c index 880cd73fe..514f04aa1 100644 --- a/qla2x00t-32gbit/qla_gs.c +++ b/qla2x00t-32gbit/qla_gs.c @@ -1508,12 +1508,18 @@ qla25xx_fdmi_port_speed_capability(struct qla_hw_data *ha) if (IS_CNA_CAPABLE(ha)) return FDMI_PORT_SPEED_10GB; - if (IS_QLA28XX(ha) || IS_QLA27XX(ha)) { - if (ha->max_supported_speed == 2) { + if (IS_QLA28XX(ha) || IS_QLA27XX(ha) || IS_QLA29XX(ha)) { + if (ha->max_supported_speed == 3) { + if (ha->min_supported_speed <= 7) + speeds |= FDMI_PORT_SPEED_128GB; + } + if (ha->max_supported_speed == 3 || + ha->max_supported_speed == 2) { if (ha->min_supported_speed <= 6) speeds |= FDMI_PORT_SPEED_64GB; } - if (ha->max_supported_speed == 2 || + if (ha->max_supported_speed == 3 || + ha->max_supported_speed == 2 || ha->max_supported_speed == 1) { if (ha->min_supported_speed <= 5) speeds |= FDMI_PORT_SPEED_32GB; @@ -1577,6 +1583,8 @@ qla25xx_fdmi_port_speed_currently(struct qla_hw_data *ha) return FDMI_PORT_SPEED_32GB; case PORT_SPEED_64GB: return FDMI_PORT_SPEED_64GB; + case PORT_SPEED_128GB: + return FDMI_PORT_SPEED_128GB; default: return FDMI_PORT_SPEED_UNKNOWN; } @@ -2620,6 +2628,8 @@ qla2x00_port_speed_capability(uint16_t speed) return PORT_SPEED_32GB; case BIT_7: return PORT_SPEED_64GB; + case BIT_6: + return PORT_SPEED_128GB; default: return PORT_SPEED_UNKNOWN; } diff --git a/qla2x00t-32gbit/qla_isr.c b/qla2x00t-32gbit/qla_isr.c index c49480b03..4384db2db 100644 --- a/qla2x00t-32gbit/qla_isr.c +++ b/qla2x00t-32gbit/qla_isr.c @@ -664,7 +664,7 @@ const char * qla2x00_get_link_speed_str(struct qla_hw_data *ha, uint16_t speed) { static const char *const link_speeds[] = { - "1", "2", "?", "4", "8", "16", "32", "64", "10" + "1", "2", "?", "4", "8", "16", "32", "64", "128", "10" }; #define QLA_LAST_SPEED (ARRAY_SIZE(link_speeds) - 1) diff --git a/qla2x00t-32gbit/qla_mbx.c b/qla2x00t-32gbit/qla_mbx.c index 0feb98b83..52d70b616 100644 --- a/qla2x00t-32gbit/qla_mbx.c +++ b/qla2x00t-32gbit/qla_mbx.c @@ -699,6 +699,7 @@ qla2x00_execute_fw(scsi_qla_host_t *vha, uint32_t risc_addr) { int rval; struct qla_hw_data *ha = vha->hw; + struct nvram_81xx *nv = ha->nvram; mbx_cmd_t mc; mbx_cmd_t *mcp = &mc; u8 semaphore = 0; @@ -727,14 +728,13 @@ again: ha->lr_distance << LR_DIST_FW_POS; } - if (ql2xnvmeenable && (IS_QLA27XX(ha) || IS_QLA28XX(ha))) + if (ql2xnvmeenable && (IS_QLA27XX(ha) || IS_QLA28XX(ha) || IS_QLA29XX(ha))) mcp->mb[4] |= NVME_ENABLE_FLAG; - if (IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha)) { - struct nvram_81xx *nv = ha->nvram; + if (IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha) || IS_QLA29XX(ha)) { /* set minimum speed if specified in nvram */ if (nv->min_supported_speed >= 2 && - nv->min_supported_speed <= 5) { + nv->min_supported_speed <= 7) { mcp->mb[4] |= BIT_4; mcp->mb[11] |= nv->min_supported_speed & 0xF; mcp->out_mb |= MBX_11; @@ -772,7 +772,7 @@ again: rval = qla2x00_mailbox_command(vha, mcp); if (rval != QLA_SUCCESS) { - if (IS_QLA28XX(ha) && rval == QLA_COMMAND_ERROR && + if ((IS_QLA28XX(ha) || IS_QLA29XX(ha)) && rval == QLA_COMMAND_ERROR && mcp->mb[1] == 0x27 && retry) { semaphore = 1; retry--; @@ -800,17 +800,20 @@ again: ql_dbg(ql_dbg_mbx, vha, 0x119a, "fw_ability_mask=%x.\n", ha->fw_ability_mask); ql_dbg(ql_dbg_mbx, vha, 0x1027, "exchanges=%x.\n", mcp->mb[1]); - if (IS_QLA27XX(ha) || IS_QLA28XX(ha)) { - ha->max_supported_speed = mcp->mb[2] & (BIT_0|BIT_1); + + if (IS_QLA27XX(ha) || IS_QLA28XX(ha) || IS_QLA29XX(ha)) { + ha->max_supported_speed = mcp->mb[2] & (BIT_0|BIT_1|BIT_2|BIT_3); ql_dbg(ql_dbg_mbx, vha, 0x119b, "max_supported_speed=%s.\n", ha->max_supported_speed == 0 ? "16Gps" : ha->max_supported_speed == 1 ? "32Gps" : - ha->max_supported_speed == 2 ? "64Gps" : "unknown"); + ha->max_supported_speed == 2 ? "64Gps" : + ha->max_supported_speed == 3 ? "128Gps" : "unknown"); if (vha->min_supported_speed) { ha->min_supported_speed = mcp->mb[5] & - (BIT_0 | BIT_1 | BIT_2); + (BIT_0 | BIT_1 | BIT_2 | BIT_3); ql_dbg(ql_dbg_mbx, vha, 0x119c, "min_supported_speed=%s.\n", + ha->min_supported_speed == 7 ? "128Gps" : ha->min_supported_speed == 6 ? "64Gps" : ha->min_supported_speed == 5 ? "32Gps" : ha->min_supported_speed == 4 ? "16Gps" : @@ -819,7 +822,7 @@ again: } } - if (IS_QLA28XX(ha) && (mcp->mb[5] & EDIF_HW_SUPPORT)) { + if ((IS_QLA28XX(ha) || IS_QLA29XX(ha)) && (mcp->mb[5] & EDIF_HW_SUPPORT)) { ha->flags.edif_hw = 1; ql_log(ql_log_info, vha, 0xffff, "%s: edif HW\n", __func__);