Re: [PATCH v7 01/12] mtd: core: always create master device

From: Miquel Raynal
Date: Tue Apr 01 2025 - 11:00:55 EST


Hello Alexander,

On 26/03/2025 at 17:26:12 +02, Alexander Usyskin <alexander.usyskin@xxxxxxxxx> wrote:

> Create master device without partition when
> CONFIG_MTD_PARTITIONED_MASTER flag is unset.
>
> This streamlines device tree and allows to anchor
> runtime power management on master device in all cases.
>
> Signed-off-by: Alexander Usyskin <alexander.usyskin@xxxxxxxxx>

I successfully tested it, this patch will be applied at -rc1 to the
mtd/next tree.

I was wondering, do you think it would be possible to keep the creation
of mtd_master and make it a symbolic link to mtdx when
MTD_PARTITIONED_MASTER=y or when there is no partition? In short, always
having mtd_masterx, because I fear at some point we'll have problems
otherwise :-)

Right now we have:

- Without partition:
mtd0 (mtd0ro mtdblock0)
- With partition and MTD_PARTITIONED_MASTER=n
mtd0 (mtd0ro mtdblock0)
mtd_master0
- With partition and MTD_PARTITIONED_MASTER=y
mtd0 (mtd0ro mtdblock0) [this is the master]
mtd1 (mtd1ro mtdblock1)

I am suggesting:
- Without partition:
mtd0 (mtd0ro mtdblock0)
mtd_master0 -> link to mtd0
- With partition and MTD_PARTITIONED_MASTER=n
mtd0 (mtd0ro mtdblock0)
mtd_master0
- With partition and MTD_PARTITIONED_MASTER=y
mtd0 (mtd0ro mtdblock0) [this is the master]
mtd1 (mtd1ro mtdblock1)
mtd_master0 -> link to mtd0

What do you think? Or maybe even always mtd_master in the first place.

Richard, your point of view on this?

Thanks,
Miquèl