diff options
author | Lalit Chandivade <lalit.chandivade@qlogic.com> | 2010-12-03 01:12:40 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-12-21 13:24:41 -0500 |
commit | 4cd83cbef878b5d0d4c65ac0a20d12a8bf9f551d (patch) | |
tree | 5a07babad1f5b59d78e2bd2afea1ad0ee4f1da60 /drivers/scsi/qla4xxx | |
parent | fe998527e3f1f5a6eeab5baa23ac2b60ae47e96b (diff) |
[SCSI] qla4xxx: Fail initialization if qla4_8xxx_pci_mem_write_2M fails
Since if fw load is failing, running on incomplete fw load would
be fatal.
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla4xxx')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_nx.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c index 2d95ef20d07d..18b0ad67a273 100644 --- a/drivers/scsi/qla4xxx/ql4_nx.c +++ b/drivers/scsi/qla4xxx/ql4_nx.c | |||
@@ -1127,14 +1127,14 @@ qla4_8xxx_pinit_from_rom(struct scsi_qla_host *ha, int verbose) | |||
1127 | static int | 1127 | static int |
1128 | qla4_8xxx_load_from_flash(struct scsi_qla_host *ha, uint32_t image_start) | 1128 | qla4_8xxx_load_from_flash(struct scsi_qla_host *ha, uint32_t image_start) |
1129 | { | 1129 | { |
1130 | int i; | 1130 | int i, rval = 0; |
1131 | long size = 0; | 1131 | long size = 0; |
1132 | long flashaddr, memaddr; | 1132 | long flashaddr, memaddr; |
1133 | u64 data; | 1133 | u64 data; |
1134 | u32 high, low; | 1134 | u32 high, low; |
1135 | 1135 | ||
1136 | flashaddr = memaddr = ha->hw.flt_region_bootload; | 1136 | flashaddr = memaddr = ha->hw.flt_region_bootload; |
1137 | size = (image_start - flashaddr)/8; | 1137 | size = (image_start - flashaddr) / 8; |
1138 | 1138 | ||
1139 | DEBUG2(printk("scsi%ld: %s: bootldr=0x%lx, fw_image=0x%x\n", | 1139 | DEBUG2(printk("scsi%ld: %s: bootldr=0x%lx, fw_image=0x%x\n", |
1140 | ha->host_no, __func__, flashaddr, image_start)); | 1140 | ha->host_no, __func__, flashaddr, image_start)); |
@@ -1143,14 +1143,18 @@ qla4_8xxx_load_from_flash(struct scsi_qla_host *ha, uint32_t image_start) | |||
1143 | if ((qla4_8xxx_rom_fast_read(ha, flashaddr, (int *)&low)) || | 1143 | if ((qla4_8xxx_rom_fast_read(ha, flashaddr, (int *)&low)) || |
1144 | (qla4_8xxx_rom_fast_read(ha, flashaddr + 4, | 1144 | (qla4_8xxx_rom_fast_read(ha, flashaddr + 4, |
1145 | (int *)&high))) { | 1145 | (int *)&high))) { |
1146 | return -1; | 1146 | rval = -1; |
1147 | goto exit_load_from_flash; | ||
1147 | } | 1148 | } |
1148 | data = ((u64)high << 32) | low ; | 1149 | data = ((u64)high << 32) | low ; |
1149 | qla4_8xxx_pci_mem_write_2M(ha, memaddr, &data, 8); | 1150 | rval = qla4_8xxx_pci_mem_write_2M(ha, memaddr, &data, 8); |
1151 | if (rval) | ||
1152 | goto exit_load_from_flash; | ||
1153 | |||
1150 | flashaddr += 8; | 1154 | flashaddr += 8; |
1151 | memaddr += 8; | 1155 | memaddr += 8; |
1152 | 1156 | ||
1153 | if (i%0x1000 == 0) | 1157 | if (i % 0x1000 == 0) |
1154 | msleep(1); | 1158 | msleep(1); |
1155 | 1159 | ||
1156 | } | 1160 | } |
@@ -1162,7 +1166,8 @@ qla4_8xxx_load_from_flash(struct scsi_qla_host *ha, uint32_t image_start) | |||
1162 | qla4_8xxx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0x80001e); | 1166 | qla4_8xxx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0x80001e); |
1163 | read_unlock(&ha->hw_lock); | 1167 | read_unlock(&ha->hw_lock); |
1164 | 1168 | ||
1165 | return 0; | 1169 | exit_load_from_flash: |
1170 | return rval; | ||
1166 | } | 1171 | } |
1167 | 1172 | ||
1168 | static int qla4_8xxx_load_fw(struct scsi_qla_host *ha, uint32_t image_start) | 1173 | static int qla4_8xxx_load_fw(struct scsi_qla_host *ha, uint32_t image_start) |