mtd/drivers/mtd/chips cfi_cmdset_0001.c,1.99,1.100

Joakim Tjernlund jocke at infradead.org
Fri Jun 21 09:58:12 EDT 2002


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

Modified Files:
	cfi_cmdset_0001.c 
Log Message:
Fixed the kupdate CPU hog.


Index: cfi_cmdset_0001.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/cfi_cmdset_0001.c,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -r1.99 -r1.100
--- cfi_cmdset_0001.c	19 Jun 2002 09:19:57 -0000	1.99
+++ cfi_cmdset_0001.c	21 Jun 2002 13:58:09 -0000	1.100
@@ -170,9 +170,9 @@
 	}
 
 	for (i=0; i< cfi->numchips; i++) {
-		cfi->chips[i].word_write_time = 128;
-		cfi->chips[i].buffer_write_time = 128;
-		cfi->chips[i].erase_time = 1024;
+		cfi->chips[i].word_write_time = 1<<cfi->cfiq->WordWriteTimeoutTyp;
+		cfi->chips[i].buffer_write_time = 1<<cfi->cfiq->BufWriteTimeoutTyp;
+		cfi->chips[i].erase_time = 1<<cfi->cfiq->BlockEraseTimeoutTyp;
 	}		
 
 	map->fldrv = &cfi_intelext_chipdrv;
@@ -1227,7 +1227,8 @@
 	chip->oldstate = 0;
 
 	spin_unlock_bh(chip->mutex);
-	schedule_timeout(HZ);
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout((chip->erase_time*HZ)/(2*1000));
 	spin_lock_bh(chip->mutex);
 
 	/* FIXME. Use a timer to check this, and return immediately. */
@@ -1272,7 +1273,8 @@
 		
 		/* Latency issues. Drop the lock, wait a while and retry */
 		spin_unlock_bh(chip->mutex);
-		cfi_udelay(1);
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(1);
 		spin_lock_bh(chip->mutex);
 	}
 	





More information about the linux-mtd-cvs mailing list