From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>, Ian Molton <spyro@f2s.com>
Cc: linux-mtd@lists.infradead.org, vimal.newwork@gmail.com
Subject: Re: abuse of nand_correct_data in tmio_nand driver
Date: Fri, 24 Jul 2009 21:24:01 +0400 [thread overview]
Message-ID: <bc64b4640907241024j7a5c88d9ic5eb2cdbd74f8ead@mail.gmail.com> (raw)
In-Reply-To: <20090724.001104.229278926.anemo@mba.ocn.ne.jp>
2009/7/23 Atsushi Nemoto <anemo@mba.ocn.ne.jp>:
> On Thu, 23 Jul 2009 12:34:43 +0530, vimal singh <vimal.newwork@gmail.com> wrote:
>> > OK, but I still feel duplicating nand_ecc code is not so good. How
>> > about splitting nand_correct_data into two parts? A pure calculation
>> > function and a wrapper for mtd interface. Like this:
>>
>> But I do not see any thing extra, which you achieve from this
>> wrapper... Is this a prototype, and you want to handle above scenario
>> in this wrapper (calling 'nand_correct_data' multiple times based on
>> something, probably 'ecc.bytes')?
>
> Yes, if we have __nand_correct_data(buf, read_ecc, calc_ecc, eccsize)
> which do job based on its eccsize argument, the ecc.correct function
> of the tmio_nand driver can be implemented like this:
>
> int tmio_nand_correct_data(struct mtd_info *mtd, unsigned char *buf,
> unsigned char *read_ecc, unsigned char *calc_ecc)
> {
> int r0, r1;
>
> /* assume ecc.size = 512 and ecc.bytes = 6 */
> r0 = __nand_correct_data(buf, read_ecc, calc_ecc, 256);
> if (r0 < 0)
> return r0;
> r1 = __nand_correct_data(buf + 256, read_ecc + 3, calc_ecc + 3, 256);
> if (r1 < 0)
> return r1;
> return r0 | r1;
> }
>
> Note that this is not tested at all since I do not have tmio device.
This seems to be the thing that was initially ment by Zaurus kernels, so
this if Ian doesn't object,
Acked-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
--
With best wishes
Dmitry
next prev parent reply other threads:[~2009-07-24 17:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-14 14:05 abuse of nand_correct_data in tmio_nand driver Atsushi Nemoto
2009-07-19 0:11 ` Dmitry Eremin-Solenikov
2009-07-19 15:14 ` Atsushi Nemoto
2009-07-19 16:08 ` Dmitry Eremin-Solenikov
2009-07-20 5:15 ` vimal singh
2009-07-21 15:20 ` Atsushi Nemoto
2009-07-22 8:43 ` vimal singh
2009-07-22 15:13 ` Atsushi Nemoto
2009-07-23 7:04 ` vimal singh
2009-07-23 15:11 ` Atsushi Nemoto
2009-07-24 17:24 ` Dmitry Eremin-Solenikov [this message]
2009-07-26 13:03 ` vimal singh
2009-07-28 13:57 ` Ian molton
2009-07-28 14:11 ` Atsushi Nemoto
2009-07-28 14:35 ` Ian Molton
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=bc64b4640907241024j7a5c88d9ic5eb2cdbd74f8ead@mail.gmail.com \
--to=dbaryshkov@gmail.com \
--cc=anemo@mba.ocn.ne.jp \
--cc=linux-mtd@lists.infradead.org \
--cc=spyro@f2s.com \
--cc=vimal.newwork@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox