Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42488
b: refs/heads/master
c: 76fbf96
h: refs/heads/master
v: v3
  • Loading branch information
Ed Lin authored and James Bottomley committed Dec 5, 2006
1 parent a33aea1 commit f08a7a0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 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: 94e9108b5ad8da9c02ebf5183b861f1717409555
refs/heads/master: 76fbf96f82636c8cdc40485506c50c880fd45a56
41 changes: 20 additions & 21 deletions trunk/drivers/scsi/stex.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ enum {
MU_STATE_STARTED = 4,
MU_STATE_RESETTING = 5,

MU_MAX_DELAY_TIME = 240000,
MU_MAX_DELAY = 120,
MU_HANDSHAKE_SIGNATURE = 0x55aaaa55,
MU_HANDSHAKE_SIGNATURE_HALF = 0x5a5a0000,
MU_HARD_RESET_WAIT = 30000,
HMU_PARTNER_TYPE = 2,

/* firmware returned values */
Expand Down Expand Up @@ -910,23 +911,22 @@ static int stex_handshake(struct st_hba *hba)
struct handshake_frame *h;
dma_addr_t status_phys;
u32 data;
int i;
unsigned long before;

if (readl(base + OMR0) != MU_HANDSHAKE_SIGNATURE) {
writel(MU_INBOUND_DOORBELL_HANDSHAKE, base + IDBL);
readl(base + IDBL);
for (i = 0; readl(base + OMR0) != MU_HANDSHAKE_SIGNATURE
&& i < MU_MAX_DELAY_TIME; i++) {
before = jiffies;
while (readl(base + OMR0) != MU_HANDSHAKE_SIGNATURE) {
if (time_after(jiffies, before + MU_MAX_DELAY * HZ)) {
printk(KERN_ERR DRV_NAME
"(%s): no handshake signature\n",
pci_name(hba->pdev));
return -1;
}
rmb();
msleep(1);
}

if (i == MU_MAX_DELAY_TIME) {
printk(KERN_ERR DRV_NAME
"(%s): no handshake signature\n",
pci_name(hba->pdev));
return -1;
}
}

udelay(10);
Expand Down Expand Up @@ -965,19 +965,18 @@ static int stex_handshake(struct st_hba *hba)
readl(base + IDBL); /* flush */

udelay(10);
for (i = 0; readl(base + OMR0) != MU_HANDSHAKE_SIGNATURE
&& i < MU_MAX_DELAY_TIME; i++) {
before = jiffies;
while (readl(base + OMR0) != MU_HANDSHAKE_SIGNATURE) {
if (time_after(jiffies, before + MU_MAX_DELAY * HZ)) {
printk(KERN_ERR DRV_NAME
"(%s): no signature after handshake frame\n",
pci_name(hba->pdev));
return -1;
}
rmb();
msleep(1);
}

if (i == MU_MAX_DELAY_TIME) {
printk(KERN_ERR DRV_NAME
"(%s): no signature after handshake frame\n",
pci_name(hba->pdev));
return -1;
}

writel(0, base + IMR0);
readl(base + IMR0);
writel(0, base + OMR0);
Expand Down Expand Up @@ -1059,7 +1058,7 @@ static void stex_hard_reset(struct st_hba *hba)
pci_bctl &= ~PCI_BRIDGE_CTL_BUS_RESET;
pci_write_config_byte(bus->self, PCI_BRIDGE_CONTROL, pci_bctl);

for (i = 0; i < MU_MAX_DELAY_TIME; i++) {
for (i = 0; i < MU_HARD_RESET_WAIT; i++) {
pci_read_config_word(hba->pdev, PCI_COMMAND, &pci_cmd);
if (pci_cmd != 0xffff && (pci_cmd & PCI_COMMAND_MASTER))
break;
Expand Down

0 comments on commit f08a7a0

Please sign in to comment.