[PATCH] [MTD] fix fwh_lock locking

Shashi Rao shashi at sun.com
Wed Mar 28 18:56:28 EDT 2007

Hi all,

This is on a custom board with a mapping driver access to an ST
M50LPW080 chip. This chip is probed successfully with
do_map_probe("jedec_probe",...). If I use the mtdchar interface to
perform unlock->erase->program->lock on any of the 16 eraseblocks in the
chip, the chip is left in FL_STATUS mode while the data structures
believe that the chip is in FL_READY mode. Hence, any subsequent reads
to any flash byte results in 0x80 being read.


Signed-off-by: Shashi Rao <shashi at sun.com>

--- linux-
+++ linux-
@@ -65,11 +65,12 @@
 		return ret;

+	chip->oldstate = chip->state;
 	chip->state = xxlt->state;
 	map_write(map, CMD(xxlt->val), adr);

 	/* Done and happy. */
-	chip->state = FL_READY;
+	chip->state = chip->oldstate;
 	put_chip(map, chip, adr);
 	return 0;

More information about the linux-mtd mailing list