From: sashiko-bot@kernel.org
To: "Fil Dunsky" <filipp.dunsky@gmail.com>,
"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>
Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 2/3] mtd: rawnand: Add Cortina CS7542 controller support
Date: Mon, 23 Nov 2026 20:39:41 +0000 [thread overview]
Message-ID: <sashiko-outbox-230010@kernel.org> (raw)
In-Reply-To: <20261123-b4-cs7542-nand-v2-2-9d9f08608534@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] mtd: rawnand: cs752x: missing NF_ACCESS_EXTADDR in
cs752x_nand_pio()
--
commit 8d08264b7a4c09da251db50474ae591ee1e0717c
Author: Fil Dunsky <filipp.dunsky@gmail.com>
mtd: rawnand: Add Cortina CS7542 controller support
This commit adds a raw NAND controller driver for the Cortina Systems
CS7542 using programmed I/O, the native command sequencer, and hardware
Hamming ECC.
> diff --git a/drivers/mtd/nand/raw/cs752x_nand.c b/drivers/mtd/nand/raw/cs752x_nand.c
> new file mode 100644
> index 0000000000000..a7cecd747f2e4
> --- /dev/null
> +++ b/drivers/mtd/nand/raw/cs752x_nand.c
[ ... ]
> +static void cs752x_setup_page_regs(struct cs752x_nand_host *h, int page,
> + bool write, bool oob_required)
> +{
> + struct nand_chip *chip = &h->chip;
> + struct mtd_info *mtd = nand_to_mtd(chip);
> + u32 cmd, addr1, addr2, cnt;
> +
> + cnt = NF_CNT_DATA(mtd->writesize - 1);
> + cnt |= NF_CNT_OOB(oob_required ? mtd->oobsize - 1 : NCNT_EMPTY_OOB);
> +
> + cnt |= NF_CNT_CMD(NCNT_CMD_2);
> + cmd = write ? mk_nf_command(NAND_CMD_SEQIN, NAND_CMD_PAGEPROG, 0) :
> + mk_nf_command(NAND_CMD_READ0, NAND_CMD_READSTART, 0);
> + cnt |= NF_CNT_ADDR(mk_nf_addr(chip, page, &addr1, &addr2, 0));
> +
> + fl_writel(h, FLASH_NF_COUNT, cnt);
> + fl_writel(h, FLASH_NF_COMMAND, cmd);
> + fl_writel(h, FLASH_NF_ADDRESS_1, addr1);
> + fl_writel(h, FLASH_NF_ADDRESS_2, addr2);
> + fl_writel(h, FLASH_NF_ACCESS,
> + NF_ACCESS_WIDTH32 |
> + NF_ACCESS_EXTADDR(((u64)page << chip->page_shift) >> 27));
> +}
[ ... ]
> +static int cs752x_nand_pio(struct cs752x_nand_host *h,
> + const struct cs752x_nand_op *p, u8 *buf,
> + unsigned int len, bool write)
> +{
> + u32 value;
> + unsigned int i, step = write && len ? sizeof(u32) : 1;
> + int ret;
> +
> + ret = check_flash_ctrl_status(h);
> + if (ret)
> + return ret;
> + reset_ecc_bch_registers(h);
> + fl_writel(h, FLASH_NF_COUNT,
> + NF_CNT_OOB(NCNT_EMPTY_OOB) |
> + NF_CNT_DATA(len ? len - 1 : NCNT_EMPTY_DATA) |
> + NF_CNT_ADDR(p->naddrs ? p->naddrs - 1 : NCNT_EMPTY_ADDR) |
> + NF_CNT_CMD(p->ncmds - 1));
> + fl_writel(h, FLASH_NF_COMMAND, p->command);
> + fl_writel(h, FLASH_NF_ADDRESS_1, lower_32_bits(p->address));
> + fl_writel(h, FLASH_NF_ADDRESS_2, upper_32_bits(p->address));
> + fl_writel(h, FLASH_NF_ACCESS, write && len ? NF_ACCESS_WIDTH32 : NF_ACCESS_WIDTH8);
[Severity: Medium]
Should cs752x_nand_pio() also set NF_ACCESS_EXTADDR() in FLASH_NF_ACCESS for
row-addressed operations?
While cs752x_setup_page_regs() sets NF_ACCESS_EXTADDR() to select the
128 MiB bank for full-page PIO transfers, cs752x_nand_pio() leaves
NF_ACCESS_EXTADDR at 0. Row-addressed transactions executed through
cs752x_nand_exec_op(), such as block erases, OOB reads and writes, and bad
block table scans, will not program the bank index for offsets at or above
128 MiB.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261123-b4-cs7542-nand-v2-0-9d9f08608534@gmail.com?part=2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2026-11-23 20:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 20:27 [PATCH v2 0/3] Add Cortina Systems CS7542 NAND controller support Fil Dunsky via B4 Relay
2026-11-23 20:27 ` [PATCH v2 1/3] dt-bindings: mtd: Add Cortina CS7542 NAND controller Fil Dunsky via B4 Relay
2026-11-23 20:27 ` [PATCH v2 2/3] mtd: rawnand: Add Cortina CS7542 controller support Fil Dunsky via B4 Relay
2026-11-23 20:39 ` sashiko-bot [this message]
2026-11-23 21:26 ` Fil Dunsky
2026-11-23 20:27 ` [PATCH v2 3/3] 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=sashiko-outbox-230010@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=filipp.dunsky@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--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