All of lore.kernel.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Philippe De Muyter <phdm@macqel.be>
Cc: Nicolas Pitre <nico@cam.org>, linux-mtd@lists.infradead.org
Subject: Re: [PATCH] mtd: Apply Numonyx Axcell P33/P30 workaround for Lock/Unlock bug.
Date: Thu, 21 Oct 2010 11:39:58 +0300	[thread overview]
Message-ID: <1287650398.2932.5.camel@localhost> (raw)
In-Reply-To: <1287498263-5561-1-git-send-email-phdm@macqel.be>

On Tue, 2010-10-19 at 16:24 +0200, Philippe De Muyter wrote:
> Some flash chips have a small but annoying bug, documented in
>     "Numonyx Axcell P33/P30 256-Mbit Specification Update"
> 
>     It states :
>     When customer uses [...] block unlock, the block lock status might
>     be altered inadvertently. Lock status might be set to either 01h
>     or 03h unexpectedly (00h as expected data), which leads to
>     program/erase failure on certain blocks.
> 
>     A workaround is given, (summary : issue a "Read Lock Status" before
>     the "Lock" or "Unlock" command) which I have applied and tested
>     with success.
> 
> Signed-off-by: Philippe De Muyter <phdm@macqel.be>

Is this Numonyx-specific issue? Should there be some kind of "if
(numonyx)" statement?

May be Nicolas could validate the patch?

> ---
>  drivers/mtd/chips/cfi_cmdset_0001.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
> index 9e2b7e9..0d0ae41 100644
> --- a/drivers/mtd/chips/cfi_cmdset_0001.c
> +++ b/drivers/mtd/chips/cfi_cmdset_0001.c
> @@ -2047,6 +2047,7 @@ static int __xipram do_xxlock_oneblock(struct map_info *map, struct flchip *chip
>  {
>  	struct cfi_private *cfi = map->fldrv_priv;
>  	struct cfi_pri_intelext *extp = cfi->cmdset_priv;
> +	int ofs_factor = cfi->interleave * cfi->device_type;
>  	int udelay;
>  	int ret;
>  
> @@ -2062,6 +2063,14 @@ static int __xipram do_xxlock_oneblock(struct map_info *map, struct flchip *chip
>  	ENABLE_VPP(map);
>  	xip_disable(map, chip, adr);
>  
> +	/*
> +	 * Issue a "Read Lock Status" before the "Lock" or "Unlock" :
> +	 * see errata "Numonyx Axcell P33/P30 Specification Update" :)
> +	 */
> +	map_write(map, CMD(0x90), adr+(2*ofs_factor));
> +	chip->state = FL_JEDEC_QUERY;
> +	cfi_read_query(map, adr+(2*ofs_factor));
> +
>  	map_write(map, CMD(0x60), adr);
>  	if (thunk == DO_XXLOCK_ONEBLOCK_LOCK) {
>  		map_write(map, CMD(0x01), adr);

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

  reply	other threads:[~2010-10-21  8:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-19 14:24 [PATCH] mtd: Apply Numonyx Axcell P33/P30 workaround for Lock/Unlock bug Philippe De Muyter
2010-10-21  8:39 ` Artem Bityutskiy [this message]
2010-10-21  9:33   ` Philippe De Muyter
2010-10-21 10:29     ` Artem Bityutskiy
2010-10-21 16:32       ` Nicolas Pitre
2010-10-21 19:34         ` Philippe De Muyter

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=1287650398.2932.5.camel@localhost \
    --to=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=nico@cam.org \
    --cc=phdm@macqel.be \
    /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.