Browse Source

cfi-cmdset-0001: always update the chip status

... otherwise xip_enable() won't do the right thing.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Nicolas Pitre 19 years ago
parent
commit
6e7a6809c5
1 changed files with 3 additions and 1 deletions
  1. 3 1
      drivers/mtd/chips/cfi_cmdset_0001.c

+ 3 - 1
drivers/mtd/chips/cfi_cmdset_0001.c

@@ -1479,8 +1479,10 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
 	   [...], the device will not accept any more Write to Buffer commands".
 	   [...], the device will not accept any more Write to Buffer commands".
 	   So we must check here and reset those bits if they're set. Otherwise
 	   So we must check here and reset those bits if they're set. Otherwise
 	   we're just pissing in the wind */
 	   we're just pissing in the wind */
-	if (chip->state != FL_STATUS)
+	if (chip->state != FL_STATUS) {
 		map_write(map, CMD(0x70), cmd_adr);
 		map_write(map, CMD(0x70), cmd_adr);
+		chip->state = FL_STATUS;
+	}
 	status = map_read(map, cmd_adr);
 	status = map_read(map, cmd_adr);
 	if (map_word_bitsset(map, status, CMD(0x30))) {
 	if (map_word_bitsset(map, status, CMD(0x30))) {
 		xip_enable(map, chip, cmd_adr);
 		xip_enable(map, chip, cmd_adr);