LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jan Hoffmann <jan@3e8.eu>
To: Daniel Kestrel <kestrelseventyfour@gmail.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mtd: rawnand: xway: No hardcoded ECC engine, use device tree setting
Date: Thu, 16 Sep 2021 21:38:26 +0200	[thread overview]
Message-ID: <51f2ebf4-6df1-eba5-99f1-1ec88e475d20@3e8.eu> (raw)
In-Reply-To: <20210808072643.GA5084@ubuntu>

Hello,

Configuration of the ECC engine type using device tree has actually
worked before. I am using OpenWrt on a Fritzbox 7362 SL, which has a
Micron 29F1G08ABADA flash chip. The bootloader of the device uses on-die
ECC, so that has to be used for Linux as well. It is configured in DTS
using "nand-ecc-mode = "on-die";". This worked fine with kernel 5.4.
However, after switching to kernel 5.10 it is ignored and software ECC
is used instead.

If I understand this correctly, the situation is as follows:

Originally, xway-nand did set defaults for ECC mode and algorithm, but
different values could be configured using device tree.

Commit d7157ff49a5b ("mtd: rawnand: Use the ECC framework user input
parsing bits") broke these default values, as the ECC algorithm is now
unconditionally set from the user configuration in rawnand_dt_init.
Previously, the default value was only overwritten if the device tree
actually contained a value.

This is fixed in d525914b5bd8 ("mtd: rawnand: xway: Move the ECC
initialization to ->attach_chip()"). However, this makes it impossible
to configure the ECC engine type in the device tree, as it is now
overwritten by the default value in xway_attach_chip.

I am not sure if this patch is the best approach for fixing this, as it
would again cause breakage for anyone who relies on the existing
default value. And this kind of breakage seems to have been the reason
for moving the default values to attach_chip in the first place (see
https://lore.kernel.org/lkml/20201105084939.72ea6bfd@xps13/ ).

As similar changes were applied to other NAND drivers, the same issue
probably also exists there. Maybe it makes sense to add a proper fix
for all of them?

Thanks,
Jan

  parent reply	other threads:[~2021-09-16 19:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-08  7:26 Daniel Kestrel
2021-08-16  7:31 ` Miquel Raynal
2021-08-19  7:21   ` Kestrel seventyfour
2021-08-19  8:03     ` Miquel Raynal
2021-08-23 11:19       ` Kestrel seventyfour
2021-08-23 15:24         ` Miquel Raynal
2021-08-24  7:15           ` Kestrel seventyfour
2021-08-24 17:22             ` Miquel Raynal
2021-08-25  8:47               ` Kestrel seventyfour
2021-08-25  8:51                 ` Miquel Raynal
2021-08-25 14:07                   ` Kestrel seventyfour
2021-08-25 15:31                     ` Miquel Raynal
2021-08-26  5:27                       ` Kestrel seventyfour
2021-09-16 19:38 ` Jan Hoffmann [this message]
2021-09-17 17:01   ` Miquel Raynal
2021-09-17 17:45     ` Jan Hoffmann
2021-09-17 19:32       ` Miquel Raynal
2021-09-18 21:26         ` Jan Hoffmann
2021-09-27 16:31           ` Miquel Raynal
2021-09-27 20:32             ` Jan Hoffmann
2021-09-28  8:49               ` 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=51f2ebf4-6df1-eba5-99f1-1ec88e475d20@3e8.eu \
    --to=jan@3e8.eu \
    --cc=kestrelseventyfour@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    --subject='Re: [PATCH v2] mtd: rawnand: xway: No hardcoded ECC engine, use device tree setting' \
    /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

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).