All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frieder Schrempf <frieder.schrempf@kontron.de>
To: Stefano Babic <sbabic@denx.de>, Sean Nyekjaer <sean@geanix.com>
Cc: peng.fan@nxp.com, ye.li@nxp.com, alice.guo@nxp.com,
	sjg@chromium.org, seanga2@gmail.com, u-boot@lists.denx.de,
	miquel.raynal@bootlin.com,
	linux-mtd <linux-mtd@lists.infradead.org>,
	"han.xu" <han.xu@nxp.com>, Fabio Estevam <festevam@gmail.com>,
	Tim Harvey <tharvey@gateworks.com>,
	dl-uboot-imx <uboot-imx@nxp.com>
Subject: Re: [EXT] [PATCH] mtd: mxs_nand: default to legacy bch and rename to modern bch option
Date: Thu, 17 Mar 2022 14:24:58 +0100	[thread overview]
Message-ID: <05831c2f-668f-1386-2ba6-4ce623b50d49@kontron.de> (raw)
In-Reply-To: <edd64777-ff6a-82fd-63bb-7b2f31f63f44@geanix.com>

Hi Stefano,

this old patch was delegated to you in patchwork. If you're not the
correct maintainer to address, please let me know. As the NAND layer
seems to be unmaintained at the moment, I'm not sure whom to ask.

This patch fixes a regression that was introduced by 616f03dabacb ("
mtd: gpmi: change the BCH layout setting for large oob NAND") which
alters the BCH layout in a way that doesn't match with the
implementation in the Linux kernel.

This causes failures when loading an UBI image in U-Boot that was
flashed by Linux or vice versa (see [1]).

There has been an approach to fix this through an optional devicetree
property in 51cdf83eea ("mtd: gpmi: provide the option to use legacy bch
geometry"), but this is not acceptable. The "legacy" BCH layout
compatible with Linux should be used by default.

The approach to upstream the "new" layout to the kernel [2] seems to be
stalled and even if it would succeed, it would break systems that use an
old U-Boot and a new kernel, which is again not really acceptable in my
opinion.

For the reasons above I would like to ask U-Boot maintainers to pick up
this patch.

Thanks
Frieder

[1] https://lists.denx.de/pipermail/u-boot/2022-March/477828.html
[2]
https://patchwork.ozlabs.org/project/linux-mtd/patch/20210522205136.19465-2-han.xu@nxp.com/

Am 20.05.21 um 11:09 schrieb Sean Nyekjaer:
> On 13/05/2021 22.02, han.xu wrote:
>> On 21/05/11 07:08AM, Sean Nyekjaer wrote:
>>> Caution: EXT Email
>>>
>>> On 11/05/2021 04.49, han.xu wrote:
>>>> On 21/05/10 12:00PM, Sean Nyekjaer wrote:
>>>>> Caution: EXT Email
>>>>>
>>>>> Linux kernel defaults to use legacy bch setting, this was creating a
>>>>> mismatch between U-boot and Linux default settings.
>>>> Kernel uses the NAND chip specified minimum ecc strength and steps by default
>>>> not the legacy bch setting, unless users enable it in DT file.
>>>>
>>>
>>> Hi,
>>>
>>> Adding, mtd-list and Miquel
>>>
>>> With u-boot dtb:
>>> &gpmi {
>>>         pinctrl-names = "default";
>>>         pinctrl-0 = <&pinctrl_gpmi_nand1>;
>>>         compatible = "fsl,imx7d-gpmi-nand";
>>>         nand-on-flash-bbt;
>>>         status = "okay";
>>> };
>>>
>>> With linux dtb (mainline 5.10):
>>> &gpmi {
>>>         pinctrl-names = "default";
>>>         pinctrl-0 = <&pinctrl_gpmi_nand1>;
>>>         nand-on-flash-bbt;
>>>         status = "okay";
>>> };
>>>
>>> U-boot prior to commit 51cdf83eea selected 18 bit ECC, after that commit it selects 8 bits.
>>> With legacy option it selects 18.
>>> Linux is selecting 18 bits ;) So now we have a mismatch.
>>>
>>> I have been searching for the legacy option in the mainline kernel can't find it ;)
>>> Please show me where it is (is it in the NXP fork?)
>>
>> You are right, it's only fixed in NXP fork, with kernel driver modification. We
>> prefer the current u-boot bch geometry, so I will send out a kernel patch to
>> make them align.
>>
> Any progress on this?
> 
> I see your patch in:
> https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsource.codeaurora.org%2Fexternal%2Fimx%2Flinux-imx%2Fcommit%2Fdrivers%2Fmtd%2Fnand%2Fraw%2Fgpmi-nand%3Fh%3Dimx_5.4.70_2.3.0%26id%3Dae980dccc6189956fab047958ad0a70ec4951439&amp;data=04%7C01%7Cfrieder.schrempf%40kontron.de%7C275b7f11361e4fd3eb7e08d91b6f0e45%7C8c9d3c973fd941c8a2b1646f3942daf1%7C0%7C0%7C637570986066857865%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=L4xAN9HDl68dmA%2FX6nnP%2Buqh6CUKTQZJeFWja5EvmPI%3D&amp;reserved=0
> 
> But I can't find the option for selecting legacy mode in the devicetree...
> 
> /Sean

WARNING: multiple messages have this Message-ID (diff)
From: Frieder Schrempf <frieder.schrempf@kontron.de>
To: Stefano Babic <sbabic@denx.de>, Sean Nyekjaer <sean@geanix.com>
Cc: peng.fan@nxp.com, ye.li@nxp.com, alice.guo@nxp.com,
	sjg@chromium.org, seanga2@gmail.com, u-boot@lists.denx.de,
	miquel.raynal@bootlin.com,
	linux-mtd <linux-mtd@lists.infradead.org>,
	"han.xu" <han.xu@nxp.com>, Fabio Estevam <festevam@gmail.com>,
	Tim Harvey <tharvey@gateworks.com>,
	dl-uboot-imx <uboot-imx@nxp.com>
Subject: Re: [EXT] [PATCH] mtd: mxs_nand: default to legacy bch and rename to modern bch option
Date: Thu, 17 Mar 2022 14:24:58 +0100	[thread overview]
Message-ID: <05831c2f-668f-1386-2ba6-4ce623b50d49@kontron.de> (raw)
In-Reply-To: <edd64777-ff6a-82fd-63bb-7b2f31f63f44@geanix.com>

Hi Stefano,

this old patch was delegated to you in patchwork. If you're not the
correct maintainer to address, please let me know. As the NAND layer
seems to be unmaintained at the moment, I'm not sure whom to ask.

This patch fixes a regression that was introduced by 616f03dabacb ("
mtd: gpmi: change the BCH layout setting for large oob NAND") which
alters the BCH layout in a way that doesn't match with the
implementation in the Linux kernel.

This causes failures when loading an UBI image in U-Boot that was
flashed by Linux or vice versa (see [1]).

There has been an approach to fix this through an optional devicetree
property in 51cdf83eea ("mtd: gpmi: provide the option to use legacy bch
geometry"), but this is not acceptable. The "legacy" BCH layout
compatible with Linux should be used by default.

The approach to upstream the "new" layout to the kernel [2] seems to be
stalled and even if it would succeed, it would break systems that use an
old U-Boot and a new kernel, which is again not really acceptable in my
opinion.

For the reasons above I would like to ask U-Boot maintainers to pick up
this patch.

Thanks
Frieder

[1] https://lists.denx.de/pipermail/u-boot/2022-March/477828.html
[2]
https://patchwork.ozlabs.org/project/linux-mtd/patch/20210522205136.19465-2-han.xu@nxp.com/

Am 20.05.21 um 11:09 schrieb Sean Nyekjaer:
> On 13/05/2021 22.02, han.xu wrote:
>> On 21/05/11 07:08AM, Sean Nyekjaer wrote:
>>> Caution: EXT Email
>>>
>>> On 11/05/2021 04.49, han.xu wrote:
>>>> On 21/05/10 12:00PM, Sean Nyekjaer wrote:
>>>>> Caution: EXT Email
>>>>>
>>>>> Linux kernel defaults to use legacy bch setting, this was creating a
>>>>> mismatch between U-boot and Linux default settings.
>>>> Kernel uses the NAND chip specified minimum ecc strength and steps by default
>>>> not the legacy bch setting, unless users enable it in DT file.
>>>>
>>>
>>> Hi,
>>>
>>> Adding, mtd-list and Miquel
>>>
>>> With u-boot dtb:
>>> &gpmi {
>>>         pinctrl-names = "default";
>>>         pinctrl-0 = <&pinctrl_gpmi_nand1>;
>>>         compatible = "fsl,imx7d-gpmi-nand";
>>>         nand-on-flash-bbt;
>>>         status = "okay";
>>> };
>>>
>>> With linux dtb (mainline 5.10):
>>> &gpmi {
>>>         pinctrl-names = "default";
>>>         pinctrl-0 = <&pinctrl_gpmi_nand1>;
>>>         nand-on-flash-bbt;
>>>         status = "okay";
>>> };
>>>
>>> U-boot prior to commit 51cdf83eea selected 18 bit ECC, after that commit it selects 8 bits.
>>> With legacy option it selects 18.
>>> Linux is selecting 18 bits ;) So now we have a mismatch.
>>>
>>> I have been searching for the legacy option in the mainline kernel can't find it ;)
>>> Please show me where it is (is it in the NXP fork?)
>>
>> You are right, it's only fixed in NXP fork, with kernel driver modification. We
>> prefer the current u-boot bch geometry, so I will send out a kernel patch to
>> make them align.
>>
> Any progress on this?
> 
> I see your patch in:
> https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsource.codeaurora.org%2Fexternal%2Fimx%2Flinux-imx%2Fcommit%2Fdrivers%2Fmtd%2Fnand%2Fraw%2Fgpmi-nand%3Fh%3Dimx_5.4.70_2.3.0%26id%3Dae980dccc6189956fab047958ad0a70ec4951439&amp;data=04%7C01%7Cfrieder.schrempf%40kontron.de%7C275b7f11361e4fd3eb7e08d91b6f0e45%7C8c9d3c973fd941c8a2b1646f3942daf1%7C0%7C0%7C637570986066857865%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=L4xAN9HDl68dmA%2FX6nnP%2Buqh6CUKTQZJeFWja5EvmPI%3D&amp;reserved=0
> 
> But I can't find the option for selecting legacy mode in the devicetree...
> 
> /Sean

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2022-03-17 13:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10 10:00 [PATCH] mtd: mxs_nand: default to legacy bch and rename to modern bch option Sean Nyekjaer
2021-05-11  2:49 ` [EXT] " han.xu
2021-05-11  5:08   ` Sean Nyekjaer
2021-05-11  5:08     ` Sean Nyekjaer
2021-05-13 20:02     ` han.xu
2021-05-13 20:02       ` han.xu
2021-05-20  9:09       ` Sean Nyekjaer
2021-05-20  9:09         ` Sean Nyekjaer
2022-03-17 13:24         ` Frieder Schrempf [this message]
2022-03-17 13:24           ` Frieder Schrempf
2022-03-17 13:33           ` Han Xu
2022-03-17 13:54             ` Frieder Schrempf
2022-03-17 13:54               ` Frieder Schrempf
2022-03-21  8:34               ` Frieder Schrempf
2022-03-21 19:42                 ` Tim Harvey
2022-03-21 19:42                   ` Tim Harvey
2022-03-22 17:13                   ` Tim Harvey
2022-03-22 17:13                     ` Tim Harvey
2022-03-22 17:48                     ` Tim Harvey
2022-03-22 17:48                       ` Tim Harvey
2022-03-22 10:26           ` Stefano Babic
2022-03-22 10:26             ` Stefano Babic

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=05831c2f-668f-1386-2ba6-4ce623b50d49@kontron.de \
    --to=frieder.schrempf@kontron.de \
    --cc=alice.guo@nxp.com \
    --cc=festevam@gmail.com \
    --cc=han.xu@nxp.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=peng.fan@nxp.com \
    --cc=sbabic@denx.de \
    --cc=sean@geanix.com \
    --cc=seanga2@gmail.com \
    --cc=sjg@chromium.org \
    --cc=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    --cc=ye.li@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.