Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328918
b: refs/heads/master
c: 83dbdf6
h: refs/heads/master
v: v3
  • Loading branch information
Vikas Chaudhary authored and James Bottomley committed Sep 24, 2012
1 parent 7f2df68 commit c957a78
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ee996a691752ae55d26c1dd6de7421c1eb64cffb
refs/heads/master: 83dbdf6f5205832fd5b98d9324fad51927832879
42 changes: 33 additions & 9 deletions trunk/drivers/scsi/qla4xxx/ql4_nx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2337,10 +2337,6 @@ qla4_8xxx_device_bootstrap(struct scsi_qla_host *ha)
qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DEV_STATE,
QLA8XXX_DEV_INITIALIZING);

/* Driver that sets device state to initializating sets IDC version */
qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DRV_IDC_VERSION,
QLA82XX_IDC_VERSION);

ha->isp_ops->idc_unlock(ha);
if (ql4xenablemd && test_bit(AF_FW_RECOVERY, &ha->flags) &&
!test_and_set_bit(AF_82XX_FW_DUMPED, &ha->flags)) {
Expand Down Expand Up @@ -2463,6 +2459,38 @@ qla4_8xxx_need_qsnt_handler(struct scsi_qla_host *ha)
ha->isp_ops->idc_unlock(ha);
}

static void qla4_82xx_set_idc_ver(struct scsi_qla_host *ha)
{
int idc_ver;
uint32_t drv_active;

drv_active = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DRV_ACTIVE);
if (drv_active == (1 << (ha->func_num * 4))) {
qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DRV_IDC_VERSION,
QLA82XX_IDC_VERSION);
ql4_printk(KERN_INFO, ha,
"%s: IDC version updated to %d\n", __func__,
QLA82XX_IDC_VERSION);
} else {
idc_ver = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DRV_IDC_VERSION);
if (QLA82XX_IDC_VERSION != idc_ver) {
ql4_printk(KERN_INFO, ha,
"%s: qla4xxx driver IDC version %d is not compatible with IDC version %d of other drivers!\n",
__func__, QLA82XX_IDC_VERSION, idc_ver);
}
}
}

static void qla4_8xxx_update_idc_reg(struct scsi_qla_host *ha)
{
if (!test_bit(AF_INIT_DONE, &ha->flags)) {
ha->isp_ops->idc_lock(ha);
qla4_8xxx_set_drv_active(ha);
qla4_82xx_set_idc_ver(ha);
ha->isp_ops->idc_unlock(ha);
}
}

/**
* qla4_8xxx_device_state_handler - Adapter state machine
* @ha: pointer to host adapter structure.
Expand All @@ -2475,11 +2503,7 @@ int qla4_8xxx_device_state_handler(struct scsi_qla_host *ha)
int rval = QLA_SUCCESS;
unsigned long dev_init_timeout;

if (!test_bit(AF_INIT_DONE, &ha->flags)) {
ha->isp_ops->idc_lock(ha);
qla4_8xxx_set_drv_active(ha);
ha->isp_ops->idc_unlock(ha);
}
qla4_8xxx_update_idc_reg(ha);

dev_state = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DEV_STATE);
DEBUG2(ql4_printk(KERN_INFO, ha, "Device state is 0x%x = %s\n",
Expand Down

0 comments on commit c957a78

Please sign in to comment.