]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mtd: nand: omap: fix race condition in omap_wait()
authorIvan Djelic <ivan.djelic@parrot.com>
Tue, 17 Apr 2012 11:11:53 +0000 (13:11 +0200)
committerArtem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
Fri, 27 Apr 2012 06:02:20 +0000 (09:02 +0300)
commit9e2be07c4899d8208e574fbfa0a037465773aa69
treed330b5d1af08e852f06eb075ff6c27179b58893b
parenta31c38104d6a83fcea52e58f5cb2dfcdd54ef902
mtd: nand: omap: fix race condition in omap_wait()

If a context switch occurs in function omap_wait() just before the
while loop is entered, then upon return from context switch the
timeout may already have elapsed: in that case, status is never
read from NAND device, and omap_wait() returns an error.
This failure has been experimentally observed during stress tests.

This patch ensures a NAND status read is always performed before
returning, as in the generic nand_wait() function.

Signed-off-by: Ivan Djelic <ivan.djelic@parrot.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
drivers/mtd/nand/omap2.c