mtd/drivers/mtd/nand nand.c,1.57,1.58

David Woodhouse dwmw2 at infradead.org
Fri Oct 17 08:56:23 EDT 2003


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

Modified Files:
	nand.c 
Log Message:
Sundry fixes. 

- Don't interrupt erases because it was just broken.
- Wait after issuing RESET.
- Don't whinge too often about reading without ECC.


Index: nand.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nand/nand.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- nand.c	15 Oct 2003 13:23:56 -0000	1.57
+++ nand.c	17 Oct 2003 12:56:20 -0000	1.58
@@ -310,6 +310,7 @@
 	case NAND_CMD_RESET:
 		if (this->dev_ready)	
 			break;
+		udelay(this->chip_delay);
 		this->hwcontrol(mtd, NAND_CTL_SETCLE);
 		this->write_byte(mtd, NAND_CMD_STATUS);
 		this->hwcontrol(mtd, NAND_CTL_CLRCLE);
@@ -354,7 +355,7 @@
 			spin_unlock_bh (&this->chip_lock);
 		return;
 	}
-
+#if 0 /* This was broken. And of dubious utility */
 	if (this->state == FL_ERASING) {
 		if (new_state != FL_ERASING) {
 			this->state = new_state;
@@ -364,7 +365,7 @@
 			return;
 		}
 	}
-
+#endif
 	set_current_state (TASK_UNINTERRUPTIBLE);
 	add_wait_queue (&this->wq, &wait);
 	spin_unlock_bh (&this->chip_lock);
@@ -666,7 +667,7 @@
 		switch (eccmode) {
 		case NAND_ECC_NONE: {	/* No ECC, Read in a page */
 			static unsigned long lastwhinge = 0;
-			if (lastwhinge != jiffies) {
+			if ((lastwhinge / HZ) != (jiffies / HZ)) {
 				printk (KERN_WARNING "Reading data from NAND FLASH without ECC is not recommended\n");
 				lastwhinge = jiffies;
 			}
@@ -1264,6 +1265,7 @@
 	/* The device is ready */
 	spin_lock_bh (&this->chip_lock);
 	this->state = FL_READY;
+	wake_up (&this->wq);
 	spin_unlock_bh (&this->chip_lock);
 
 	/* Return more or less happy */




More information about the linux-mtd-cvs mailing list