public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Andrea Scian via B4 Relay <devnull+andrea.scian.dave.eu@kernel.org>
Cc: Michal Simek <michal.simek@amd.com>,
	 Richard Weinberger <richard@nod.at>,
	 Vignesh Raghavendra <vigneshr@ti.com>,
	andrea.scian@dave.eu,  linux-mtd@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	 Amit Kumar <amit.kumar-mahapatra@amd.com>
Subject: Re: [PATCH v2 1/2] mtd: rawnand: pl353: Fix software ECC support
Date: Thu, 29 Jan 2026 20:07:10 +0100	[thread overview]
Message-ID: <874io4kzkx.fsf@bootlin.com> (raw)
In-Reply-To: <20260126-pl353-soft-ecc-support-v2-1-fcd74b6e955f@dave.eu> (Andrea Scian via's message of "Mon, 26 Jan 2026 17:58:55 +0100")

Hello Andrea,

On 26/01/2026 at 17:58:55 +01, Andrea Scian via B4 Relay <devnull+andrea.scian.dave.eu@kernel.org> wrote:

> From: Andrea Scian <andrea.scian@dave.eu>
>
> We need to set another couple of fields in ecc structure to allow
> choosing SW ECC instead of HW one, otherwise write operation fail.

I'm not sure I captured in our previous exchanges that you were testing
with SW ECC.

> Signed-off-by: Andrea Scian <andrea.scian@dave.eu>
> ---
>  drivers/mtd/nand/raw/pl35x-nand-controller.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mtd/nand/raw/pl35x-nand-controller.c b/drivers/mtd/nand/raw/pl35x-nand-controller.c
> index 11bd90e3f18cb..fcb62b9ec947b 100644
> --- a/drivers/mtd/nand/raw/pl35x-nand-controller.c
> +++ b/drivers/mtd/nand/raw/pl35x-nand-controller.c
> @@ -976,6 +976,8 @@ static int pl35x_nand_attach_chip(struct nand_chip *chip)
>  		fallthrough;
>  	case NAND_ECC_ENGINE_TYPE_NONE:
>  	case NAND_ECC_ENGINE_TYPE_SOFT:
> +		chip->ecc.algo = NAND_ECC_ALGO_HAMMING;

This is unfortunately not relevant here. In software you can use
whatever algorithm you want. It is writeable in DT and should not be
hardcoded here. The only limit is the available OOB area for the
strength (depending on the NAND geometry).

> +		chip->ecc.write_page_raw = nand_monolithic_write_page_raw;

This, however, seems relevant and should be the oneliner!

Please add Cc: stable & Fixes tags to your v3.

Thanks,
Miquèl

  reply	other threads:[~2026-01-29 19:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-26 16:58 [PATCH v2 0/2] PL353 SW ECC fixes Andrea Scian via B4 Relay
2026-01-26 16:58 ` [PATCH v2 1/2] mtd: rawnand: pl353: Fix software ECC support Andrea Scian via B4 Relay
2026-01-29 19:07   ` Miquel Raynal [this message]
2026-01-26 16:58 ` [PATCH v2 2/2] mtd: rawnand: pl353: Add message about ECC mode Andrea Scian via B4 Relay

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=874io4kzkx.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=amit.kumar-mahapatra@amd.com \
    --cc=andrea.scian@dave.eu \
    --cc=devnull+andrea.scian.dave.eu@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=michal.simek@amd.com \
    --cc=richard@nod.at \
    --cc=vigneshr@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