From: Brian Norris <computersforpeace@gmail.com>
To: Pekon Gupta <pekon@ti.com>
Cc: linux-mtd <linux-mtd@lists.infradead.org>,
ezequiel.garcia@free-electrons.com,
Artem Bityutskiy <dedekind1@gmail.com>
Subject: Re: [PATCH v4 4/4] mtd: devices: elm: add checks ELM H/W constrains, driver code cleanup
Date: Thu, 5 Dec 2013 00:57:41 -0800 [thread overview]
Message-ID: <20131205085701.GC4636@norris.computersforpeace.net> (raw)
In-Reply-To: <1385374141-10934-5-git-send-email-pekon@ti.com>
On Mon, Nov 25, 2013 at 03:39:01PM +0530, Pekon Gupta wrote:
> ELM H/W engine is used by BCHx_ECC schemes for detecting and locating bit-flips.
> However, ELM H/W engine has some constrains like:
s/constrains/constraints/
> - ELM can decode errors in chunks of 512 data bytes only
> - ELM can operate max upto 8 such buffers in parallel
>
> This patch
> - add checks for above constrains
> - fixes ELM register configs based on number of info->eccsteps
You dropped info->eccsteps from v3 -> v4, but this descriptions still
mentions it.
> - cleans-up elm_load_syndrome()
It seems like your list of fixes for this patch can be separated into
separate patches a bit. Particularly, the big middle chunk about
rewriting BCH4 and BCH8 support is much more significant than your
additional checks for if (!dev) and if (!mtd), so it should be in its
own patch, with a better description of what you're really doing.
> Signed-off-by: Pekon Gupta <pekon@ti.com>
> Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> ---
> drivers/mtd/devices/elm.c | 127 +++++++++++++++++++++++---------------
> drivers/mtd/nand/omap2.c | 2 +-
> include/linux/platform_data/elm.h | 6 +-
> 3 files changed, 83 insertions(+), 52 deletions(-)
>
> diff --git a/drivers/mtd/devices/elm.c b/drivers/mtd/devices/elm.c
> index d1dd6a3..10026ef 100644
> --- a/drivers/mtd/devices/elm.c
> +++ b/drivers/mtd/devices/elm.c
...
> @@ -152,55 +180,52 @@ static void elm_configure_page_mode(struct elm_info *info, int index,
> * Load syndrome fragment registers with calculated ecc in reverse order.
> */
> static void elm_load_syndrome(struct elm_info *info,
> - struct elm_errorvec *err_vec, u8 *ecc)
> + struct elm_errorvec *err_vec, u8 *ecc_calc)
> {
> + struct nand_chip *nand_chip = info->mtd->priv;
> + unsigned int eccbytes = nand_chip->ecc.bytes;
> + unsigned int eccsteps = nand_chip->ecc.steps;
> + u8 *ecc = ecc_calc;
> int i, offset;
> u32 val;
>
> - for (i = 0; i < ERROR_VECTOR_MAX; i++) {
> -
> + for (i = 0; i < eccsteps; i++) {
Here's another work item in this patch: you're replacing a fixed
constant (ERROR_VECTOR_MAX) with a dynamic value (eccsteps). What are
you solving with this? Shouldn't this be its own patch?
> /* Check error reported */
> if (err_vec[i].error_reported) {
> elm_configure_page_mode(info, i, true);
...
Brian
next prev parent reply other threads:[~2013-12-05 8:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-25 10:08 [PATCH v4 0/4] optimize and clean-up of OMAP NAND and ELM driver Pekon Gupta
2013-11-25 10:08 ` [PATCH v4 1/4] mtd: nand: omap: optimized chip->ecc.correct() for H/W ECC schemes Pekon Gupta
2013-11-25 10:08 ` [PATCH v4 2/4] mtd: nand: omap: optimize chip->ecc.calculate() " Pekon Gupta
2013-11-25 10:09 ` [PATCH v4 3/4] mtd: nand: omap: optimize chip->ecc.hwctl() " Pekon Gupta
2013-11-25 10:09 ` [PATCH v4 4/4] mtd: devices: elm: add checks ELM H/W constrains, driver code cleanup Pekon Gupta
2013-12-05 8:57 ` Brian Norris [this message]
2013-12-02 19:51 ` [PATCH v4 0/4] optimize and clean-up of OMAP NAND and ELM driver Gupta, Pekon
2013-12-05 8:31 ` Brian Norris
2013-12-05 8:54 ` Gupta, Pekon
2013-12-05 9:05 ` Brian Norris
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=20131205085701.GC4636@norris.computersforpeace.net \
--to=computersforpeace@gmail.com \
--cc=dedekind1@gmail.com \
--cc=ezequiel.garcia@free-electrons.com \
--cc=linux-mtd@lists.infradead.org \
--cc=pekon@ti.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