From a27dd7151dee8aa11d1519ff1f5a8cbdcaa26953 Mon Sep 17 00:00:00 2001 From: Nilesh Javali Date: Thu, 23 Jul 2026 10:33:30 +0530 Subject: [PATCH] scsi: qla2xxx: Skip unsupported sysfs attributes for 29xx Not all sysfs attributes are applicable to the 29xx adapter. Return -EPERM for attributes that are meaningless on 29xx (gold firmware version, 84xx firmware version, flash block size, VLAN ID, VN-port MAC address, and CNA firmware dump toggle) so that userspace tools do not see stale or undefined values. Signed-off-by: Nilesh Javali Reviewed-by: Hannes Reinecke Link: https://patch.msgid.link/20260723050413.3897522-14-njavali@marvell.com Signed-off-by: Martin K. Petersen (Oracle) --- drivers/scsi/qla2xxx/qla_attr.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 800751ab562a..e8755ab86b6a 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -1471,6 +1471,9 @@ qla2x00_optrom_gold_fw_version_show(struct device *dev, scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); struct qla_hw_data *ha = vha->hw; + if (IS_QLA29XX(ha)) + return -EPERM; + if (!IS_QLA81XX(ha) && !IS_QLA83XX(ha) && !IS_QLA27XX(ha) && !IS_QLA28XX(ha)) return scnprintf(buf, PAGE_SIZE, "\n"); @@ -1499,6 +1502,9 @@ qla24xx_84xx_fw_version_show(struct device *dev, scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); struct qla_hw_data *ha = vha->hw; + if (IS_QLA29XX(ha)) + return -EPERM; + if (!IS_QLA84XX(ha)) return scnprintf(buf, PAGE_SIZE, "\n"); @@ -1565,6 +1571,9 @@ qla2x00_flash_block_size_show(struct device *dev, scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); struct qla_hw_data *ha = vha->hw; + if (IS_QLA29XX(ha)) + return -EPERM; + return scnprintf(buf, PAGE_SIZE, "0x%x\n", ha->fdt_block_size); } @@ -1573,6 +1582,10 @@ qla2x00_vlan_id_show(struct device *dev, struct device_attribute *attr, char *buf) { scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); + struct qla_hw_data *ha = vha->hw; + + if (IS_QLA29XX(ha)) + return -EPERM; if (!IS_CNA_CAPABLE(vha->hw)) return scnprintf(buf, PAGE_SIZE, "\n"); @@ -1585,6 +1598,10 @@ qla2x00_vn_port_mac_address_show(struct device *dev, struct device_attribute *attr, char *buf) { scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); + struct qla_hw_data *ha = vha->hw; + + if (IS_QLA29XX(ha)) + return -EPERM; if (!IS_CNA_CAPABLE(vha->hw)) return scnprintf(buf, PAGE_SIZE, "\n"); @@ -1716,6 +1733,10 @@ qla2x00_allow_cna_fw_dump_show(struct device *dev, struct device_attribute *attr, char *buf) { scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); + struct qla_hw_data *ha = vha->hw; + + if (IS_QLA29XX(ha)) + return -EPERM; if (!IS_P3P_TYPE(vha->hw)) return scnprintf(buf, PAGE_SIZE, "\n");