All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Williams <Aaron.Williams@caviumnetworks.com>
To: Ivan Djelic <ivan.djelic@parrot.com>
Cc: linux-mtd@lists.infradead.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: MTD NAND BCH support for 24 bits/1K of ECC correction?
Date: Fri, 29 Mar 2013 22:40:35 -0700	[thread overview]
Message-ID: <51567AD3.5030704@caviumnetworks.com> (raw)
In-Reply-To: <20130329090219.GB6928@parrot.com>

On 03/29/2013 02:02 AM, Ivan Djelic wrote:
> On Thu, Mar 28, 2013 at 10:23:01PM +0000, Aaron Williams wrote:
>> Hi all,
>>
>> I am trying to clean up our OCTEON NAND flash driver in the Linux kernel
>> and enable support for multi-bit ECC using BCH and am having some
>> issues. I am able to successfully work with NAND flash that requires 4
>> bits ECC per 512 bytes but I am having issues with one of our boards
>> that has a NAND device that requires 24 bits of ECC per 1024 bytes.
>>
>> I was wondering if ECC of this magnitude has been successfully tested in
>> the past. By my calculations I should have 42 bytes of ECC per 1K block
>> (m=14, t=24 for 336 bits of ECC data). My problem is that when decoding
>> an encoded block I am seeing that nroots != err in decode_bch() after
>> find_poly_roots(). I am seeing this for all of the blocks I attempt to
>> read. As far as I can tell the data being sent to BCH is good, though it
>> might have a few bad bits but nowhere near 24.
>>
>> I am also seeing this same behavior in my U-Boot code which uses the
>> identical bch and nand_bch code.
>>
> Hi Aaron,
>
> CC-ing your message to linux-mtd which is the place to go for such questions :-)
>
> Your configuration (m=14 t=24 with 1024 bytes of data) has been tested, and should work
> with the BCH library. Could you give some details about your ECC setup:
>
> 1. Are you trying to locate and correct errors from hardware-computed syndromes ?
>
> 2. If yes, did you provide the BCH lib with the specific primitive polynomial used by
>     your hardware ? What is this polynomial ?
>
> 3. Could you provide the ECC bytes generated for the following block patterns:
>    - a 0xff-filled 1024 bytes block
>    - a 0xff-filled 1024 bytes block, except for the first byte set to 0xfe
>    This would help me find out how to setup the library to match your hardware.
>
> Regards,

We are doing the BCH support entirely in software due to limitations of 
our hardware to 1 bit ECC.

I may have to get back to you. I may have found the problem and will try 
and look at it some more next week. It looks like I now have it working 
in U-Boot and the same bug exists in our Linux driver. It wouldn't be 
the first one... our NAND drivers haven't been updated in ages.

-Aaron

-- 
Aaron Williams
Software Engineer
Cavium, Inc.
(408) 943-7198  (510) 789-8988 (cell)

WARNING: multiple messages have this Message-ID (diff)
From: Aaron Williams <Aaron.Williams@caviumnetworks.com>
To: Ivan Djelic <ivan.djelic@parrot.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	<linux-mtd@lists.infradead.org>
Subject: Re: MTD NAND BCH support for 24 bits/1K of ECC correction?
Date: Fri, 29 Mar 2013 22:40:35 -0700	[thread overview]
Message-ID: <51567AD3.5030704@caviumnetworks.com> (raw)
In-Reply-To: <20130329090219.GB6928@parrot.com>

On 03/29/2013 02:02 AM, Ivan Djelic wrote:
> On Thu, Mar 28, 2013 at 10:23:01PM +0000, Aaron Williams wrote:
>> Hi all,
>>
>> I am trying to clean up our OCTEON NAND flash driver in the Linux kernel
>> and enable support for multi-bit ECC using BCH and am having some
>> issues. I am able to successfully work with NAND flash that requires 4
>> bits ECC per 512 bytes but I am having issues with one of our boards
>> that has a NAND device that requires 24 bits of ECC per 1024 bytes.
>>
>> I was wondering if ECC of this magnitude has been successfully tested in
>> the past. By my calculations I should have 42 bytes of ECC per 1K block
>> (m=14, t=24 for 336 bits of ECC data). My problem is that when decoding
>> an encoded block I am seeing that nroots != err in decode_bch() after
>> find_poly_roots(). I am seeing this for all of the blocks I attempt to
>> read. As far as I can tell the data being sent to BCH is good, though it
>> might have a few bad bits but nowhere near 24.
>>
>> I am also seeing this same behavior in my U-Boot code which uses the
>> identical bch and nand_bch code.
>>
> Hi Aaron,
>
> CC-ing your message to linux-mtd which is the place to go for such questions :-)
>
> Your configuration (m=14 t=24 with 1024 bytes of data) has been tested, and should work
> with the BCH library. Could you give some details about your ECC setup:
>
> 1. Are you trying to locate and correct errors from hardware-computed syndromes ?
>
> 2. If yes, did you provide the BCH lib with the specific primitive polynomial used by
>     your hardware ? What is this polynomial ?
>
> 3. Could you provide the ECC bytes generated for the following block patterns:
>    - a 0xff-filled 1024 bytes block
>    - a 0xff-filled 1024 bytes block, except for the first byte set to 0xfe
>    This would help me find out how to setup the library to match your hardware.
>
> Regards,

We are doing the BCH support entirely in software due to limitations of 
our hardware to 1 bit ECC.

I may have to get back to you. I may have found the problem and will try 
and look at it some more next week. It looks like I now have it working 
in U-Boot and the same bug exists in our Linux driver. It wouldn't be 
the first one... our NAND drivers haven't been updated in ages.

-Aaron

-- 
Aaron Williams
Software Engineer
Cavium, Inc.
(408) 943-7198  (510) 789-8988 (cell)



  reply	other threads:[~2013-03-30  5:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-28 22:23 MTD NAND BCH support for 24 bits/1K of ECC correction? Aaron Williams
2013-03-29  9:02 ` Ivan Djelic
2013-03-29  9:02   ` Ivan Djelic
2013-03-30  5:40   ` Aaron Williams [this message]
2013-03-30  5:40     ` Aaron Williams

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=51567AD3.5030704@caviumnetworks.com \
    --to=aaron.williams@caviumnetworks.com \
    --cc=ivan.djelic@parrot.com \
    --cc=linux-kernel@vger.kernel.org \
    --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.