linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Han Xu <xhnjupt@gmail.com>, Vignesh Raghavendra <vigneshr@ti.com>,
	Tudor Ambarus <Tudor.Ambarus@microchip.com>,
	Richard Weinberger <richard@nod.at>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	linux-mtd <linux-mtd@lists.infradead.org>,
	Lucas Stach <l.stach@pengutronix.de>
Subject: Re: [PATCH] mtd: rawnand: mxc: Move the ECC engine initialization to the right place
Date: Fri, 16 Oct 2020 14:37:14 -0300	[thread overview]
Message-ID: <CAOMZO5Dd9u-xRsp__kv_1jyo1b__1E32YjAKyD7=hw83x3h3=A@mail.gmail.com> (raw)
In-Reply-To: <20201016190149.55a3d62f@xps13>

Hi Miquel,

On Fri, Oct 16, 2020 at 2:01 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> Software ECC is used, is it expected?
>
> Can you trace rawnand_dt_init() to see what happen in the engine_type
> choice?

I managed to resurrect an old imx27-pdk board here and reproduced the
same behavior as Sascha reported.

engine_type looks good. ecc.size is still 0.

I am using this debug patch:

--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -5036,6 +5036,12 @@ static int rawnand_dt_init(struct nand_chip *chip)
        chip->ecc.strength = nand->ecc.user_conf.strength;
        chip->ecc.size = nand->ecc.user_conf.step_size;

+
+       pr_info("********** chip->ecc.engine_type is %d\n",
chip->ecc.engine_type);
+       pr_info("********** chip->ecc.strength is %d\n", chip->ecc.strength);
+       pr_info("********** chip->ecc.size is %d\n", chip->ecc.size);
+       pr_info("********** chip->ecc.algo is %d\n", chip->ecc.algo);
+
        return 0;
 }

and I get:

nand: ********** chip->ecc.engine_type is 3
nand: ********** chip->ecc.strength is 0
nand: ********** chip->ecc.size is 0
nand: ********** chip->ecc.algo is 0
nand: device found, Manufacturer ID: 0xec, Chip ID: 0xaa
nand: Samsung NAND 256MiB 1,8V 8-bit
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at drivers/mtd/nand/raw/mxc_nand.c:1391
mxc_nand_command+0x22c/0x280
Unimplemented command (cmd=0)
Modules linked in:

If I checkout commit  d7157ff49a ("mtd: rawnand: Use the ECC framework
user input parsing bits") in today's linux-next and revert it, then
the driver probes fine and prints:

nand: ******** ecc.engine_type = 3
nand: ******** chip->ecc.strength = 0
nand: ******** chip->ecc.size = 512

Thanks

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2020-10-16 17:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-16  7:49 [PATCH] mtd: rawnand: mxc: Move the ECC engine initialization to the right place Miquel Raynal
2020-10-16 11:32 ` Fabio Estevam
2020-10-16 11:45   ` Fabio Estevam
2020-10-16 12:05     ` Miquel Raynal
2020-10-16 12:11       ` Fabio Estevam
2020-10-16 13:53 ` Sascha Hauer
2020-10-16 17:01   ` Miquel Raynal
2020-10-16 17:37     ` Fabio Estevam [this message]
2020-10-16 19:18     ` Fabio Estevam
2020-10-16 21:05       ` Miquel Raynal
2020-10-16 21:32         ` Fabio Estevam
2020-10-17 18:17           ` Miquel Raynal

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='CAOMZO5Dd9u-xRsp__kv_1jyo1b__1E32YjAKyD7=hw83x3h3=A@mail.gmail.com' \
    --to=festevam@gmail.com \
    --cc=Tudor.Ambarus@microchip.com \
    --cc=l.stach@pengutronix.de \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=s.hauer@pengutronix.de \
    --cc=vigneshr@ti.com \
    --cc=xhnjupt@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;
as well as URLs for NNTP newsgroup(s).