From: Joakim Tjernlund Date: Mon, 7 Feb 2011 16:07:11 +0000 (+0100) Subject: mtd: fix race in cfi_cmdset_0001 driver X-Git-Tag: v2.6.37.5~81 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73b700aa0682ebfbe9be1ffd759ff457b1ae79d0;p=pandora-kernel.git mtd: fix race in cfi_cmdset_0001 driver commit ecf3fde07c8dcb92a1bf3fbdfe70905d85cd00e1 upstream. As inval_cache_and_wait_for_operation() drop and reclaim the lock to invalidate the cache, some other thread may suspend the operation before reaching the for(;;) loop. Therefore the loop must start with checking the chip->state before reading status from the chip. Signed-off-by: Joakim Tjernlund Acked-by: Michael Cashwell Acked-by: Stefan Bigler Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed