Commit 39c95826 authored by Vikas Chaudhary's avatar Vikas Chaudhary Committed by James Bottomley

[SCSI] qla4xxx: Update idc reg in case of PCI AER

Camram is reset by FW to default values after reboot/cold boot/pci reset.
In case of AER, PCI may need to reset so we need to set correct idc reg value
after PCIE error.
Signed-off-by: default avatarVikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 82761907
...@@ -256,6 +256,7 @@ void qla4_8xxx_get_minidump(struct scsi_qla_host *ha); ...@@ -256,6 +256,7 @@ void qla4_8xxx_get_minidump(struct scsi_qla_host *ha);
int qla4_8xxx_mbx_intr_disable(struct scsi_qla_host *ha); int qla4_8xxx_mbx_intr_disable(struct scsi_qla_host *ha);
int qla4_8xxx_mbx_intr_enable(struct scsi_qla_host *ha); int qla4_8xxx_mbx_intr_enable(struct scsi_qla_host *ha);
int qla4_8xxx_set_param(struct scsi_qla_host *ha, int param); int qla4_8xxx_set_param(struct scsi_qla_host *ha, int param);
int qla4_8xxx_update_idc_reg(struct scsi_qla_host *ha);
extern int ql4xextended_error_logging; extern int ql4xextended_error_logging;
extern int ql4xdontresethba; extern int ql4xdontresethba;
......
...@@ -2833,7 +2833,7 @@ static int qla4_83xx_set_idc_ver(struct scsi_qla_host *ha) ...@@ -2833,7 +2833,7 @@ static int qla4_83xx_set_idc_ver(struct scsi_qla_host *ha)
return rval; return rval;
} }
static int qla4_8xxx_update_idc_reg(struct scsi_qla_host *ha) int qla4_8xxx_update_idc_reg(struct scsi_qla_host *ha)
{ {
uint32_t drv_active; uint32_t drv_active;
int rval = QLA_SUCCESS; int rval = QLA_SUCCESS;
......
...@@ -6135,9 +6135,19 @@ static uint32_t qla4_8xxx_error_recovery(struct scsi_qla_host *ha) ...@@ -6135,9 +6135,19 @@ static uint32_t qla4_8xxx_error_recovery(struct scsi_qla_host *ha)
ha->isp_ops->idc_lock(ha); ha->isp_ops->idc_lock(ha);
qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DEV_STATE, qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DEV_STATE,
QLA8XXX_DEV_COLD); QLA8XXX_DEV_COLD);
qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DRV_IDC_VERSION,
QLA82XX_IDC_VERSION);
ha->isp_ops->idc_unlock(ha); ha->isp_ops->idc_unlock(ha);
rval = qla4_8xxx_update_idc_reg(ha);
if (rval == QLA_ERROR) {
ql4_printk(KERN_INFO, ha, "scsi%ld: %s: HW State: FAILED\n",
ha->host_no, __func__);
ha->isp_ops->idc_lock(ha);
qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DEV_STATE,
QLA8XXX_DEV_FAILED);
ha->isp_ops->idc_unlock(ha);
goto exit_error_recovery;
}
clear_bit(AF_FW_RECOVERY, &ha->flags); clear_bit(AF_FW_RECOVERY, &ha->flags);
rval = qla4xxx_initialize_adapter(ha, RESET_ADAPTER); rval = qla4xxx_initialize_adapter(ha, RESET_ADAPTER);
...@@ -6195,6 +6205,7 @@ static uint32_t qla4_8xxx_error_recovery(struct scsi_qla_host *ha) ...@@ -6195,6 +6205,7 @@ static uint32_t qla4_8xxx_error_recovery(struct scsi_qla_host *ha)
ha->isp_ops->idc_unlock(ha); ha->isp_ops->idc_unlock(ha);
} }
} }
exit_error_recovery:
clear_bit(DPC_RESET_ACTIVE, &ha->dpc_flags); clear_bit(DPC_RESET_ACTIVE, &ha->dpc_flags);
return rval; return rval;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment