Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 116017
b: refs/heads/master
c: 8afbc11
h: refs/heads/master
i:
  116015: 5b237f7
v: v3
  • Loading branch information
Adrian Hunter authored and David Woodhouse committed Sep 16, 2008
1 parent 1ff3a88 commit eee658b
Show file tree
Hide file tree
Showing 2 changed files with 24 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: 34f6e15786293e8d6ed05f9c19ed784ff15d2702
refs/heads/master: 8afbc114542a6810b0a2e658abda6e911121cd22
26 changes: 23 additions & 3 deletions trunk/drivers/mtd/onenand/omap2.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,36 @@ static int omap2_onenand_wait(struct mtd_info *mtd, int state)
}
}
} else {
int retry_cnt = 0;

/* Turn interrupts off */
syscfg = read_reg(c, ONENAND_REG_SYS_CFG1);
syscfg &= ~ONENAND_SYS_CFG1_IOBE;
write_reg(c, syscfg, ONENAND_REG_SYS_CFG1);

timeout = jiffies + msecs_to_jiffies(20);
while (time_before(jiffies, timeout)) {
intr = read_reg(c, ONENAND_REG_INTERRUPT);
if (intr & ONENAND_INT_MASTER)
while (1) {
if (time_before(jiffies, timeout)) {
intr = read_reg(c, ONENAND_REG_INTERRUPT);
if (intr & ONENAND_INT_MASTER)
break;
} else {
/* Timeout after 20ms */
ctrl = read_reg(c, ONENAND_REG_CTRL_STATUS);
if (ctrl & ONENAND_CTRL_ONGO) {
/*
* The operation seems to be still going
* so give it some more time.
*/
retry_cnt += 1;
if (retry_cnt < 3) {
timeout = jiffies +
msecs_to_jiffies(20);
continue;
}
}
break;
}
}
}

Expand Down

0 comments on commit eee658b

Please sign in to comment.