Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204055
b: refs/heads/master
c: 2c4c8c8
h: refs/heads/master
i:
  204053: f3ce5d8
  204051: cb597b8
  204047: 695ea04
v: v3
  • Loading branch information
Stephen M. Cameron authored and James Bottomley committed Jul 27, 2010
1 parent 9a322be commit 41b21cc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 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: 3a7774ceb89f02f78e269b5c900096b066b66c3c
refs/heads/master: 2c4c8c8b662286230a798c60408d217aeab55f7f
29 changes: 17 additions & 12 deletions trunk/drivers/scsi/hpsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -3302,9 +3302,23 @@ static int __devinit hpsa_pci_find_memory_BAR(struct ctlr_info *h,
return -ENODEV;
}

static int __devinit hpsa_wait_for_board_ready(struct ctlr_info *h)
{
int i;
u32 scratchpad;

for (i = 0; i < HPSA_BOARD_READY_ITERATIONS; i++) {
scratchpad = readl(h->vaddr + SA5_SCRATCHPAD_OFFSET);
if (scratchpad == HPSA_FIRMWARE_READY)
return 0;
msleep(HPSA_BOARD_READY_POLL_INTERVAL_MSECS);
}
dev_warn(&h->pdev->dev, "board not ready, timed out.\n");
return -ENODEV;
}

static int __devinit hpsa_pci_init(struct ctlr_info *h)
{
u32 scratchpad = 0;
u64 cfg_offset;
u32 cfg_base_addr;
u64 cfg_base_addr_index;
Expand Down Expand Up @@ -3339,18 +3353,9 @@ static int __devinit hpsa_pci_init(struct ctlr_info *h)
goto err_out_free_res;
h->vaddr = remap_pci_mem(h->paddr, 0x250);

/* Wait for the board to become ready. */
for (i = 0; i < HPSA_BOARD_READY_ITERATIONS; i++) {
scratchpad = readl(h->vaddr + SA5_SCRATCHPAD_OFFSET);
if (scratchpad == HPSA_FIRMWARE_READY)
break;
msleep(HPSA_BOARD_READY_POLL_INTERVAL_MSECS);
}
if (scratchpad != HPSA_FIRMWARE_READY) {
dev_warn(&h->pdev->dev, "board not ready, timed out.\n");
err = -ENODEV;
err = hpsa_wait_for_board_ready(h);
if (err)
goto err_out_free_res;
}

/* get the address index number */
cfg_base_addr = readl(h->vaddr + SA5_CTCFG_OFFSET);
Expand Down

0 comments on commit 41b21cc

Please sign in to comment.