[U-Boot] [PATCH 1/1] efi_loader: disk: iterate only over valid block devices
Andreas Färber
afaerber at suse.de
Tue Jun 20 19:39:45 UTC 2017
Am 20.06.2017 um 21:10 schrieb Heinrich Schuchardt:
> The efi_loader currently stops iterating over the available
> block devices stopping at the first device that fails.
> This may imply that no block device is found.
>
> With the patch efi_loader only iterates over valid devices.
>
> It is based on patch
> 06d592bf52f6 (dm: core: Add uclass_first/next_device_check())
> which is currently in u-boot-dm.git.
>
> For testing I used an odroid-c2 with a dts including
> &sd_emmc_a {
> status = "okay";
> };
> This device does not exist on the board and cannot be initialized.
>
> Without the patch:
>
> => bootefi hello
> ## Starting EFI application at 01000000 ...
> WARNING: Invalid device tree, expect boot to fail
> mmc_init: -95, time 1806
> Found 0 disks
> Hello, world!
> ## Application terminated, r = 0
>
> With the patch:
>
> => bootefi hello
> ## Starting EFI application at 01000000 ...
> WARNING: Invalid device tree, expect boot to fail
> mmc_init: -95, time 1806
> Scanning disk mmc at 70000.blk...
> Scanning disk mmc at 72000.blk...
> Card did not respond to voltage select!
> mmc_init: -95, time 9
> Scanning disk mmc at 74000.blk...
> Found 3 disks
> Hello, world!
> ## Application terminated, r = 0
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> ---
> lib/efi_loader/efi_disk.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
> index 39e602a868..4e8e7d0ad6 100644
> --- a/lib/efi_loader/efi_disk.c
> +++ b/lib/efi_loader/efi_disk.c
> @@ -289,9 +289,9 @@ int efi_disk_register(void)
> #ifdef CONFIG_BLK
> struct udevice *dev;
>
> - for (uclass_first_device(UCLASS_BLK, &dev);
> + for (uclass_first_device_check(UCLASS_BLK, &dev);
> dev;
> - uclass_next_device(&dev)) {
> + uclass_next_device_check(&dev)) {
> struct blk_desc *desc = dev_get_uclass_platdata(dev);
> const char *if_typename = dev->driver->name;
>
Thanks, looks good.
Reviewed-by: Andreas Färber <afaerber at suse.de>
This will be needed for the NanoPi K2 when importing the SDIO-enabled
Linux .dts.
Regards,
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
More information about the U-Boot
mailing list