mtd/drivers/mtd/chips cfi_cmdset_0001.c,1.187,1.188

gleixner at infradead.org gleixner at infradead.org
Tue Dec 6 12:28:19 EST 2005


Update of /home/cvs/mtd/drivers/mtd/chips
In directory phoenix.infradead.org:/tmp/cvs-serv23308/drivers/mtd/chips

Modified Files:
	cfi_cmdset_0001.c 
Log Message:
[MTD] 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 at us.ibm.com>
Signed-off-by: Tom Gall <tom_gall at vnet.ibm.com>
----------------------------------------------------------------------


Index: cfi_cmdset_0001.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/cfi_cmdset_0001.c,v
retrieving revision 1.187
retrieving revision 1.188
diff -u -r1.187 -r1.188
--- cfi_cmdset_0001.c	29 Nov 2005 20:01:26 -0000	1.187
+++ cfi_cmdset_0001.c	6 Dec 2005 17:28:16 -0000	1.188
@@ -1692,6 +1692,11 @@
 			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;





More information about the linux-mtd-cvs mailing list