All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shashi Rao <shashi@sun.com>
To: linux-mtd@lists.infradead.org, Shashi Rao <shashi@sun.com>
Subject: [PATCH] [MTD] fix fwh_lock locking
Date: Wed, 28 Mar 2007 15:56:28 -0700	[thread overview]
Message-ID: <460AF29C.4090409@sun.com> (raw)

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.

Thanks.

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

--- linux-2.6.20.3.orig/drivers/mtd/chips/fwh_lock.h
+++ linux-2.6.20.3/drivers/mtd/chips/fwh_lock.h
@@ -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);
 	spin_unlock(chip->mutex);
 	return 0;

                 reply	other threads:[~2007-03-28 22:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=460AF29C.4090409@sun.com \
    --to=shashi@sun.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.