summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorOskar Nilsson <onilsson@rums.se>2025-03-26 10:22:44 +0100
committerHeiko Schocher <hs@denx.de>2025-04-08 06:52:24 +0200
commit3d1cc840a060cb2a00b4af0c70fc29e8c3cadf90 (patch)
tree6ee38291b30ddad09c6165acffbfadc300ee8479 /tools
parent34820924edbc4ec7803eb89d9852f4b870fa760a (diff)
ubi: fix bug creating partitions for non-existent volumes
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 <onilsson@rums.se> Cc: Kyungmin Park <kmpark@infradead.org> Cc: Heiko Schocher <hs@denx.de> Cc: Alexey Romanov <avromanov@salutedevices.com> Changed in v2: - Change return from -1 to -ENOENT Reviewed-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions