Devicetree
 help / color / mirror / Atom feed
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>,
	"Philipp Zabel" <p.zabel@pengutronix.de>
Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v9 3/4] mtd: rawnand: Add Cortina CS7542 controller support
Date: Sun, 06 Dec 2026 14:54:24 +0000	[thread overview]
Message-ID: <sashiko-outbox-252494@kernel.org> (raw)
In-Reply-To: <20261206-b4-cs7542-nand-v9-3-b79bd1478bec@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] mtd: rawnand: cs752x advertises standalone DATA_IN/DATA_OUT
  patterns
- [Low] mtd: rawnand: declare __free(device_node) flash at
  initialization in cs752x_nand_probe()
--

commit 7881c62859dd5751f3a45cbd2bfa6122a33222a2
Author: Fil Dunsky <filipp.dunsky@gmail.com>

mtd: rawnand: Add Cortina CS7542 controller support

This commit adds a programmed-I/O raw NAND controller driver for the
Cortina Systems CS7542, supporting software ECC and 256-byte 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..6b82f1214ed3f
> --- /dev/null
> +++ b/drivers/mtd/nand/raw/cs752x_nand.c

[ ... ]

> +static const struct nand_op_parser_pattern cs752x_nand_patterns[] = {

[ ... ]

> +	NAND_OP_PARSER_PATTERN(cs752x_nand_exec_subop,
> +			       NAND_OP_PARSER_PAT_DATA_IN_ELEM(false, NCNT_EMPTY_DATA)),
> +	NAND_OP_PARSER_PATTERN(cs752x_nand_exec_subop,
> +			       NAND_OP_PARSER_PAT_DATA_OUT_ELEM(false, NCNT_EMPTY_DATA)),
> +	NAND_OP_PARSER_PATTERN(cs752x_nand_exec_subop,
> +			       NAND_OP_PARSER_PAT_WAITRDY_ELEM(false)),
> +};

[Severity: Medium]
Should cs752x_nand_patterns[] omit the standalone DATA_IN and DATA_OUT
patterns?

cs752x_nand_pio() resets the controller FSM with ECC_RESET_NF_RESET after
every sub-operation, so split continuations are not supported.  Advertising
standalone DATA_IN makes rawnand_check_data_only_read_support() set
supported_op.data_only_read during nand_scan().

If copy 0 of an ONFI or JEDEC parameter page fails CRC, nand_onfi_detect()
and nand_jedec_detect() will then issue standalone nand_read_data_op()
calls across the FSM reset instead of nand_change_read_column_op().

Advertising standalone data patterns also lets nand_op_parser_exec_op()
split unsupported multi-phase operations across FSM resets rather than
rejecting them with -ENOTSUPP.  Dropping both entries keeps parameter page
fallback on nand_change_read_column_op().

[ ... ]

> +static int cs752x_nand_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct cs752x_nand_host *h;
> +	struct nand_chip *chip;
> +	struct mtd_info *mtd;
> +	struct reset_control *reset;
> +	struct clk *clk;
> +	u32 cs;
> +	int err;
> +	struct device_node *flash __free(device_node) = NULL;
> +
> +	if (of_get_available_child_count(dev->of_node) != 1)
> +		return dev_err_probe(dev, -EOPNOTSUPP,
> +				     "one connected NAND target is supported\n");
> +	flash = of_get_next_available_child(dev->of_node, NULL);

[Severity: Low]
This isn't a bug, but per the cleanup.h convention, flash can be declared
and initialized in a single statement right after the child-count check
instead of being initialized to NULL at the top of cs752x_nand_probe().

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261206-b4-cs7542-nand-v9-0-b79bd1478bec@gmail.com?part=3

  reply	other threads:[~2026-12-06 14:54 UTC|newest]

Thread overview: 7+ 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 ` [PATCH v9 1/4] mtd: rawnand: Honor controller raw page callbacks in ECC_NONE Fil Dunsky via B4 Relay
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:42   ` sashiko-bot
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:54   ` sashiko-bot [this message]
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=sashiko-outbox-252494@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=p.zabel@pengutronix.de \
    --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