From: sashiko-bot@kernel.org
To: "Haoning Cheng" <Haoning.CHENG@cn.bosch.com>
Cc: devicetree@vger.kernel.org, imx@lists.linux.dev, robh@kernel.org,
conor+dt@kernel.org, Frank.Li@kernel.org
Subject: Re: [PATCH 02/10] dts: imx: Use minimum NAND ECC strength on BSH boards
Date: Wed, 04 Nov 2026 07:49:42 +0000 [thread overview]
Message-ID: <sashiko-outbox-196825@kernel.org> (raw)
In-Reply-To: <20261104-add-bsh-smm-m2-v1-2-369f0a77e021@cn.bosch.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] ARM: dts: imx: unjustified incompatible NAND ECC layout change on BSH boards
--
commit 8322a44ab1436f5d874adef6cee6881bf71a02c7
Author: Michael Trimarchi <michael@amarulasolutions.com>
dts: imx: Use minimum NAND ECC strength on BSH boards
This commit enables the fsl,use-minimum-ecc property on the GPMI NAND
controllers for the BSH SMM-M2 and SMM-S2 boards.
> diff --git a/arch/arm/boot/dts/nxp/imx/imx6ulz-bsh-smm-m2.dts b/arch/arm/boot/dts/nxp/imx/imx6ulz-bsh-smm-m2.dts
> index 2d9f495660c9a..aac211a9f9ebd 100644
> --- a/arch/arm/boot/dts/nxp/imx/imx6ulz-bsh-smm-m2.dts
> +++ b/arch/arm/boot/dts/nxp/imx/imx6ulz-bsh-smm-m2.dts
> @@ -26,6 +26,7 @@ &gpmi {
> pinctrl-names = "default";
> pinctrl-0 = <&pinctrl_gpmi_nand>;
> nand-on-flash-bbt;
> + fsl,use-minimum-ecc;
> status = "okay";
> };
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8mn-bsh-smm-s2.dts b/arch/arm64/boot/dts/freescale/imx8mn-bsh-smm-s2.dts
> index 11a1ba5bfdb7e..df11f81ac50c1 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mn-bsh-smm-s2.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8mn-bsh-smm-s2.dts
> @@ -21,6 +21,7 @@ memory@40000000 {
> &gpmi {
> pinctrl-names = "default";
> pinctrl-0 = <&pinctrl_gpmi_nand>;
> + fsl,use-minimum-ecc;
[Severity: Medium]
Does adding fsl,use-minimum-ecc to these existing board device trees cause an
incompatible on-flash ECC layout regression for already-provisioned devices?
In drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c, gpmi_nand_probe() calls
common_nfc_set_geometry() to configure the BCH layout:
use_minimun_ecc = of_property_read_bool(this->dev->of_node,
"fsl,use-minimum-ecc");
/* use legacy bch geometry settings by default*/
if ((!use_minimun_ecc && mtd->oobsize < 1024) ||
!(requirements->strength > 0 && requirements->step_size > 0)) {
dev_dbg(this->dev, "use legacy bch geometry\n");
err = legacy_set_geometry(this);
if (!err)
return 0;
}
Without fsl,use-minimum-ecc (when mtd->oobsize < 1024),
common_nfc_set_geometry() calls legacy_set_geometry(), which maximizes
geo->ecc_strength across the OOB area via get_ecc_strength(). With
fsl,use-minimum-ecc enabled, it instead calls set_geometry_by_ecc_info()
using the NAND chip's minimum required ECC strength and step size, changing
geo->ecc_strength, geo->page_size, geo->block_mark_byte_offset, and
geo->block_mark_bit_offset.
As a result, any NAND partitions written using the previous device tree will
fail to read with -EBADMSG ECC errors. Could the commit message explain why
this change is needed (for example, to match the ECC layout expected by the
bootloader or ROM) and why breaking compatibility with existing on-flash
layouts on these boards is acceptable?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261104-add-bsh-smm-m2-v1-0-369f0a77e021@cn.bosch.com?part=2
next prev parent reply other threads:[~2026-11-04 7:49 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 7:35 [PATCH 00/10] Update BSH SystemMaster device trees and add SMM-M2B support Haoning Cheng
2026-11-04 7:35 ` [PATCH 01/10] dt-bindings: arm: fsl: Add BSH SMM-M2B board Haoning Cheng
2026-11-04 7:35 ` [PATCH 02/10] dts: imx: Use minimum NAND ECC strength on BSH boards Haoning Cheng
2026-11-04 7:49 ` sashiko-bot [this message]
2026-11-04 7:35 ` [PATCH 03/10] ARM: dts: imx6ulz: Enable RNGB on BSH SMM-M2 Haoning Cheng
2026-11-04 7:45 ` sashiko-bot
2026-11-04 7:35 ` [PATCH 04/10] ARM: dts: imx6ulz: Adjust BSH SMM-M2 Wi-Fi and Bluetooth pin settings Haoning Cheng
2026-11-04 7:35 ` [PATCH 05/10] ARM: dts: imx6ulz: Fix BSH SMM-M2 WLAN host wake configuration Haoning Cheng
2026-11-04 7:35 ` [PATCH 06/10] ARM: dts: imx6ulz: Factor out BSH SMM-M2 common device tree Haoning Cheng
2026-11-04 7:35 ` [PATCH 07/10] ARM: dts: imx6ulz: Add BSH SMM-M2B board support Haoning Cheng
2026-11-04 7:44 ` sashiko-bot
2026-11-04 7:35 ` [PATCH 08/10] ARM: dts: imx6ulz: Configure UART2 pins on BSH SMM-M2 variants Haoning Cheng
2026-11-04 7:35 ` [PATCH 09/10] dts: imx: Enable USB OTG mode on BSH SMM-M2 and SMM-S2 Haoning Cheng
2026-11-04 7:35 ` [PATCH 10/10] ARM: dts: imx6ulz: Add SPI display and touch overlay for BSH SMM-M2 Haoning Cheng
2026-11-04 7:55 ` sashiko-bot
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-196825@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=Haoning.CHENG@cn.bosch.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=imx@lists.linux.dev \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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