u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] cmd: usb_mass_storage: Use part_get_info_by_dev_and_name_or_num
@ 2021-07-08 17:36 Sean Anderson
  2021-07-08 18:00 ` Marek Vasut
  0 siblings, 1 reply; 6+ messages in thread
From: Sean Anderson @ 2021-07-08 17:36 UTC (permalink / raw)
  To: u-boot, Marek Vasut
  Cc: Andre Przywara, Maxime Ripard, Lukasz Majewski, Marek Szyprowski,
	Jagan Teki, 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

to expose four LUNs for each of the four default eMMC hardware
partitions. Note that the comma syntax was already present.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
---

Changes in v2:
- Reword commit message to include an example

 cmd/usb_mass_storage.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmd/usb_mass_storage.c b/cmd/usb_mass_storage.c
index 14fa7233c7..d4e619b842 100644
--- a/cmd/usb_mass_storage.c
+++ b/cmd/usb_mass_storage.c
@@ -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;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] cmd: usb_mass_storage: Use part_get_info_by_dev_and_name_or_num
  2021-07-08 17:36 [PATCH v2] cmd: usb_mass_storage: Use part_get_info_by_dev_and_name_or_num Sean Anderson
@ 2021-07-08 18:00 ` Marek Vasut
  2021-07-08 18:02   ` Sean Anderson
  0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2021-07-08 18:00 UTC (permalink / raw)
  To: Sean Anderson, u-boot
  Cc: Andre Przywara, Maxime Ripard, Lukasz Majewski, Marek Szyprowski,
	Jagan Teki, Wolfgang Denk

On 7/8/21 7:36 PM, Sean Anderson wrote:
> 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 ?

> 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 ?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] cmd: usb_mass_storage: Use part_get_info_by_dev_and_name_or_num
  2021-07-08 18:00 ` Marek Vasut
@ 2021-07-08 18:02   ` Sean Anderson
  2021-07-22 18:24     ` Sean Anderson
  0 siblings, 1 reply; 6+ messages in thread
From: Sean Anderson @ 2021-07-08 18:02 UTC (permalink / raw)
  To: Marek Vasut, u-boot
  Cc: Andre Przywara, Maxime Ripard, Lukasz Majewski, Marek Szyprowski,
	Jagan Teki, Wolfgang Denk



On 7/8/21 2:00 PM, Marek Vasut wrote:
> On 7/8/21 7:36 PM, Sean Anderson wrote:
>> 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.

>
>> 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.

> Is the current syntax still supported ?

Yes. This is completely backward-compatible.

--Sean

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] cmd: usb_mass_storage: Use part_get_info_by_dev_and_name_or_num
  2021-07-08 18:02   ` Sean Anderson
@ 2021-07-22 18:24     ` Sean Anderson
  2021-10-28 19:43       ` Sean Anderson
  0 siblings, 1 reply; 6+ messages in thread
From: Sean Anderson @ 2021-07-22 18:24 UTC (permalink / raw)
  To: Marek Vasut, u-boot
  Cc: Andre Przywara, Maxime Ripard, Lukasz Majewski, Marek Szyprowski,
	Jagan Teki, Wolfgang Denk



On 7/8/21 2:02 PM, Sean Anderson wrote:
> 
> 
> On 7/8/21 2:00 PM, Marek Vasut wrote:
>> On 7/8/21 7:36 PM, Sean Anderson wrote:
>>> 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.
> 
>>
>>> 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.

Upon closer inspection, the partition syntax is actually already documented. This patch just brings the command in-line with what is documented.

--Sean

> 
>> Is the current syntax still supported ?
> 
> Yes. This is completely backward-compatible.
> 
> --Sean

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] cmd: usb_mass_storage: Use part_get_info_by_dev_and_name_or_num
  2021-07-22 18:24     ` Sean Anderson
@ 2021-10-28 19:43       ` Sean Anderson
  2021-10-29  8:40         ` Marek Vasut
  0 siblings, 1 reply; 6+ messages in thread
From: Sean Anderson @ 2021-10-28 19:43 UTC (permalink / raw)
  To: Marek Vasut, u-boot
  Cc: Andre Przywara, Maxime Ripard, Lukasz Majewski, Marek Szyprowski,
	Jagan Teki, Wolfgang Denk

Hi Marek,

On 7/22/21 2:24 PM, Sean Anderson wrote:
>
>
> On 7/8/21 2:02 PM, Sean Anderson wrote:
>>
>>
>> On 7/8/21 2:00 PM, Marek Vasut wrote:
>>> On 7/8/21 7:36 PM, Sean Anderson wrote:
>>>> 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.
>>
>>>
>>>> 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.
>
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] cmd: usb_mass_storage: Use part_get_info_by_dev_and_name_or_num
  2021-10-28 19:43       ` Sean Anderson
@ 2021-10-29  8:40         ` Marek Vasut
  0 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2021-10-29  8:40 UTC (permalink / raw)
  To: Sean Anderson, u-boot
  Cc: Andre Przywara, Maxime Ripard, Lukasz Majewski, Marek Szyprowski,
	Jagan Teki, Wolfgang Denk

On 10/28/21 9:43 PM, Sean Anderson wrote:
> Hi Marek,
> 
> On 7/22/21 2:24 PM, Sean Anderson wrote:
>>
>>
>> On 7/8/21 2:02 PM, Sean Anderson wrote:
>>>
>>>
>>> On 7/8/21 2:00 PM, Marek Vasut wrote:
>>>> On 7/8/21 7:36 PM, Sean Anderson wrote:
>>>>> 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.
>>>
>>>>
>>>>> 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.
>>
>> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-29  8:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-08 17:36 [PATCH v2] cmd: usb_mass_storage: Use part_get_info_by_dev_and_name_or_num Sean Anderson
2021-07-08 18:00 ` Marek Vasut
2021-07-08 18:02   ` Sean Anderson
2021-07-22 18:24     ` Sean Anderson
2021-10-28 19:43       ` Sean Anderson
2021-10-29  8:40         ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).