Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213341
b: refs/heads/master
c: e6a4202
h: refs/heads/master
i:
  213339: 2b1c104
v: v3
  • Loading branch information
Shyam Sundar authored and James Bottomley committed Sep 17, 2010
1 parent 1abfcb2 commit 1506952
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 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: 6de76cfc7db8844bc26ab9a60b20f50ad7851833
refs/heads/master: e6a4202aa920a25db76f0e02dabe133179293ec0
39 changes: 36 additions & 3 deletions trunk/drivers/scsi/qla2xxx/qla_nx.c
Original file line number Diff line number Diff line change
Expand Up @@ -3152,6 +3152,20 @@ qla82xx_start_iocbs(srb_t *sp)
}
}

void qla82xx_rom_lock_recovery(struct qla_hw_data *ha)
{
if (qla82xx_rom_lock(ha))
/* Someone else is holding the lock. */
qla_printk(KERN_INFO, ha, "Resetting rom_lock\n");

/*
* Either we got the lock, or someone
* else died while holding it.
* In either case, unlock.
*/
qla82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM2_UNLOCK));
}

/*
* qla82xx_device_bootstrap
* Initialize device, set DEV_READY, start fw
Expand All @@ -3166,12 +3180,13 @@ qla82xx_start_iocbs(srb_t *sp)
static int
qla82xx_device_bootstrap(scsi_qla_host_t *vha)
{
int rval, i, timeout;
int rval = QLA_SUCCESS;
int i, timeout;
uint32_t old_count, count;
struct qla_hw_data *ha = vha->hw;
int need_reset = 0, peg_stuck = 1;

if (qla82xx_need_reset(ha))
goto dev_initialize;
need_reset = qla82xx_need_reset(ha);

old_count = qla82xx_rd_32(ha, QLA82XX_PEG_ALIVE_COUNTER);

Expand All @@ -3185,9 +3200,27 @@ qla82xx_device_bootstrap(scsi_qla_host_t *vha)

count = qla82xx_rd_32(ha, QLA82XX_PEG_ALIVE_COUNTER);
if (count != old_count)
peg_stuck = 0;
}

if (need_reset) {
/* We are trying to perform a recovery here. */
if (peg_stuck)
qla82xx_rom_lock_recovery(ha);
goto dev_initialize;
} else {
/* Start of day for this ha context. */
if (peg_stuck) {
/* Either we are the first or recovery in progress. */
qla82xx_rom_lock_recovery(ha);
goto dev_initialize;
} else
/* Firmware already running. */
goto dev_ready;
}

return rval;

dev_initialize:
/* set to DEV_INITIALIZING */
qla_printk(KERN_INFO, ha, "HW State: INITIALIZING\n");
Expand Down

0 comments on commit 1506952

Please sign in to comment.