cmd: usb_mass_storage: Use part_get_info_by_dev_and_name_or_num
PATCH v2 1/1 cmd: usb_mass_storage: Use part_get_info_by_dev_and_name_or_num
This allows specifying partitions using more extended syntax. This is particularly useful to access eMMC hardware partitions. For example, this allows something like
ums mmc 0.0,0.1,0.2,0.3
to expose four LUNs for each of the four default eMMC hardware partitions. Note that the comma syntax was already present.
---
Changes in v2:
- Reword commit message to include an example
cmd/usb_mass_storage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
cmd/usb_mass_storage.c +2 -2
@@ -74,8 +74,8 @@ static int ums_init(const char *devtype, const char *devnums_part_str)if (!devnum_part_str)break ; - partnum =blk_get_device_part_str (devtype, devnum_part_str, - &block_dev, &info,1 ); + partnum =part_get_info_by_dev_and_name_or_num (devtype, devnum_part_str, + &block_dev, &info,1 );if (partnum <0 ) goto cleanup;
Signature · 1 line
2.25.1
Quoted 5 lines · Sean Anderson
This allows specifying partitions using more extended syntax. This is particularly useful to access eMMC hardware partitions. For example, this allows something like
ums mmc 0.0,0.1,0.2,0.3
Shouldn't that be ums X mmc Y ?
Quoted 2 lines
to expose four LUNs for each of the four default eMMC hardware partitions. Note that the comma syntax was already present.
That's all good, but is there some specification of the syntax somewhere instead of a random example ?
Is the current syntax still supported ?
Quoted 8 lines · Marek Vasut
Quoted 5 lines · Sean Anderson
This allows specifying partitions using more extended syntax. This is particularly useful to access eMMC hardware partitions. For example, this allows something like
ums mmc 0.0,0.1,0.2,0.3Shouldn't that be ums X mmc Y ?
Yes.
Quoted 5 lines
Quoted 3 lines
to expose four LUNs for each of the four default eMMC hardware partitions. Note that the comma syntax was already present.
That's all good, but is there some specification of the syntax somewhere instead of a random example ?\
Yes, see https://u-boot.readthedocs.io/en/latest/usage/partitions.html
I suppose that https://u-boot.readthedocs.io/en/latest/usage/ums.html
should be updated as well, especially since the comma syntax is undocumented.
Quoted 1 line
Is the current syntax still supported ?
Yes. This is completely backward-compatible.
--Sean
Quoted 18 lines · Sean Anderson
Quoted 8 lines · Marek Vasut
Quoted 5 lines · Sean Anderson
This allows specifying partitions using more extended syntax. This is particularly useful to access eMMC hardware partitions. For example, this allows something like
ums mmc 0.0,0.1,0.2,0.3
Shouldn't that be ums X mmc Y ?
Yes.
Quoted 4 lines
Quoted 3 lines
to expose four LUNs for each of the four default eMMC hardware partitions. Note that the comma syntax was already present.
Quoted 7 lines
Quoted 1 line
That's all good, but is there some specification of the syntax somewhere instead of a random example ?\
Yes, see https://u-boot.readthedocs.io/en/latest/usage/partitions.html
I suppose that https://u-boot.readthedocs.io/en/latest/usage/ums.html
should be updated as well, especially since the comma syntax is undocumented.
Upon closer inspection, the partition syntax is actually already documented. This patch just brings the command in-line with what is documented.
--Sean
Quoted 6 lines
Quoted 2 lines
Is the current syntax still supported ?
Yes. This is completely backward-compatible.
--Sean
Hi Marek,
Quoted 23 lines · Sean Anderson
Quoted 20 lines · Sean Anderson
Quoted 8 lines · Marek Vasut
Quoted 5 lines · Sean Anderson
This allows specifying partitions using more extended syntax. This is particularly useful to access eMMC hardware partitions. For example, this allows something like
ums mmc 0.0,0.1,0.2,0.3Shouldn't that be ums X mmc Y ?
Yes.
Quoted 5 lines
Quoted 3 lines
to expose four LUNs for each of the four default eMMC hardware partitions. Note that the comma syntax was already present.
That's all good, but is there some specification of the syntax somewhere instead of a random example ?\
Quoted 7 lines
Quoted 5 lines
Yes, see https://u-boot.readthedocs.io/en/latest/usage/partitions.html
I suppose that https://u-boot.readthedocs.io/en/latest/usage/ums.html
should be updated as well, especially since the comma syntax is undocumented.Upon closer inspection, the partition syntax is actually already documented. This patch just brings the command in-line with what is documented.
Does this patch need any additional modifications? As stated above, this new behavior is actually what is already documented.
--Sean
Quoted 28 lines · Sean Anderson
Hi Marek,
Quoted 25 lines · Sean Anderson
Quoted 22 lines · Sean Anderson
Quoted 8 lines · Marek Vasut
Quoted 5 lines · Sean Anderson
This allows specifying partitions using more extended syntax. This is particularly useful to access eMMC hardware partitions. For example, this allows something like
ums mmc 0.0,0.1,0.2,0.3
Shouldn't that be ums X mmc Y ?
Yes.
Quoted 5 lines
Quoted 3 lines
to expose four LUNs for each of the four default eMMC hardware partitions. Note that the comma syntax was already present.
That's all good, but is there some specification of the syntax somewhere instead of a random example ?\
Yes, see https://u-boot.readthedocs.io/en/latest/usage/partitions.html
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
I suppose that https://u-boot.readthedocs.io/en/latest/usage/ums.html
should be updated as well, especially since the comma syntax is undocumented.Upon closer inspection, the partition syntax is actually already documented. This patch just brings the command in-line with what is documented.
Does this patch need any additional modifications? As stated above, this new behavior is actually what is already documented.
Update the commit message so the example isn't wrong (i.e. ums X mmc y).
Validate that "ums 0 mmc 0" still works for exporting the entire block device, if it does, then I can pick it.
Thanks