public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] [MTD] [CHIPS] cfi_cmdset_0001.c: put chip into read-array mode after unlocking
@ 2009-07-14 13:35 Mike Frysinger
  2009-07-14 13:56 ` Wolfram Sang
  2011-04-16  3:13 ` Mike Frysinger
  0 siblings, 2 replies; 6+ messages in thread
From: Mike Frysinger @ 2009-07-14 13:35 UTC (permalink / raw)
  To: linux-mtd; +Cc: Graf Yang

From: Graf Yang <graf.yang@analog.com>

We should try and keep the flash in the default read-array mode when
possible so that we are much more likely to properly recover from
unexpected reboot events (such as watchdog expiring).  If we only unlock
the flash, it can stay in that state for a while, so put it into
read-array mode after successful unlocking.

URL: http://blackfin.uclinux.org/gf/tracker/4887
Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/mtd/chips/cfi_cmdset_0001.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index c240454..d96cc99 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -2056,6 +2056,11 @@ static int __xipram do_xxlock_oneblock(struct map_info *map, struct flchip *chip
 		goto out;
 	}
 
+	if (chip->state == FL_STATUS) {
+		/* it goes ok, put chip into array mode */
+		map_write(map, CMD(0xff), adr);
+		chip->state = FL_READY;
+	}
 	xip_enable(map, chip, adr);
 out:	put_chip(map, chip, adr);
 	spin_unlock(chip->mutex);
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-04-16  3:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-14 13:35 [PATCH] [MTD] [CHIPS] cfi_cmdset_0001.c: put chip into read-array mode after unlocking Mike Frysinger
2009-07-14 13:56 ` Wolfram Sang
2009-07-14 14:14   ` Mike Frysinger
2009-07-14 14:32     ` Wolfram Sang
2009-07-14 14:37       ` Mike Frysinger
2011-04-16  3:13 ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox