<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/mtd/mtd_virt_concat.c, branch master</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>mtd: concat: replace alloc + calloc with 1 alloc</title>
<updated>2026-03-11T15:23:57+00:00</updated>
<author>
<name>Rosen Penev</name>
<email>rosenp@gmail.com</email>
</author>
<published>2026-03-05T22:44:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e19eaffc5213fdd6179e849d3032929fae0d8c2c'/>
<id>e19eaffc5213fdd6179e849d3032929fae0d8c2c</id>
<content type='text'>
A flex array can be used to reduce the allocation to 1.

And actually mtdconcat was using the pointer + 1 trick to point to the
overallocated area. Better alternatives exist.

Signed-off-by: Rosen Penev &lt;rosenp@gmail.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A flex array can be used to reduce the allocation to 1.

And actually mtdconcat was using the pointer + 1 trick to point to the
overallocated area. Better alternatives exist.

Signed-off-by: Rosen Penev &lt;rosenp@gmail.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: virt_concat: use single allocation for node</title>
<updated>2026-03-11T15:23:56+00:00</updated>
<author>
<name>Rosen Penev</name>
<email>rosenp@gmail.com</email>
</author>
<published>2026-03-05T22:44:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c685e6e8d88d544e8c4429b06c3e6795cbba32dd'/>
<id>c685e6e8d88d544e8c4429b06c3e6795cbba32dd</id>
<content type='text'>
Simpler to reason about and avoids having to free nodes separately.

Also add __counted_by attribute for extra runtime analysis.

Signed-off-by: Rosen Penev &lt;rosenp@gmail.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Simpler to reason about and avoids having to free nodes separately.

Also add __counted_by attribute for extra runtime analysis.

Signed-off-by: Rosen Penev &lt;rosenp@gmail.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: virt_concat: fix kdoc text</title>
<updated>2026-03-11T15:23:44+00:00</updated>
<author>
<name>Luca Ceresoli</name>
<email>luca.ceresoli@bootlin.com</email>
</author>
<published>2026-03-09T21:17:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=87d8f1285470b3c8367880993113ea604d365e33'/>
<id>87d8f1285470b3c8367880993113ea604d365e33</id>
<content type='text'>
The function name in the kdoc comment is different from the name of the
function being documented, fix it.

Fixes: 43db6366fc2d ("mtd: Add driver for concatenating devices")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Closes: https://lore.kernel.org/oe-kbuild-all/202603041232.fNDHNtUa-lkp@intel.com/
Signed-off-by: Luca Ceresoli &lt;luca.ceresoli@bootlin.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The function name in the kdoc comment is different from the name of the
function being documented, fix it.

Fixes: 43db6366fc2d ("mtd: Add driver for concatenating devices")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Closes: https://lore.kernel.org/oe-kbuild-all/202603041232.fNDHNtUa-lkp@intel.com/
Signed-off-by: Luca Ceresoli &lt;luca.ceresoli@bootlin.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: Add driver for concatenating devices</title>
<updated>2026-02-25T16:34:20+00:00</updated>
<author>
<name>Amit Kumar Mahapatra</name>
<email>amit.kumar-mahapatra@amd.com</email>
</author>
<published>2026-02-04T08:32:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=43db6366fc2de02050e66389f5628d3fdc9af10a'/>
<id>43db6366fc2de02050e66389f5628d3fdc9af10a</id>
<content type='text'>
Introducing CONFIG_MTD_VIRT_CONCAT to separate the legacy flow from the new
approach, where only the concatenated partition is registered as an MTD
device, while the individual partitions that form it are not registered
independently, as they are typically not required by the user.
CONFIG_MTD_VIRT_CONCAT is a boolean configuration option that depends on
CONFIG_MTD_PARTITIONED_MASTER. When enabled, it allows flash nodes to be
exposed as individual MTD devices along with the other partitions.

The solution focuses on fixed-partitions description only as it depends on
device boundaries. It supports multiple sets of concatenated devices, each
comprising two or more partitions.

    flash@0 {
            reg = &lt;0&gt;;
            partitions {
                    compatible = "fixed-partitions";

                    part0@0 {
                            part-concat-next = &lt;&amp;flash0_part1&gt;;
                            label = "part0_0";
                            reg = &lt;0x0 0x800000&gt;;
                    };

                    flash0_part1: part1@800000 {
                            label = "part0_1";
                            reg = &lt;800000 0x800000&gt;;
                    };

                    part2@1000000 {
                            part-concat-next = &lt;&amp;flash1_part0&gt;;
                            label = "part0_2";
                            reg = &lt;0x800000 0x800000&gt;;
                    };
            };
    };

    flash@1 {
            reg = &lt;1&gt;;
            partitions {
                    compatible = "fixed-partitions";

                    flash1_part0: part1@0 {
                            label = "part1_0";
                            reg = &lt;0x0 0x800000&gt;;
                    };

                    part1@800000 {
                            label = "part1_1";
                            reg = &lt;0x800000 0x800000&gt;;
                    };
            };
    };

The partitions that gets created are

flash@0
part0_0-part0_1-concat
flash@1
part1_1
part0_2-part1_0-concat

Suggested-by: Bernhard Frauendienst &lt;kernel@nospam.obeliks.de&gt;
Suggested-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Signed-off-by: Amit Kumar Mahapatra &lt;amit.kumar-mahapatra@amd.com&gt;
Signed-off-by: Luca Ceresoli &lt;luca.ceresoli@bootlin.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introducing CONFIG_MTD_VIRT_CONCAT to separate the legacy flow from the new
approach, where only the concatenated partition is registered as an MTD
device, while the individual partitions that form it are not registered
independently, as they are typically not required by the user.
CONFIG_MTD_VIRT_CONCAT is a boolean configuration option that depends on
CONFIG_MTD_PARTITIONED_MASTER. When enabled, it allows flash nodes to be
exposed as individual MTD devices along with the other partitions.

The solution focuses on fixed-partitions description only as it depends on
device boundaries. It supports multiple sets of concatenated devices, each
comprising two or more partitions.

    flash@0 {
            reg = &lt;0&gt;;
            partitions {
                    compatible = "fixed-partitions";

                    part0@0 {
                            part-concat-next = &lt;&amp;flash0_part1&gt;;
                            label = "part0_0";
                            reg = &lt;0x0 0x800000&gt;;
                    };

                    flash0_part1: part1@800000 {
                            label = "part0_1";
                            reg = &lt;800000 0x800000&gt;;
                    };

                    part2@1000000 {
                            part-concat-next = &lt;&amp;flash1_part0&gt;;
                            label = "part0_2";
                            reg = &lt;0x800000 0x800000&gt;;
                    };
            };
    };

    flash@1 {
            reg = &lt;1&gt;;
            partitions {
                    compatible = "fixed-partitions";

                    flash1_part0: part1@0 {
                            label = "part1_0";
                            reg = &lt;0x0 0x800000&gt;;
                    };

                    part1@800000 {
                            label = "part1_1";
                            reg = &lt;0x800000 0x800000&gt;;
                    };
            };
    };

The partitions that gets created are

flash@0
part0_0-part0_1-concat
flash@1
part1_1
part0_2-part1_0-concat

Suggested-by: Bernhard Frauendienst &lt;kernel@nospam.obeliks.de&gt;
Suggested-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Signed-off-by: Amit Kumar Mahapatra &lt;amit.kumar-mahapatra@amd.com&gt;
Signed-off-by: Luca Ceresoli &lt;luca.ceresoli@bootlin.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
