All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Dunn <mikedunn@newsguy.com>
To: Josh Wu <josh.wu@atmel.com>
Cc: plagnioj@jcrosoft.com, nicolas.ferre@atmel.com,
	linux-arm-kernel@lists.infradead.org,
	linux-mtd@lists.infradead.org, dedekind1@gmail.com
Subject: Re: [PATCH v2] MTD: at91: atmel_nand: return bit flips for the PMECC read_page()
Date: Thu, 29 Nov 2012 09:20:57 -0800	[thread overview]
Message-ID: <50B79979.1090406@newsguy.com> (raw)
In-Reply-To: <50B71292.4020604@atmel.com>

On 11/28/2012 11:45 PM, Josh Wu wrote:
> Hi, Mike
> 
> On 11/28/2012 3:35 AM, Mike Dunn wrote:
>>
>> BTW, with such a wide range for ecc strength - up to 24 bits, according to the
>> commit message for the pmecc patch - you may want to think about setting an
>> appropriate bitflip_threshold in the driver.  I'm not a nand expert, and I don't
>> know much about the atmel_nand specifically, but I would think that if 23 bits
>> are corrected on a page of size 2k (or less), maybe a return code of -EUCLEAN
>> from mtd_read() might be appropriate.
> 
> After checking the nand_base.c, I saw it will set the mtd.bitflip_threshold to
> mtd->ecc.strength during nand_scan_tail().
> in the atmel_nand code, the ecc strength will be set correctly, that means
> bitflip_threashold should be set up correctly by default.
> so I think I don't need set up the the bitflip_threshold anymore if I set ecc
> strength correctly. Am I missing any point here?


No, you are correct; bitflip_threshold is set to ecc.strength by default if the
driver has not assigned it a value already.  I just wondered if the default
value is too liberal given the possibility of such high ecc strength in your
case.  With bitflip_threshold == 24 (default for the greatest possible
ecc.strength on atmel_nand with pmecc) mtd_read() will not return -EUCLEAN until
24 bitflips are corrected on a page that is no greater than 2k in size, and may
be as small as 512 bytes (if I read the code correctly).

The -EUCLEAN return code is used by higher layers as an indication that a block
may be going bad.  I don't know whether or not a block bears scrutiny when 23
bitflips are corrected on a page.  I guess it depends on the particular flash
device.  It was just a thought.

Hope this makes sense.
Mike

WARNING: multiple messages have this Message-ID (diff)
From: mikedunn@newsguy.com (Mike Dunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] MTD: at91: atmel_nand: return bit flips for the PMECC read_page()
Date: Thu, 29 Nov 2012 09:20:57 -0800	[thread overview]
Message-ID: <50B79979.1090406@newsguy.com> (raw)
In-Reply-To: <50B71292.4020604@atmel.com>

On 11/28/2012 11:45 PM, Josh Wu wrote:
> Hi, Mike
> 
> On 11/28/2012 3:35 AM, Mike Dunn wrote:
>>
>> BTW, with such a wide range for ecc strength - up to 24 bits, according to the
>> commit message for the pmecc patch - you may want to think about setting an
>> appropriate bitflip_threshold in the driver.  I'm not a nand expert, and I don't
>> know much about the atmel_nand specifically, but I would think that if 23 bits
>> are corrected on a page of size 2k (or less), maybe a return code of -EUCLEAN
>> from mtd_read() might be appropriate.
> 
> After checking the nand_base.c, I saw it will set the mtd.bitflip_threshold to
> mtd->ecc.strength during nand_scan_tail().
> in the atmel_nand code, the ecc strength will be set correctly, that means
> bitflip_threashold should be set up correctly by default.
> so I think I don't need set up the the bitflip_threshold anymore if I set ecc
> strength correctly. Am I missing any point here?


No, you are correct; bitflip_threshold is set to ecc.strength by default if the
driver has not assigned it a value already.  I just wondered if the default
value is too liberal given the possibility of such high ecc strength in your
case.  With bitflip_threshold == 24 (default for the greatest possible
ecc.strength on atmel_nand with pmecc) mtd_read() will not return -EUCLEAN until
24 bitflips are corrected on a page that is no greater than 2k in size, and may
be as small as 512 bytes (if I read the code correctly).

The -EUCLEAN return code is used by higher layers as an indication that a block
may be going bad.  I don't know whether or not a block bears scrutiny when 23
bitflips are corrected on a page.  I guess it depends on the particular flash
device.  It was just a thought.

Hope this makes sense.
Mike

  reply	other threads:[~2012-11-29 17:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-27 10:50 [PATCH v2] MTD: at91: atmel_nand: return bit flips for the PMECC read_page() Josh Wu
2012-11-27 10:50 ` Josh Wu
2012-11-27 18:59 ` Mike Dunn
2012-11-27 18:59   ` Mike Dunn
2012-11-27 19:35   ` Mike Dunn
2012-11-27 19:35     ` Mike Dunn
2012-11-29  7:45     ` Josh Wu
2012-11-29  7:45       ` Josh Wu
2012-11-29 17:20       ` Mike Dunn [this message]
2012-11-29 17:20         ` Mike Dunn
2012-12-03 14:35 ` Artem Bityutskiy
2012-12-03 14:35   ` Artem Bityutskiy

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=50B79979.1090406@newsguy.com \
    --to=mikedunn@newsguy.com \
    --cc=dedekind1@gmail.com \
    --cc=josh.wu@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=plagnioj@jcrosoft.com \
    /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.