mtd/drivers/mtd/chips cfi_cmdset_0001.c,1.135,1.136

Nicolas Pitre nico at infradead.org
Wed Jun 2 22:08:43 EDT 2004


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

Modified Files:
	cfi_cmdset_0001.c 
Log Message:
MTD infrastructure for cached access (only for Intel CFI flash right now)


Index: cfi_cmdset_0001.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/cfi_cmdset_0001.c,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -r1.135 -r1.136
--- cfi_cmdset_0001.c	25 Mar 2004 13:24:40 -0000	1.135
+++ cfi_cmdset_0001.c	3 Jun 2004 02:08:40 -0000	1.136
@@ -763,6 +763,7 @@
 	chip->state = FL_WRITING;
 
 	spin_unlock(chip->mutex);
+	INVALIDATE_CACHED_RANGE(map, adr, CFIDEV_BUSWIDTH);
 	cfi_udelay(chip->word_write_time);
 	spin_lock(chip->mutex);
 
@@ -1059,6 +1060,7 @@
 	chip->state = FL_WRITING;
 
 	spin_unlock(chip->mutex);
+	INVALIDATE_CACHED_RANGE(map, adr, len);
 	cfi_udelay(chip->buffer_write_time);
 	spin_lock(chip->mutex);
 
@@ -1312,6 +1314,8 @@
 	chip->erase_suspended = 0;
 
 	spin_unlock(chip->mutex);
+	/* unfortunately the erase block size isn't available here */
+	/*INVALIDATE_CACHED_RANGE(map, adr, mtd->erasesize);*/
 	set_current_state(TASK_UNINTERRUPTIBLE);
 	schedule_timeout((chip->erase_time*HZ)/(2*1000));
 	spin_lock(chip->mutex);
@@ -1425,6 +1429,9 @@
 	if (ret)
 		return ret;
 
+	/* ideally this should be handled down in do_erase_oneblock instead */
+	INVALIDATE_CACHED_RANGE(((struct map_info *)mtd->priv), ofs, len);
+
 	instr->state = MTD_ERASE_DONE;
 	if (instr->callback)
 		instr->callback(instr);





More information about the linux-mtd-cvs mailing list