]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: fix race in cfi_cmdset_0001 driver
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Mon, 7 Feb 2011 16:07:11 +0000 (17:07 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 11 Mar 2011 12:09:07 +0000 (12:09 +0000)
commitf920b3e3d0ed0536ddb95766c7b5365f5ab45a03
treeb45b4729fdd5e49f588629a3da968a4a90aa401f
parent6b2da04d32c93f98eb850758b57e3bd6b809ccee
mtd: fix race in cfi_cmdset_0001 driver

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 <Joakim.Tjernlund@transmode.se>
Acked-by: Michael Cashwell <mboards@prograde.net>
Acked-by: Stefan Bigler <stefan.bigler@keymile.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: stable@kernel.org
drivers/mtd/chips/cfi_cmdset_0001.c