RE: [PATCH v6 01/11] mtd: core: always create master device

Usyskin, Alexander
2025-06-10T11:34:37Z

> Subject: Re: [PATCH v6 01/11] mtd: core: always create master device
>
> ----- Ursprüngliche Mail -----
> > Von: "Guenter Roeck" <linux@roeck-us.net>
> >>> I am trying to boot from "pnor". It looks like the partition data (from
> >>> devicetree)
> >>> is now ignored. mtdblock6 used to be the second flash.
> >>>
> >>> Guenter
> >>
> >> Is this with CONFIG_MTD_PARTITIONED_MASTER?
> >>
> >
> > Yes
> >
> >> I think that mtd_is_partition is ambiguous now.
> >> We always have master partition when
> CONFIG_MTD_PARTITIONED_MASTER
> >> is enabled and parent check is useless.
> >> We must check grandparent in this case.
> >> Miquel, am I right?
> >>
> >> We can return to older patch version that have created partition
> >> instead of the master device.
> >> Or try to fix mtd_is_partition, like below.
> >> Guenter, is below patch helps?
> >>
> > No, it does not make a difference. Partitions are still not created.
>
> Looks like all partition parsing is broken when
> CONFIG_MTD_PARTITIONED_MASTER=y is set.
> Alexander, I was able to reproduce with MTDRAM and the mtdparts= kernel
> parameter.
> Build with CONFIG_MTD_MTDRAM=y and
> CONFIG_MTD_PARTITIONED_MASTER=y,
> pass mtdparts=\"mtdram test device:256k(foo)ro,-(bar)\" to the kernel
> command line.
>
> Before your change:
> $ cat /proc/mtd
> dev: size erasesize name
> mtd0: 00400000 00020000 "mtdram test device"
> mtd1: 00040000 00020000 "foo"
> mtd2: 003c0000 00020000 "bar"
>
> After:
> $ cat /proc/mtd
> dev: size erasesize name
> mtd0: 00400000 00020000 "mtdram test device"
>
> Hope this helps!
>
> Thanks,
> //Richard

Richard, I've reproduced your setup (modulo that I must load mtdram manually)
and patch provided in this thread helps to fix the issue.
Can you apply and confirm?

Guenter, as patch not helping and I'm not sure how to reproduce it locally,
can you add drivers/mtd to dynamic debug and collect dmesg for good
and bad cases?
If you have some explanation how to run qemu-system-arm I'll
be glad to try to reproduce it locally.

- -
Thanks,
Sasha