From: Joakim Tjernlund Date: Tue, 28 Nov 2006 23:11:52 +0000 (+0000) Subject: [PATCH] Fix Intel/Sharp command set erase suspend bug X-Git-Tag: v2.6.19~13 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=967bf623e9f5eecfb056b1ba7e0efd74a21c9c3a;p=linux-2.6-omap-h63xx.git [PATCH] Fix Intel/Sharp command set erase suspend bug When we sleep and wait for a suspended operation to be resumed, go back and check until it's ready -- don't just continue after the first time we're woken. This can cause file system corruption. Signed-off-by: Joakim Tjernlund Signed-off-by: David Woodhouse Signed-off-by: Linus Torvalds --- diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index 7ea49a0d5ec..296159ec518 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c @@ -1087,7 +1087,7 @@ static int inval_cache_and_wait_for_operation( } spin_lock(chip->mutex); - if (chip->state != chip_state) { + while (chip->state != chip_state) { /* Someone's suspended the operation: sleep */ DECLARE_WAITQUEUE(wait, current); set_current_state(TASK_UNINTERRUPTIBLE);