summaryrefslogtreecommitdiff
path: root/drivers/mtd/chips/cfi_cmdset_0001.c
diff options
context:
space:
mode:
authorJosh Boyer <jdub@us.ibm.com>2005-12-06 20:28:19 +0300
committerDavid Woodhouse <dwmw2@infradead.org>2006-05-17 04:11:17 +0400
commitdf54b52c411befdcf1d0989f939a49163570ad29 (patch)
treee51dbc7a88da164ed1ab6b29273ae01d2faf4025 /drivers/mtd/chips/cfi_cmdset_0001.c
parentba9627b85fcb5ed67285ca0711f0f4d1e965746e (diff)
downloadlinux-df54b52c411befdcf1d0989f939a49163570ad29.tar.xz
CHIPS: Fix potential starvation in cfi_cmdset_0001
The patch below fixes a potential starvation issue that can arise when there is contention on a chip during a period when a process is currently writing to it. The starvation is avoided by conditionally rescheduling when the chip is left in a state usable by other processes. Signed-off-by: Josh Boyer <jdub@us.ibm.com> Signed-off-by: Tom Gall <tom_gall@vnet.ibm.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/chips/cfi_cmdset_0001.c')
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0001.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index 898c321ab86d..e797752f7c0b 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -1691,6 +1691,11 @@ static int cfi_intelext_writev (struct mtd_info *mtd, const struct kvec *vecs,
if (chipnum == cfi->numchips)
return 0;
}
+
+ /* Be nice and reschedule with the chip in a usable state for other
+ processes. */
+ cond_resched();
+
} while (len);
return 0;