Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231673
b: refs/heads/master
c: d19d7b4
h: refs/heads/master
i:
  231671: 06ec336
v: v3
  • Loading branch information
Roman Tereshonkov authored and David Woodhouse committed Dec 3, 2010
1 parent e8ff6ff commit c20757e
Show file tree
Hide file tree
Showing 2 changed files with 10 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: 3e3198f1adda8e0fbd499bde806781237d6c841f
refs/heads/master: d19d7b46d2b4936be14cfeef779ffeb76cf7b757
12 changes: 9 additions & 3 deletions trunk/drivers/mtd/onenand/omap2.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ static void wait_warn(char *msg, int state, unsigned int ctrl,
static int omap2_onenand_wait(struct mtd_info *mtd, int state)
{
struct omap2_onenand *c = container_of(mtd, struct omap2_onenand, mtd);
struct onenand_chip *this = mtd->priv;
unsigned int intr = 0;
unsigned int ctrl;
unsigned int ctrl, ctrl_mask;
unsigned long timeout;
u32 syscfg;

Expand Down Expand Up @@ -180,7 +181,8 @@ static int omap2_onenand_wait(struct mtd_info *mtd, int state)
if (result == 0) {
/* Timeout after 20ms */
ctrl = read_reg(c, ONENAND_REG_CTRL_STATUS);
if (ctrl & ONENAND_CTRL_ONGO) {
if (ctrl & ONENAND_CTRL_ONGO &&
!this->ongoing) {
/*
* The operation seems to be still going
* so give it some more time.
Expand Down Expand Up @@ -269,7 +271,11 @@ static int omap2_onenand_wait(struct mtd_info *mtd, int state)
return -EIO;
}

if (ctrl & 0xFE9F)
ctrl_mask = 0xFE9F;
if (this->ongoing)
ctrl_mask &= ~0x8000;

if (ctrl & ctrl_mask)
wait_warn("unexpected controller status", state, ctrl, intr);

return 0;
Expand Down

0 comments on commit c20757e

Please sign in to comment.