<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/drivers/mtd/ubi, branch next</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>mtd: ubi: Remove test that always fails</title>
<updated>2025-10-08T09:34:12+00:00</updated>
<author>
<name>Andrew Goodbody</name>
<email>andrew.goodbody@linaro.org</email>
</author>
<published>2025-08-01T11:49:48+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=75b7ef1caf19d467ee8a7e69eb5eccb6a45e1715'/>
<id>75b7ef1caf19d467ee8a7e69eb5eccb6a45e1715</id>
<content type='text'>
When checking the VID header of a static volume there is an early test
for data_size == 0 so testing for that condition again is guaranteed to
fail. Just remove this piece of code.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When checking the VID header of a static volume there is an early test
for data_size == 0 so testing for that condition again is guaranteed to
fail. Just remove this piece of code.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: ubi: Put MTD device after it is not used</title>
<updated>2025-05-05T08:15:43+00:00</updated>
<author>
<name>Alexander Vickberg</name>
<email>wickbergster@gmail.com</email>
</author>
<published>2025-04-10T11:37:40+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c81d8efb51480b318f0bd0a3bdf2d5b0445bbbc9'/>
<id>c81d8efb51480b318f0bd0a3bdf2d5b0445bbbc9</id>
<content type='text'>
The MTD device reference is dropped via put_mtd_device, however its
field -&gt;index is read and passed to ubi_msg. To fix this, the patch
moves the reference dropping after calling ubi_msg.

Signed-off-by: Pan Bian &lt;bianpan2016@163.com&gt;
Reviewed-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;

Upstream Linux commit: b95f83ab762dd6211351b9140f99f43644076ca8

Signed-off-by: Alexander Vickberg &lt;wickbergster@gmail.com&gt;
Reviewed-by: Heiko Schocher &lt;hs@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The MTD device reference is dropped via put_mtd_device, however its
field -&gt;index is read and passed to ubi_msg. To fix this, the patch
moves the reference dropping after calling ubi_msg.

Signed-off-by: Pan Bian &lt;bianpan2016@163.com&gt;
Reviewed-by: Boris Brezillon &lt;boris.brezillon@bootlin.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;

Upstream Linux commit: b95f83ab762dd6211351b9140f99f43644076ca8

Signed-off-by: Alexander Vickberg &lt;wickbergster@gmail.com&gt;
Reviewed-by: Heiko Schocher &lt;hs@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge patch series "Annotate switch/case fallthrough cases"</title>
<updated>2025-04-08T22:24:12+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2025-04-08T22:24:12+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1f0281294d8bb1857076d27fd491c70c9808e474'/>
<id>1f0281294d8bb1857076d27fd491c70c9808e474</id>
<content type='text'>
Andre Przywara &lt;andre.przywara@arm.com&gt; says:

C's implicit fallthrough behaviour in switch/case statements can lead to
subtle bugs. Quite some while ago many compilers introduced warnings in
those cases, requiring intentional fallthrough's to be annotated.

So far we were not enabling that compiler option, so many ambiguities
and some bugs in the code went unnoticed.

This series adds the required annotations in code paths that the first
stage of the U-Boot CI covers. There is a large number of cases left
in the libbz2 code. The usage of switch/case is borderline insane there,
labels are hidden in macros, and there are no breaks, but just goto's.
Upstream still uses very similar code, without any annotations. I still
am not 100% sure those are meant to fall through or not, and plan to do
further investigations, but didn't want to hold the rest of the patches
back. You can see for yourself by applying patch 18/18 and building for
sandbox64, for instance.

Because of this we cannot quite enable the warning in the Makefile yet,
but those fixes are worth regardless, and be it to increase readability.

Please note that those patches do not fix anything, really, they just add
those fallthrough annotations, so the series is not really critical.

Link: https://lore.kernel.org/r/20250327153313.2105227-1-andre.przywara@arm.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Andre Przywara &lt;andre.przywara@arm.com&gt; says:

C's implicit fallthrough behaviour in switch/case statements can lead to
subtle bugs. Quite some while ago many compilers introduced warnings in
those cases, requiring intentional fallthrough's to be annotated.

So far we were not enabling that compiler option, so many ambiguities
and some bugs in the code went unnoticed.

This series adds the required annotations in code paths that the first
stage of the U-Boot CI covers. There is a large number of cases left
in the libbz2 code. The usage of switch/case is borderline insane there,
labels are hidden in macros, and there are no breaks, but just goto's.
Upstream still uses very similar code, without any annotations. I still
am not 100% sure those are meant to fall through or not, and plan to do
further investigations, but didn't want to hold the rest of the patches
back. You can see for yourself by applying patch 18/18 and building for
sandbox64, for instance.

Because of this we cannot quite enable the warning in the Makefile yet,
but those fixes are worth regardless, and be it to increase readability.

Please note that those patches do not fix anything, really, they just add
those fallthrough annotations, so the series is not really critical.

Link: https://lore.kernel.org/r/20250327153313.2105227-1-andre.przywara@arm.com
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: ubi: annotate fallthrough</title>
<updated>2025-04-08T22:23:51+00:00</updated>
<author>
<name>Andre Przywara</name>
<email>andre.przywara@arm.com</email>
</author>
<published>2025-03-27T15:33:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=64bc0124581b49093f5c348f5debe8889a56fedd'/>
<id>64bc0124581b49093f5c348f5debe8889a56fedd</id>
<content type='text'>
The UBI code uses an implicit switch/case fallthrough when handling two
related cases of bad header errors. Also there is a switch/case for unit
prefix handling (G/M/K), which accumulates multiplications.

Add our "fallthrough;" statement-like macro before the respective labels
in both cases, to avoid a warning when GCC's -Wimplicit-fallthrough
warning option is enabled.

Signed-off-by: Andre Przywara &lt;andre.przywara@arm.com&gt;
Reviewed-by: Heiko Schocher &lt;hs@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The UBI code uses an implicit switch/case fallthrough when handling two
related cases of bad header errors. Also there is a switch/case for unit
prefix handling (G/M/K), which accumulates multiplications.

Add our "fallthrough;" statement-like macro before the respective labels
in both cases, to avoid a warning when GCC's -Wimplicit-fallthrough
warning option is enabled.

Signed-off-by: Andre Przywara &lt;andre.przywara@arm.com&gt;
Reviewed-by: Heiko Schocher &lt;hs@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ubi: fix bug creating partitions for non-existent volumes</title>
<updated>2025-04-08T04:52:24+00:00</updated>
<author>
<name>Oskar Nilsson</name>
<email>onilsson@rums.se</email>
</author>
<published>2025-03-26T09:22:44+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3d1cc840a060cb2a00b4af0c70fc29e8c3cadf90'/>
<id>3d1cc840a060cb2a00b4af0c70fc29e8c3cadf90</id>
<content type='text'>
The part_get_info_ubi() function was incorrectly returning 0 (success)
when a UBI volume was not found for a given partition index. This caused
the part_create_block_devices() function in blk-uclass.c to continue
creating devices for non-existent partitions up to MAX_SEARCH_PARTITIONS

Fix the issue by returning -1 when a volume is not found, signaling to
the part_create_block_devices() function that no more valid volumes
exist.

Before patch, 128 blk_partition are created:
Class   Index  Probed  Driver        Name
-------------------------------------------------
root        0  [ + ]  root_driver    root_driver
thermal     0  [   ]  imx_thermal    |-- imx_thermal
simple_bus  0  [ + ]  simple_bus     |-- soc
mtd         0  [ + ]  mxs-nand-dt    |   |-- nand-controller@1806000
blk         0  [   ]  ubi_blk        |   |   `-- nand-controller@1806000.blk
partition   0  [   ]  blk_partition  |   |       |-- nand-controller@1806000.blk:1
...
partition 127  [   ]  blk_partition  |   |       `-- nand-controller@1806000.blk:128

After patch, the expected blk_partition are created:
Class   Index  Probed  Driver        Name
-------------------------------------------------
root        0  [ + ]  root_driver    root_driver
thermal     0  [   ]  imx_thermal    |-- imx_thermal
simple_bus  0  [ + ]  simple_bus     |-- soc
mtd         0  [ + ]  mxs-nand-dt    |   |-- nand-controller@1806000
blk         0  [   ]  ubi_blk        |   |   `-- nand-controller@1806000.blk
partition   0  [   ]  blk_partition  |   |       |-- nand-controller@1806000.blk:1
partition   1  [   ]  blk_partition  |   |       |-- nand-controller@1806000.blk:2
partition   2  [   ]  blk_partition  |   |       |-- nand-controller@1806000.blk:3
partition   3  [   ]  blk_partition  |   |       `-- nand-controller@1806000.blk:4
simple_bus  1  [ + ]  simple_bus     |   |-- bus@2000000

Signed-off-by: Oskar Nilsson &lt;onilsson@rums.se&gt;
Cc: Kyungmin Park &lt;kmpark@infradead.org&gt;
Cc: Heiko Schocher &lt;hs@denx.de&gt;
Cc: Alexey Romanov &lt;avromanov@salutedevices.com&gt;

Changed in v2:
 - Change return from -1 to -ENOENT
Reviewed-by: Heiko Schocher &lt;hs@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The part_get_info_ubi() function was incorrectly returning 0 (success)
when a UBI volume was not found for a given partition index. This caused
the part_create_block_devices() function in blk-uclass.c to continue
creating devices for non-existent partitions up to MAX_SEARCH_PARTITIONS

Fix the issue by returning -1 when a volume is not found, signaling to
the part_create_block_devices() function that no more valid volumes
exist.

Before patch, 128 blk_partition are created:
Class   Index  Probed  Driver        Name
-------------------------------------------------
root        0  [ + ]  root_driver    root_driver
thermal     0  [   ]  imx_thermal    |-- imx_thermal
simple_bus  0  [ + ]  simple_bus     |-- soc
mtd         0  [ + ]  mxs-nand-dt    |   |-- nand-controller@1806000
blk         0  [   ]  ubi_blk        |   |   `-- nand-controller@1806000.blk
partition   0  [   ]  blk_partition  |   |       |-- nand-controller@1806000.blk:1
...
partition 127  [   ]  blk_partition  |   |       `-- nand-controller@1806000.blk:128

After patch, the expected blk_partition are created:
Class   Index  Probed  Driver        Name
-------------------------------------------------
root        0  [ + ]  root_driver    root_driver
thermal     0  [   ]  imx_thermal    |-- imx_thermal
simple_bus  0  [ + ]  simple_bus     |-- soc
mtd         0  [ + ]  mxs-nand-dt    |   |-- nand-controller@1806000
blk         0  [   ]  ubi_blk        |   |   `-- nand-controller@1806000.blk
partition   0  [   ]  blk_partition  |   |       |-- nand-controller@1806000.blk:1
partition   1  [   ]  blk_partition  |   |       |-- nand-controller@1806000.blk:2
partition   2  [   ]  blk_partition  |   |       |-- nand-controller@1806000.blk:3
partition   3  [   ]  blk_partition  |   |       `-- nand-controller@1806000.blk:4
simple_bus  1  [ + ]  simple_bus     |   |-- bus@2000000

Signed-off-by: Oskar Nilsson &lt;onilsson@rums.se&gt;
Cc: Kyungmin Park &lt;kmpark@infradead.org&gt;
Cc: Heiko Schocher &lt;hs@denx.de&gt;
Cc: Alexey Romanov &lt;avromanov@salutedevices.com&gt;

Changed in v2:
 - Change return from -1 to -ENOENT
Reviewed-by: Heiko Schocher &lt;hs@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: Correct dependency of BLK</title>
<updated>2025-01-21T01:26:54+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2025-01-15T01:22:12+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=09cf5800295517b2e1d09878245aaa317d02781f'/>
<id>09cf5800295517b2e1d09878245aaa317d02781f</id>
<content type='text'>
In the case of MTD_BLOCK and UBI_BLOCK they should be select'ing BLK as
they provide block device functionality and not depending on some other
block device already being enabled too (as is the typical case).

Reviewed-by: Quentin Schulz &lt;quentin.schulz@cherry.de&gt;
Reviewed-by: Peter Robinson &lt;pbrobinson@gmail.com&gt;
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the case of MTD_BLOCK and UBI_BLOCK they should be select'ing BLK as
they provide block device functionality and not depending on some other
block device already being enabled too (as is the typical case).

Reviewed-by: Quentin Schulz &lt;quentin.schulz@cherry.de&gt;
Reviewed-by: Peter Robinson &lt;pbrobinson@gmail.com&gt;
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: ubi: Do not zero out EC and VID on ECC-ed NOR flashes</title>
<updated>2024-10-15T14:57:49+00:00</updated>
<author>
<name>Takahiro Kuwano</name>
<email>Takahiro.Kuwano@infineon.com</email>
</author>
<published>2024-10-15T04:08:31+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6d7a8bf8c03343868d858b1cdb2ab737aabfca66'/>
<id>6d7a8bf8c03343868d858b1cdb2ab737aabfca66</id>
<content type='text'>
For NOR flashes EC and VID are zeroed out before an erase is issued to
make sure UBI does not mistakenly treat the PEB as used and associate it
with an LEB.

But on some flashes, like the Infineon Semper NOR flash family,
multi-pass page programming is not allowed on the default ECC scheme.
This means zeroing out these magic numbers will result in the flash
throwing a page programming error.

Do not zero out EC and VID for such flashes. A writesize &gt; 1 is an
indication of an ECC-ed flash.

This patch replicates the following upstream linux commit:
f669e74be820 ("ubi: Do not zero out EC and VID on ECC-ed NOR flashes")

Acked-by: Tudor Ambarus &lt;tudor.ambarus@linaro.org&gt;
Acked-by: Pratyush Yadav &lt;pratyush@kernel.org&gt;
Signed-off-by: Takahiro Kuwano &lt;Takahiro.Kuwano@infineon.com&gt;
Reviewed-by: Tudor Ambarus &lt;tudor.ambarus@microchip.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For NOR flashes EC and VID are zeroed out before an erase is issued to
make sure UBI does not mistakenly treat the PEB as used and associate it
with an LEB.

But on some flashes, like the Infineon Semper NOR flash family,
multi-pass page programming is not allowed on the default ECC scheme.
This means zeroing out these magic numbers will result in the flash
throwing a page programming error.

Do not zero out EC and VID for such flashes. A writesize &gt; 1 is an
indication of an ECC-ed flash.

This patch replicates the following upstream linux commit:
f669e74be820 ("ubi: Do not zero out EC and VID on ECC-ed NOR flashes")

Acked-by: Tudor Ambarus &lt;tudor.ambarus@linaro.org&gt;
Acked-by: Pratyush Yadav &lt;pratyush@kernel.org&gt;
Signed-off-by: Takahiro Kuwano &lt;Takahiro.Kuwano@infineon.com&gt;
Reviewed-by: Tudor Ambarus &lt;tudor.ambarus@microchip.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>list: use list_count_nodes() to count list entries</title>
<updated>2024-08-30T19:51:38+00:00</updated>
<author>
<name>Sughosh Ganu</name>
<email>sughosh.ganu@linaro.org</email>
</author>
<published>2024-08-28T16:54:22+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=be222ac029c31b38ffdfdc135ced8b5a40b8216b'/>
<id>be222ac029c31b38ffdfdc135ced8b5a40b8216b</id>
<content type='text'>
Use the API function list_count_nodes() to count the number of list
entries.

Signed-off-by: Sughosh Ganu &lt;sughosh.ganu@linaro.org&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the API function list_count_nodes() to count the number of list
entries.

Signed-off-by: Sughosh Ganu &lt;sughosh.ganu@linaro.org&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'u-boot-nand-20240808' of https://source.denx.de/u-boot/custodians/u-boot-nand-flash</title>
<updated>2024-08-08T22:15:06+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2024-08-08T13:59:47+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=eb8e25c000d185ece0136b13cca73084eb980253'/>
<id>eb8e25c000d185ece0136b13cca73084eb980253</id>
<content type='text'>
This series adds support for the UBI block device, which allows to read/write
data block by block. The series was tested by Alexey Romanov on SPI NAND.

The patches pass the pipeline CI:
https://source.denx.de/u-boot/custodians/u-boot-nand-flash/-/pipelines/21933
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This series adds support for the UBI block device, which allows to read/write
data block by block. The series was tested by Alexey Romanov on SPI NAND.

The patches pass the pipeline CI:
https://source.denx.de/u-boot/custodians/u-boot-nand-flash/-/pipelines/21933
</pre>
</div>
</content>
</entry>
<entry>
<title>disk: support UBI partitions</title>
<updated>2024-08-08T07:28:05+00:00</updated>
<author>
<name>Alexey Romanov</name>
<email>avromanov@salutedevices.com</email>
</author>
<published>2024-07-18T05:45:27+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=aa5b67ce226267440e64fadc57d3a21e5842027c'/>
<id>aa5b67ce226267440e64fadc57d3a21e5842027c</id>
<content type='text'>
UBI partition is abstraction over UBI volumes.
Can be used by UBI block device.

Signed-off-by: Alexey Romanov &lt;avromanov@salutedevices.com&gt;
Reviewed-by: Heiko Schocher &lt;hs@denx.de&gt;
Signed-off-by: Michael Trimarchi &lt;michael@amarulasolutions.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
UBI partition is abstraction over UBI volumes.
Can be used by UBI block device.

Signed-off-by: Alexey Romanov &lt;avromanov@salutedevices.com&gt;
Reviewed-by: Heiko Schocher &lt;hs@denx.de&gt;
Signed-off-by: Michael Trimarchi &lt;michael@amarulasolutions.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
