diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2009-06-03 12:55:20 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-06-08 15:46:46 -0400 |
commit | ca9e9c3eb118d0cb9dc2e5232f6f2dcaa4b7a5e0 (patch) | |
tree | b022eac4bf1820af0e82671e53f33143e65bc285 /drivers/scsi/qla2xxx | |
parent | 59e0b8b088031b3b751f0608f797f2581f49a827 (diff) |
[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: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_gbl.h | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 7 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 7 |
3 files changed, 11 insertions, 5 deletions
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index fbf99726e551..1ef18cce0c55 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h | |||
@@ -148,7 +148,7 @@ qla2x00_dump_ram(scsi_qla_host_t *, dma_addr_t, uint32_t, uint32_t); | |||
148 | extern int | 148 | extern int |
149 | qla2x00_execute_fw(scsi_qla_host_t *, uint32_t); | 149 | qla2x00_execute_fw(scsi_qla_host_t *, uint32_t); |
150 | 150 | ||
151 | extern void | 151 | extern int |
152 | qla2x00_get_fw_version(scsi_qla_host_t *, uint16_t *, uint16_t *, uint16_t *, | 152 | qla2x00_get_fw_version(scsi_qla_host_t *, uint16_t *, uint16_t *, uint16_t *, |
153 | uint16_t *, uint32_t *, uint8_t *, uint32_t *, uint8_t *); | 153 | uint16_t *, uint32_t *, uint8_t *, uint32_t *, uint8_t *); |
154 | 154 | ||
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 34e6508bbab0..415fbf60de11 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -929,13 +929,16 @@ qla2x00_setup_chip(scsi_qla_host_t *vha) | |||
929 | /* Retrieve firmware information. */ | 929 | /* Retrieve firmware information. */ |
930 | if (rval == QLA_SUCCESS) { | 930 | if (rval == QLA_SUCCESS) { |
931 | fw_major_version = ha->fw_major_version; | 931 | fw_major_version = ha->fw_major_version; |
932 | qla2x00_get_fw_version(vha, | 932 | rval = qla2x00_get_fw_version(vha, |
933 | &ha->fw_major_version, | 933 | &ha->fw_major_version, |
934 | &ha->fw_minor_version, | 934 | &ha->fw_minor_version, |
935 | &ha->fw_subminor_version, | 935 | &ha->fw_subminor_version, |
936 | &ha->fw_attributes, &ha->fw_memory_size, | 936 | &ha->fw_attributes, &ha->fw_memory_size, |
937 | ha->mpi_version, &ha->mpi_capabilities, | 937 | ha->mpi_version, &ha->mpi_capabilities, |
938 | ha->phy_version); | 938 | ha->phy_version); |
939 | if (rval != QLA_SUCCESS) | ||
940 | goto failed; | ||
941 | |||
939 | ha->flags.npiv_supported = 0; | 942 | ha->flags.npiv_supported = 0; |
940 | if (IS_QLA2XXX_MIDTYPE(ha) && | 943 | if (IS_QLA2XXX_MIDTYPE(ha) && |
941 | (ha->fw_attributes & BIT_2)) { | 944 | (ha->fw_attributes & BIT_2)) { |
@@ -987,7 +990,7 @@ qla2x00_setup_chip(scsi_qla_host_t *vha) | |||
987 | ha->fw_subminor_version); | 990 | ha->fw_subminor_version); |
988 | } | 991 | } |
989 | } | 992 | } |
990 | 993 | failed: | |
991 | if (rval) { | 994 | if (rval) { |
992 | DEBUG2_3(printk("scsi(%ld): Setup chip **** FAILED ****.\n", | 995 | DEBUG2_3(printk("scsi(%ld): Setup chip **** FAILED ****.\n", |
993 | vha->host_no)); | 996 | vha->host_no)); |
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index e0fee484f79c..b32eb69974a3 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -408,7 +408,7 @@ qla2x00_execute_fw(scsi_qla_host_t *vha, uint32_t risc_addr) | |||
408 | * Context: | 408 | * Context: |
409 | * Kernel context. | 409 | * Kernel context. |
410 | */ | 410 | */ |
411 | void | 411 | int |
412 | qla2x00_get_fw_version(scsi_qla_host_t *vha, uint16_t *major, uint16_t *minor, | 412 | qla2x00_get_fw_version(scsi_qla_host_t *vha, uint16_t *major, uint16_t *minor, |
413 | uint16_t *subminor, uint16_t *attributes, uint32_t *memory, uint8_t *mpi, | 413 | uint16_t *subminor, uint16_t *attributes, uint32_t *memory, uint8_t *mpi, |
414 | uint32_t *mpi_caps, uint8_t *phy) | 414 | 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 | mcp->flags = 0; | 427 | mcp->flags = 0; |
428 | mcp->tov = MBX_TOV_SECONDS; | 428 | mcp->tov = MBX_TOV_SECONDS; |
429 | rval = qla2x00_mailbox_command(vha, mcp); | 429 | rval = qla2x00_mailbox_command(vha, mcp); |
430 | if (rval != QLA_SUCCESS) | ||
431 | goto failed; | ||
430 | 432 | ||
431 | /* Return mailbox data. */ | 433 | /* Return mailbox data. */ |
432 | *major = mcp->mb[1]; | 434 | *major = mcp->mb[1]; |
@@ -446,7 +448,7 @@ qla2x00_get_fw_version(scsi_qla_host_t *vha, uint16_t *major, uint16_t *minor, | |||
446 | phy[1] = mcp->mb[9] >> 8; | 448 | phy[1] = mcp->mb[9] >> 8; |
447 | phy[2] = mcp->mb[9] & 0xff; | 449 | phy[2] = mcp->mb[9] & 0xff; |
448 | } | 450 | } |
449 | 451 | failed: | |
450 | if (rval != QLA_SUCCESS) { | 452 | if (rval != QLA_SUCCESS) { |
451 | /*EMPTY*/ | 453 | /*EMPTY*/ |
452 | DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", __func__, | 454 | 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 | /*EMPTY*/ | 457 | /*EMPTY*/ |
456 | DEBUG11(printk("%s(%ld): done.\n", __func__, vha->host_no)); | 458 | DEBUG11(printk("%s(%ld): done.\n", __func__, vha->host_no)); |
457 | } | 459 | } |
460 | return rval; | ||
458 | } | 461 | } |
459 | 462 | ||
460 | /* | 463 | /* |