Skip to content

Commit

Permalink
[MTD] Fix fwh_lock locking
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
  • Loading branch information
Shashi Rao authored and dwmw2 committed Apr 17, 2007
1 parent c2aecda commit e6be133
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/mtd/chips/fwh_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ static int fwh_xxlock_oneblock(struct map_info *map, struct flchip *chip,
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);
spin_unlock(chip->mutex);
return 0;
Expand Down

0 comments on commit e6be133

Please sign in to comment.