From e04b2ff7163efd911d00467c2284e069ec79beae Mon Sep 17 00:00:00 2001 From: Alexey Korolev Date: Wed, 16 Jul 2008 15:28:56 +0100 Subject: [PATCH] --- yaml --- r: 106445 b: refs/heads/master c: 998453fbf2e0709bf65ac419718ad284401b2b4f h: refs/heads/master i: 106443: a030c17811bde91a45c2a04d44a5da2df0a01d97 v: v3 --- [refs] | 2 +- trunk/drivers/mtd/chips/cfi_cmdset_0001.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index ee528f22cb29..548c46e01a44 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 55679df30dfa37886cd9e22d8dea0e6974a552df +refs/heads/master: 998453fbf2e0709bf65ac419718ad284401b2b4f diff --git a/trunk/drivers/mtd/chips/cfi_cmdset_0001.c b/trunk/drivers/mtd/chips/cfi_cmdset_0001.c index 324ff82a3cd9..5f1b472137a0 100644 --- a/trunk/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/trunk/drivers/mtd/chips/cfi_cmdset_0001.c @@ -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) @@ -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 (;;) { @@ -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. */