diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_nx.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_nx.c | 90 |
1 files changed, 36 insertions, 54 deletions
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c index 270ba3130fde..f0528539bbbc 100644 --- a/drivers/scsi/qla2xxx/qla_nx.c +++ b/drivers/scsi/qla2xxx/qla_nx.c | |||
@@ -908,27 +908,37 @@ qla82xx_wait_rom_done(struct qla_hw_data *ha) | |||
908 | return 0; | 908 | return 0; |
909 | } | 909 | } |
910 | 910 | ||
911 | int | ||
912 | qla82xx_md_rw_32(struct qla_hw_data *ha, uint32_t off, u32 data, uint8_t flag) | ||
913 | { | ||
914 | uint32_t off_value, rval = 0; | ||
915 | |||
916 | WRT_REG_DWORD((void *)(CRB_WINDOW_2M + ha->nx_pcibase), | ||
917 | (off & 0xFFFF0000)); | ||
918 | |||
919 | /* Read back value to make sure write has gone through */ | ||
920 | RD_REG_DWORD((void *)(CRB_WINDOW_2M + ha->nx_pcibase)); | ||
921 | off_value = (off & 0x0000FFFF); | ||
922 | |||
923 | if (flag) | ||
924 | WRT_REG_DWORD((void *) | ||
925 | (off_value + CRB_INDIRECT_2M + ha->nx_pcibase), | ||
926 | data); | ||
927 | else | ||
928 | rval = RD_REG_DWORD((void *) | ||
929 | (off_value + CRB_INDIRECT_2M + ha->nx_pcibase)); | ||
930 | |||
931 | return rval; | ||
932 | } | ||
933 | |||
911 | static int | 934 | static int |
912 | qla82xx_do_rom_fast_read(struct qla_hw_data *ha, int addr, int *valp) | 935 | qla82xx_do_rom_fast_read(struct qla_hw_data *ha, int addr, int *valp) |
913 | { | 936 | { |
914 | scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev); | 937 | /* Dword reads to flash. */ |
938 | qla82xx_md_rw_32(ha, MD_DIRECT_ROM_WINDOW, (addr & 0xFFFF0000), 1); | ||
939 | *valp = qla82xx_md_rw_32(ha, MD_DIRECT_ROM_READ_BASE + | ||
940 | (addr & 0x0000FFFF), 0, 0); | ||
915 | 941 | ||
916 | qla82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_ADDRESS, addr); | ||
917 | qla82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); | ||
918 | qla82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_ABYTE_CNT, 3); | ||
919 | qla82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_INSTR_OPCODE, 0xb); | ||
920 | qla82xx_wait_rom_busy(ha); | ||
921 | if (qla82xx_wait_rom_done(ha)) { | ||
922 | ql_log(ql_log_fatal, vha, 0x00ba, | ||
923 | "Error waiting for rom done.\n"); | ||
924 | return -1; | ||
925 | } | ||
926 | /* Reset abyte_cnt and dummy_byte_cnt */ | ||
927 | qla82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); | ||
928 | udelay(10); | ||
929 | cond_resched(); | ||
930 | qla82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_ABYTE_CNT, 0); | ||
931 | *valp = qla82xx_rd_32(ha, QLA82XX_ROMUSB_ROM_RDATA); | ||
932 | return 0; | 942 | return 0; |
933 | } | 943 | } |
934 | 944 | ||
@@ -2040,8 +2050,8 @@ qla82xx_intr_handler(int irq, void *dev_id) | |||
2040 | 2050 | ||
2041 | rsp = (struct rsp_que *) dev_id; | 2051 | rsp = (struct rsp_que *) dev_id; |
2042 | if (!rsp) { | 2052 | if (!rsp) { |
2043 | printk(KERN_INFO | 2053 | ql_log(ql_log_info, NULL, 0xb054, |
2044 | "%s(): NULL response queue pointer.\n", __func__); | 2054 | "%s: NULL response queue pointer.\n", __func__); |
2045 | return IRQ_NONE; | 2055 | return IRQ_NONE; |
2046 | } | 2056 | } |
2047 | ha = rsp->hw; | 2057 | ha = rsp->hw; |
@@ -3136,12 +3146,7 @@ qla82xx_check_md_needed(scsi_qla_host_t *vha) | |||
3136 | fw_minor_version = ha->fw_minor_version; | 3146 | fw_minor_version = ha->fw_minor_version; |
3137 | fw_subminor_version = ha->fw_subminor_version; | 3147 | fw_subminor_version = ha->fw_subminor_version; |
3138 | 3148 | ||
3139 | rval = qla2x00_get_fw_version(vha, &ha->fw_major_version, | 3149 | rval = qla2x00_get_fw_version(vha); |
3140 | &ha->fw_minor_version, &ha->fw_subminor_version, | ||
3141 | &ha->fw_attributes, &ha->fw_memory_size, | ||
3142 | ha->mpi_version, &ha->mpi_capabilities, | ||
3143 | ha->phy_version); | ||
3144 | |||
3145 | if (rval != QLA_SUCCESS) | 3150 | if (rval != QLA_SUCCESS) |
3146 | return rval; | 3151 | return rval; |
3147 | 3152 | ||
@@ -3150,7 +3155,6 @@ qla82xx_check_md_needed(scsi_qla_host_t *vha) | |||
3150 | if (fw_major_version != ha->fw_major_version || | 3155 | if (fw_major_version != ha->fw_major_version || |
3151 | fw_minor_version != ha->fw_minor_version || | 3156 | fw_minor_version != ha->fw_minor_version || |
3152 | fw_subminor_version != ha->fw_subminor_version) { | 3157 | fw_subminor_version != ha->fw_subminor_version) { |
3153 | |||
3154 | ql_log(ql_log_info, vha, 0xb02d, | 3158 | ql_log(ql_log_info, vha, 0xb02d, |
3155 | "Firmware version differs " | 3159 | "Firmware version differs " |
3156 | "Previous version: %d:%d:%d - " | 3160 | "Previous version: %d:%d:%d - " |
@@ -3614,7 +3618,7 @@ qla82xx_chip_reset_cleanup(scsi_qla_host_t *vha) | |||
3614 | for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) { | 3618 | for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) { |
3615 | sp = req->outstanding_cmds[cnt]; | 3619 | sp = req->outstanding_cmds[cnt]; |
3616 | if (sp) { | 3620 | if (sp) { |
3617 | if (!sp->ctx || | 3621 | if (!sp->u.scmd.ctx || |
3618 | (sp->flags & SRB_FCP_CMND_DMA_VALID)) { | 3622 | (sp->flags & SRB_FCP_CMND_DMA_VALID)) { |
3619 | spin_unlock_irqrestore( | 3623 | spin_unlock_irqrestore( |
3620 | &ha->hardware_lock, flags); | 3624 | &ha->hardware_lock, flags); |
@@ -3645,29 +3649,6 @@ qla82xx_chip_reset_cleanup(scsi_qla_host_t *vha) | |||
3645 | } | 3649 | } |
3646 | 3650 | ||
3647 | /* Minidump related functions */ | 3651 | /* Minidump related functions */ |
3648 | int | ||
3649 | qla82xx_md_rw_32(struct qla_hw_data *ha, uint32_t off, u32 data, uint8_t flag) | ||
3650 | { | ||
3651 | uint32_t off_value, rval = 0; | ||
3652 | |||
3653 | WRT_REG_DWORD((void *)(CRB_WINDOW_2M + ha->nx_pcibase), | ||
3654 | (off & 0xFFFF0000)); | ||
3655 | |||
3656 | /* Read back value to make sure write has gone through */ | ||
3657 | RD_REG_DWORD((void *)(CRB_WINDOW_2M + ha->nx_pcibase)); | ||
3658 | off_value = (off & 0x0000FFFF); | ||
3659 | |||
3660 | if (flag) | ||
3661 | WRT_REG_DWORD((void *) | ||
3662 | (off_value + CRB_INDIRECT_2M + ha->nx_pcibase), | ||
3663 | data); | ||
3664 | else | ||
3665 | rval = RD_REG_DWORD((void *) | ||
3666 | (off_value + CRB_INDIRECT_2M + ha->nx_pcibase)); | ||
3667 | |||
3668 | return rval; | ||
3669 | } | ||
3670 | |||
3671 | static int | 3652 | static int |
3672 | qla82xx_minidump_process_control(scsi_qla_host_t *vha, | 3653 | qla82xx_minidump_process_control(scsi_qla_host_t *vha, |
3673 | qla82xx_md_entry_hdr_t *entry_hdr, uint32_t **d_ptr) | 3654 | qla82xx_md_entry_hdr_t *entry_hdr, uint32_t **d_ptr) |
@@ -4117,8 +4098,9 @@ qla82xx_md_collect(scsi_qla_host_t *vha) | |||
4117 | data_ptr = (uint32_t *)ha->md_dump; | 4098 | data_ptr = (uint32_t *)ha->md_dump; |
4118 | 4099 | ||
4119 | if (ha->fw_dumped) { | 4100 | if (ha->fw_dumped) { |
4120 | ql_log(ql_log_info, vha, 0xb037, | 4101 | ql_log(ql_log_warn, vha, 0xb037, |
4121 | "Firmware dump available to retrive\n"); | 4102 | "Firmware has been previously dumped (%p) " |
4103 | "-- ignoring request.\n", ha->fw_dump); | ||
4122 | goto md_failed; | 4104 | goto md_failed; |
4123 | } | 4105 | } |
4124 | 4106 | ||
@@ -4161,7 +4143,7 @@ qla82xx_md_collect(scsi_qla_host_t *vha) | |||
4161 | 4143 | ||
4162 | total_data_size = ha->md_dump_size; | 4144 | total_data_size = ha->md_dump_size; |
4163 | 4145 | ||
4164 | ql_dbg(ql_log_info, vha, 0xb03d, | 4146 | ql_dbg(ql_dbg_p3p, vha, 0xb03d, |
4165 | "Total minidump data_size 0x%x to be captured\n", total_data_size); | 4147 | "Total minidump data_size 0x%x to be captured\n", total_data_size); |
4166 | 4148 | ||
4167 | /* Check whether template obtained is valid */ | 4149 | /* Check whether template obtained is valid */ |
@@ -4284,7 +4266,7 @@ skip_nxt_entry: | |||
4284 | } | 4266 | } |
4285 | 4267 | ||
4286 | if (data_collected != total_data_size) { | 4268 | if (data_collected != total_data_size) { |
4287 | ql_dbg(ql_log_warn, vha, 0xb043, | 4269 | ql_dbg(ql_dbg_p3p, vha, 0xb043, |
4288 | "MiniDump data mismatch: Data collected: [0x%x]," | 4270 | "MiniDump data mismatch: Data collected: [0x%x]," |
4289 | "total_data_size:[0x%x]\n", | 4271 | "total_data_size:[0x%x]\n", |
4290 | data_collected, total_data_size); | 4272 | data_collected, total_data_size); |