Re: [PATCH v12 3/3] mtd: Add driver for concatenating devices
From: Miquel Raynal
Date: Wed Mar 19 2025 - 04:21:30 EST
On 19/03/2025 at 06:17:50 GMT, "Mahapatra, Amit Kumar" <amit.kumar-mahapatra@xxxxxxx> wrote:
> [AMD Official Use Only - AMD Internal Distribution Only]
>
> Hello Miquel,
>
>> -----Original Message-----
>> From: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
>> Sent: Tuesday, March 18, 2025 9:23 PM
>> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@xxxxxxx>
>> Cc: richard@xxxxxx; vigneshr@xxxxxx; robh@xxxxxxxxxx; krzk+dt@xxxxxxxxxx;
>> conor+dt@xxxxxxxxxx; linux-mtd@xxxxxxxxxxxxxxxxxxx; devicetree@xxxxxxxxxxxxxxx;
>> linux-kernel@xxxxxxxxxxxxxxx; git (AMD-Xilinx) <git@xxxxxxx>;
>> amitrkcian2002@xxxxxxxxx; Bernhard Frauendienst <kernel@xxxxxxxxxxxxxxxxx>
>> Subject: Re: [PATCH v12 3/3] mtd: Add driver for concatenating devices
>>
>> On 05/02/2025 at 19:07:30 +0530, Amit Kumar Mahapatra <amit.kumar-
>> mahapatra@xxxxxxx> wrote:
>>
>> > Introducing CONFIG_VIRT_CONCAT to separate the legacy flow from the
>> > new
>>
>> CONFIG_MTD_VIRT_CONCAT
>>
>> > approach, where individual partitions within a concatenated partition
>> > are not registered, as they are likely not needed by the user.
>>
>> I am not a big fan of this choice. We had issues with hiding things to the user in the
>> first place. Could we find a way to expose both the original mtd devices as well as
>> the virtually concatenated partitions?
>
> Sure, I think that can be done, but I took this approach to hide the
> original devices because Boris mentioned in [1] that we are creating
> the original partitions even though the user probably doesn't need
> them. I believe he is right, as I can't think of any use case where
> the user would require the individual devices instead of the
> concatenated device.
>
> [1] https://lore.kernel.org/linux-mtd/20191209113506.41341ed4@xxxxxxxxxxxxx/
He was suggesting not to create the intermediate partitions, and I agree
it is not super relevant, but the flash devices themselves are relevant.
In this example:
concatenate = <&part2>, <&part3>;
flash@0 {
part1 { }
part2 { }
};
flash@0 {
part3 { }
part4 { }
};
part1, part2, part3, part4 are partitions, at least part1 and part4
should appear like mtd devices.
Boris was suggesting to not expose part2 and part3 individually when
concatenating them, I'm fine with that.
What I am saying, is that flash@0 and flash@1 shall be represented by
two mtd devices and not hidden/skipped.
Thanks,
Miquèl