Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106445
b: refs/heads/master
c: 998453f
h: refs/heads/master
i:
  106443: a030c17
v: v3
  • Loading branch information
Alexey Korolev authored and David Woodhouse committed Jul 25, 2008
1 parent 6a99ecd commit e04b2ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 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: 55679df30dfa37886cd9e22d8dea0e6974a552df
refs/heads/master: 998453fbf2e0709bf65ac419718ad284401b2b4f
9 changes: 8 additions & 1 deletion trunk/drivers/mtd/chips/cfi_cmdset_0001.c
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ static int inval_cache_and_wait_for_operation(
struct cfi_private *cfi = map->fldrv_priv;
map_word status, status_OK = CMD(0x80);
int chip_state = chip->state;
unsigned int timeo, sleep_time;
unsigned int timeo, sleep_time, reset_timeo;

spin_unlock(chip->mutex);
if (inval_len)
Expand All @@ -1160,6 +1160,7 @@ static int inval_cache_and_wait_for_operation(
timeo = chip_op_time * 8;
if (!timeo)
timeo = 500000;
reset_timeo = timeo;
sleep_time = chip_op_time / 2;

for (;;) {
Expand Down Expand Up @@ -1201,6 +1202,12 @@ static int inval_cache_and_wait_for_operation(
remove_wait_queue(&chip->wq, &wait);
spin_lock(chip->mutex);
}
if (chip->erase_suspended || chip->write_suspended) {
/* Suspend has occured while sleep: reset timeout */
timeo = reset_timeo;
chip->erase_suspended = 0;
chip->write_suspended = 0;
}
}

/* Done and happy. */
Expand Down

0 comments on commit e04b2ff

Please sign in to comment.