Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4cd83cbe authored by Lalit Chandivade's avatar Lalit Chandivade Committed by James Bottomley
Browse files

[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: default avatarVikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: default avatarLalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: default avatarRavi Anand <ravi.anand@qlogic.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent fe998527
Loading
Loading
Loading
Loading
+11 −6
Original line number Original line Diff line number Diff line
@@ -1127,7 +1127,7 @@ qla4_8xxx_pinit_from_rom(struct scsi_qla_host *ha, int verbose)
static int
static int
qla4_8xxx_load_from_flash(struct scsi_qla_host *ha, uint32_t image_start)
qla4_8xxx_load_from_flash(struct scsi_qla_host *ha, uint32_t image_start)
{
{
	int  i;
	int  i, rval = 0;
	long size = 0;
	long size = 0;
	long flashaddr, memaddr;
	long flashaddr, memaddr;
	u64 data;
	u64 data;
@@ -1143,10 +1143,14 @@ qla4_8xxx_load_from_flash(struct scsi_qla_host *ha, uint32_t image_start)
		if ((qla4_8xxx_rom_fast_read(ha, flashaddr, (int *)&low)) ||
		if ((qla4_8xxx_rom_fast_read(ha, flashaddr, (int *)&low)) ||
		    (qla4_8xxx_rom_fast_read(ha, flashaddr + 4,
		    (qla4_8xxx_rom_fast_read(ha, flashaddr + 4,
		    (int *)&high))) {
		    (int *)&high))) {
			return -1;
			rval = -1;
			goto exit_load_from_flash;
		}
		}
		data = ((u64)high << 32) | low ;
		data = ((u64)high << 32) | low ;
		qla4_8xxx_pci_mem_write_2M(ha, memaddr, &data, 8);
		rval = qla4_8xxx_pci_mem_write_2M(ha, memaddr, &data, 8);
		if (rval)
			goto exit_load_from_flash;

		flashaddr += 8;
		flashaddr += 8;
		memaddr   += 8;
		memaddr   += 8;


@@ -1162,7 +1166,8 @@ qla4_8xxx_load_from_flash(struct scsi_qla_host *ha, uint32_t image_start)
	qla4_8xxx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0x80001e);
	qla4_8xxx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0x80001e);
	read_unlock(&ha->hw_lock);
	read_unlock(&ha->hw_lock);


	return 0;
exit_load_from_flash:
	return rval;
}
}


static int qla4_8xxx_load_fw(struct scsi_qla_host *ha, uint32_t image_start)
static int qla4_8xxx_load_fw(struct scsi_qla_host *ha, uint32_t image_start)