提交 ca9e9c3e 编写于 作者: A Andrew Vasquez 提交者: James Bottomley

[SCSI] qla2xxx: Check status of qla2x00_get_fw_version() call.

Unlike earlier ISPs, recent ISPs (ISP81xx) can in fact fail this
mailbox command.
Signed-off-by: NAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
上级 59e0b8b0
...@@ -148,7 +148,7 @@ qla2x00_dump_ram(scsi_qla_host_t *, dma_addr_t, uint32_t, uint32_t); ...@@ -148,7 +148,7 @@ qla2x00_dump_ram(scsi_qla_host_t *, dma_addr_t, uint32_t, uint32_t);
extern int extern int
qla2x00_execute_fw(scsi_qla_host_t *, uint32_t); qla2x00_execute_fw(scsi_qla_host_t *, uint32_t);
extern void extern int
qla2x00_get_fw_version(scsi_qla_host_t *, uint16_t *, uint16_t *, uint16_t *, qla2x00_get_fw_version(scsi_qla_host_t *, uint16_t *, uint16_t *, uint16_t *,
uint16_t *, uint32_t *, uint8_t *, uint32_t *, uint8_t *); uint16_t *, uint32_t *, uint8_t *, uint32_t *, uint8_t *);
......
...@@ -929,13 +929,16 @@ qla2x00_setup_chip(scsi_qla_host_t *vha) ...@@ -929,13 +929,16 @@ qla2x00_setup_chip(scsi_qla_host_t *vha)
/* Retrieve firmware information. */ /* Retrieve firmware information. */
if (rval == QLA_SUCCESS) { if (rval == QLA_SUCCESS) {
fw_major_version = ha->fw_major_version; fw_major_version = ha->fw_major_version;
qla2x00_get_fw_version(vha, rval = qla2x00_get_fw_version(vha,
&ha->fw_major_version, &ha->fw_major_version,
&ha->fw_minor_version, &ha->fw_minor_version,
&ha->fw_subminor_version, &ha->fw_subminor_version,
&ha->fw_attributes, &ha->fw_memory_size, &ha->fw_attributes, &ha->fw_memory_size,
ha->mpi_version, &ha->mpi_capabilities, ha->mpi_version, &ha->mpi_capabilities,
ha->phy_version); ha->phy_version);
if (rval != QLA_SUCCESS)
goto failed;
ha->flags.npiv_supported = 0; ha->flags.npiv_supported = 0;
if (IS_QLA2XXX_MIDTYPE(ha) && if (IS_QLA2XXX_MIDTYPE(ha) &&
(ha->fw_attributes & BIT_2)) { (ha->fw_attributes & BIT_2)) {
...@@ -987,7 +990,7 @@ qla2x00_setup_chip(scsi_qla_host_t *vha) ...@@ -987,7 +990,7 @@ qla2x00_setup_chip(scsi_qla_host_t *vha)
ha->fw_subminor_version); ha->fw_subminor_version);
} }
} }
failed:
if (rval) { if (rval) {
DEBUG2_3(printk("scsi(%ld): Setup chip **** FAILED ****.\n", DEBUG2_3(printk("scsi(%ld): Setup chip **** FAILED ****.\n",
vha->host_no)); vha->host_no));
......
...@@ -408,7 +408,7 @@ qla2x00_execute_fw(scsi_qla_host_t *vha, uint32_t risc_addr) ...@@ -408,7 +408,7 @@ qla2x00_execute_fw(scsi_qla_host_t *vha, uint32_t risc_addr)
* Context: * Context:
* Kernel context. * Kernel context.
*/ */
void int
qla2x00_get_fw_version(scsi_qla_host_t *vha, uint16_t *major, uint16_t *minor, qla2x00_get_fw_version(scsi_qla_host_t *vha, uint16_t *major, uint16_t *minor,
uint16_t *subminor, uint16_t *attributes, uint32_t *memory, uint8_t *mpi, uint16_t *subminor, uint16_t *attributes, uint32_t *memory, uint8_t *mpi,
uint32_t *mpi_caps, uint8_t *phy) uint32_t *mpi_caps, uint8_t *phy)
...@@ -427,6 +427,8 @@ qla2x00_get_fw_version(scsi_qla_host_t *vha, uint16_t *major, uint16_t *minor, ...@@ -427,6 +427,8 @@ qla2x00_get_fw_version(scsi_qla_host_t *vha, uint16_t *major, uint16_t *minor,
mcp->flags = 0; mcp->flags = 0;
mcp->tov = MBX_TOV_SECONDS; mcp->tov = MBX_TOV_SECONDS;
rval = qla2x00_mailbox_command(vha, mcp); rval = qla2x00_mailbox_command(vha, mcp);
if (rval != QLA_SUCCESS)
goto failed;
/* Return mailbox data. */ /* Return mailbox data. */
*major = mcp->mb[1]; *major = mcp->mb[1];
...@@ -446,7 +448,7 @@ qla2x00_get_fw_version(scsi_qla_host_t *vha, uint16_t *major, uint16_t *minor, ...@@ -446,7 +448,7 @@ qla2x00_get_fw_version(scsi_qla_host_t *vha, uint16_t *major, uint16_t *minor,
phy[1] = mcp->mb[9] >> 8; phy[1] = mcp->mb[9] >> 8;
phy[2] = mcp->mb[9] & 0xff; phy[2] = mcp->mb[9] & 0xff;
} }
failed:
if (rval != QLA_SUCCESS) { if (rval != QLA_SUCCESS) {
/*EMPTY*/ /*EMPTY*/
DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", __func__, DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", __func__,
...@@ -455,6 +457,7 @@ qla2x00_get_fw_version(scsi_qla_host_t *vha, uint16_t *major, uint16_t *minor, ...@@ -455,6 +457,7 @@ qla2x00_get_fw_version(scsi_qla_host_t *vha, uint16_t *major, uint16_t *minor,
/*EMPTY*/ /*EMPTY*/
DEBUG11(printk("%s(%ld): done.\n", __func__, vha->host_no)); DEBUG11(printk("%s(%ld): done.\n", __func__, vha->host_no));
} }
return rval;
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册