[PATCH v2] cmd: mtd: check if a block has to be skipped or erased

Simon Glass sjg at chromium.org
Wed Oct 26 01:35:21 CEST 2022


Hi,

On Mon, 24 Oct 2022 at 03:35, Dario Binacchi
<dario.binacchi at amarulasolutions.com> wrote:
>
> From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
>
> As reported by patch [1], the `mtd erase' command should not erase bad
> blocks.
> To force bad block erasing you have to use the `mtd erase.dontskipbad'
> command.
>
> This patch tries to fix the same issue without modifying code taken
> from the linux kernel, in order to make further upgrades easier.
>
> [1] https://lore.kernel.org/all/20221006031501.110290-2-mikhail.kshevetskiy@iopsys.eu/
> Suggested-by: Michael Trimarchi <michael at amarulasolutions.com>
> Co-developed-by: Michael Trimarchi <michael at amarulasolutions.com>
> Signed-off-by: Michael Trimarchi <michael at amarulasolutions.com>
> Co-developed-by: Dario Binacchi <dario.binacchi at amarulasolutions.com>
> Signed-off-by: Dario Binacchi <dario.binacchi at amarulasolutions.com>
> Tested-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
> Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
>
> ---
>
> Changes in v2:
> - Change the commit author
> - Do not continue to erase if scrub option is enabled and a bad block
>   was found but return from the function.
> - Update the patch tags.
>
>  cmd/mtd.c | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)

Can we get some tests in test/dm/mtd.c?

Regards,
Simon


More information about the U-Boot mailing list