From: Fil Dunsky via B4 Relay <devnull+filipp.dunsky.gmail.com@kernel.org>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Fil Dunsky <filipp.dunsky@gmail.com>,
Philipp Zabel <p.zabel@pengutronix.de>
Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v9 1/4] mtd: rawnand: Honor controller raw page callbacks in ECC_NONE
Date: Sun, 06 Dec 2026 17:27:21 +0300 [thread overview]
Message-ID: <20261206-b4-cs7542-nand-v9-1-b79bd1478bec@gmail.com> (raw)
In-Reply-To: <20261206-b4-cs7542-nand-v9-0-b79bd1478bec@gmail.com>
From: Fil Dunsky <filipp.dunsky@gmail.com>
The ECC_NONE path installs the generic raw page helpers unconditionally.
These helpers split main and OOB accesses and split the program
transaction. Controllers which require a single transaction provide
monolithic raw callbacks, but the ECC_NONE path discards them.
Keep the controller callbacks when supplied and install the normal
generic fallbacks otherwise. Use those same raw callbacks for page I/O
when ECC is disabled. Preserve the existing OOB helpers and geometry.
Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com>
---
drivers/mtd/nand/raw/nand_base.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index fe8c6dcc9..200d507b6 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -6301,11 +6301,13 @@ static int nand_scan_tail(struct nand_chip *chip)
case NAND_ECC_ENGINE_TYPE_NONE:
pr_warn("NAND_ECC_ENGINE_TYPE_NONE selected by board driver. This is not recommended!\n");
- ecc->read_page = nand_read_page_raw;
- ecc->write_page = nand_write_page_raw;
+ if (!ecc->read_page_raw)
+ ecc->read_page_raw = nand_read_page_raw;
+ if (!ecc->write_page_raw)
+ ecc->write_page_raw = nand_write_page_raw;
+ ecc->read_page = ecc->read_page_raw;
+ ecc->write_page = ecc->write_page_raw;
ecc->read_oob = nand_read_oob_std;
- ecc->read_page_raw = nand_read_page_raw;
- ecc->write_page_raw = nand_write_page_raw;
ecc->write_oob = nand_write_oob_std;
ecc->size = mtd->writesize;
ecc->bytes = 0;
--
2.53.0
next prev parent reply other threads:[~2026-12-06 14:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-06 14:27 [PATCH v9 0/4] Add Cortina Systems CS7542 NAND controller support Fil Dunsky via B4 Relay
2026-12-06 14:27 ` Fil Dunsky via B4 Relay [this message]
2026-12-06 14:27 ` [PATCH v9 2/4] dt-bindings: mtd: Add Cortina CS7542 NAND controller Fil Dunsky via B4 Relay
2026-12-06 14:27 ` [PATCH v9 3/4] mtd: rawnand: Add Cortina CS7542 controller support Fil Dunsky via B4 Relay
2026-12-06 14:27 ` [PATCH v9 4/4] MAINTAINERS: Add Cortina CS7542 NAND controller entry Fil Dunsky 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=20261206-b4-cs7542-nand-v9-1-b79bd1478bec@gmail.com \
--to=devnull+filipp.dunsky.gmail.com@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=filipp.dunsky@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=p.zabel@pengutronix.de \
--cc=richard@nod.at \
--cc=robh@kernel.org \
--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
all inboxes | Powered by JetHome®