All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Andrea Scian <andrea.scian@dave.eu>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: mtd_nandbitserr and seed using pl35x NAND controller
Date: Thu, 11 Dec 2025 17:02:26 +0100	[thread overview]
Message-ID: <87wm2t57n1.fsf@bootlin.com> (raw)
In-Reply-To: <MI2P293MB02644E845892FAFBEC01AD5997D6A@MI2P293MB0264.ITAP293.PROD.OUTLOOK.COM> (Andrea Scian's message of "Tue, 25 Nov 2025 10:12:47 +0000")

Hello Andrea,

On 25/11/2025 at 10:12:47 GMT, Andrea Scian <andrea.scian@dave.eu> wrote:

> Dear all,
>
> I'm facing a weird behavior on mtd_nandbitserr mtd_test while working on a Zynk7k based platform, running kernel 6.6.0
>
> As many of you suggest me, this test is part of our validation for the whole lowlevel support (NAND chip, hardware design, NAND controller).
>
> I've found that this test, in my testbed, fails when using seed=1 but it seems to end successfully when using default parameters (so seed=0)
>
> Here it is the test output in the two cases:
>
> root@sw0005-devel:~# modprobe mtd_nandbiterrs seed=1

...

> --- a/drivers/mtd/nand/raw/pl35x-nand-controller.c
> +++ b/drivers/mtd/nand/raw/pl35x-nand-controller.c
> @@ -1064,7 +1064,7 @@ static int pl35x_nand_chip_init(struct pl35x_nandc *nfc,
>       plnand->cs = cs;
>  
>       chip = &plnand->chip;
> -     chip->options = NAND_BUSWIDTH_AUTO | NAND_USES_DMA | NAND_NO_SUBPAGE_WRITE;
> +     chip->options = NAND_BUSWIDTH_AUTO | NAND_USES_DMA;

I no longer remember why this flag was set, tbh. If you enable subpage
writes, you should make sure that page and subpage tests really pass,
because it means I have not tested this possibility.

Nevertheless, I find this causal effect very unsatisfying. I do not
understand how this might be related to your issue.

Are you sure of the ECC configuration (can you show the DT snippet)?

Is the issue consistent?

> * is it correct that changing seed in mtd_nandbiterrs make such a
> difference? IIUC this is just a "random" seed so I'll expect to fail
> in both cases or none

Yes, exactly. I can't make sense out of this observation :-)

> * is it correct that subpage write has been disabled in pl35x NAND
> controller? AFAIK on older kernel subpages were enable but maybe I'm
> missing something. Unfortunately git history doesn't help in this

This flag has always been there, so what does that mean? Aren't you
talking about a Xilinx downstream kernel here?

> I didn't have the chance to try a newer kernel but, at least on these
> two files, I don't see any significant changes

Did you observe what seed=0/1 meant in practice? I clearly do not
understand the link it might have with subpages.

Can you try with the mtd-utils userspace tool instead? Kernel modules
are no longer actively maintained, so maybe there is a bug (?) inside.

Also, can you try manually flipping bits with nandflipbits and target
various area in the page (outside of the first subpage, unlike the
nandbiterrs test).

Thanks,
Miquèl

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

  reply	other threads:[~2025-12-11 16:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-25 10:12 mtd_nandbitserr and seed using pl35x NAND controller Andrea Scian
2025-12-11 16:02 ` Miquel Raynal [this message]
     [not found]   ` <MI2P293MB026440FB793D2D9D1E59ADA797A8A@MI2P293MB0264.ITAP293.PROD.OUTLOOK.COM>
2026-01-08 17:15     ` R: " 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=87wm2t57n1.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=andrea.scian@dave.eu \
    --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.