diff mbox series

[U-Boot,2/2] omap: Fix warning when looking for userdata part

Message ID 20170921225159.2546-2-semen.protsenko@linaro.org
State Accepted
Commit 268577669a01b9156d9d634f4314f5f56bdc031a
Delegated to: Tom Rini
Headers show
Series [U-Boot,1/2] disk: Provide API to get partition by name for specific type | expand

Commit Message

Sam Protsenko Sept. 21, 2017, 10:51 p.m. UTC
When eMMC was formattaed for Linux partition table, "userdata" partition
is missing. In this case, part_get_info_by_name() iterates over all
registered drivers (which are PART_TYPE_EFI, PART_TYPE_DOS and
PART_TYPE_ISO). And when it comes to PART_TYPE_ISO (which has empty
partition table), we can see next warning in U-Boot output:

    ** First descriptor is NOT a primary desc on 1:1 **

This patch switches to part_get_info_by_name_type() API in order to
check only EFI partitions for "userdata" partitions. This eliminates
mentioned warning.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
 arch/arm/mach-omap2/utils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Simon Glass Sept. 25, 2017, 2:14 a.m. UTC | #1
On 21 September 2017 at 16:51, Sam Protsenko <semen.protsenko@linaro.org> wrote:
> When eMMC was formattaed for Linux partition table, "userdata" partition
> is missing. In this case, part_get_info_by_name() iterates over all
> registered drivers (which are PART_TYPE_EFI, PART_TYPE_DOS and
> PART_TYPE_ISO). And when it comes to PART_TYPE_ISO (which has empty
> partition table), we can see next warning in U-Boot output:
>
>     ** First descriptor is NOT a primary desc on 1:1 **
>
> This patch switches to part_get_info_by_name_type() API in order to
> check only EFI partitions for "userdata" partitions. This eliminates
> mentioned warning.
>
> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
> ---
>  arch/arm/mach-omap2/utils.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini Oct. 7, 2017, 1:08 p.m. UTC | #2
On Fri, Sep 22, 2017 at 01:51:59AM +0300, Sam Protsenko wrote:

> When eMMC was formattaed for Linux partition table, "userdata" partition
> is missing. In this case, part_get_info_by_name() iterates over all
> registered drivers (which are PART_TYPE_EFI, PART_TYPE_DOS and
> PART_TYPE_ISO). And when it comes to PART_TYPE_ISO (which has empty
> partition table), we can see next warning in U-Boot output:
> 
>     ** First descriptor is NOT a primary desc on 1:1 **
> 
> This patch switches to part_get_info_by_name_type() API in order to
> check only EFI partitions for "userdata" partitions. This eliminates
> mentioned warning.
> 
> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/arch/arm/mach-omap2/utils.c b/arch/arm/mach-omap2/utils.c
index 3892853c7e..e36dd8398f 100644
--- a/arch/arm/mach-omap2/utils.c
+++ b/arch/arm/mach-omap2/utils.c
@@ -91,7 +91,8 @@  static u32 omap_mmc_get_part_size(const char *part)
 		return 0;
 	}
 
-	res = part_get_info_by_name(dev_desc, part, &info);
+	/* Check only for EFI (GPT) partition table */
+	res = part_get_info_by_name_type(dev_desc, part, &info, PART_TYPE_EFI);
 	if (res < 0)
 		return 0;