[PATCH v2] bootstd: Skip over bad device during bootflows scanning

Simon Glass sjg at chromium.org
Mon Nov 6 18:25:12 CET 2023


On Thu, 2 Nov 2023 at 12:51, Tony Dinh <mibodhi at gmail.com> wrote:
>
> During bootstd scanning for bootdevs, if bootdev_hunt_drv() encounters
> a device not found error (e.g. ENOENT), let it return a successful status
> so that bootstd will continue scanning the next devices, not stopping
> prematurely.
>
> Background:
>
> During scanning for bootflows, it's possible for bootstd to encounter a
> faulty device controller. Also when the same u-boot is used for another
> variant of the same board, some device controller such as SATA might
> not exist.
>
> I've found this issue while converting the Marvell Sheevaplug board to
> use bootstd. This board has 2 variants, the original Sheevaplug has MMC and
> USB only, but the later variant comes with USB, MMC, and eSATA ports. We
> have been using the same u-boot (starting with CONFIG_IDE and later with DM
> CONFIG_SATA) for both variants. This worked well with the old
> envs-scripting booting scheme.
>
> Signed-off-by: Tony Dinh <mibodhi at gmail.com>
> ---
>
> Changes in v2:
> - Restore bootdev_next_prio() to the original.
> - Add a check in bootdev_hunt_drv(). If its descendant bootdev hunt driver
> function returns -ENOENT, set the hunt status to successful (this is the
> case where the device does not exist, or a bad device controller).
> - Update bootdev_hunter_func() docs to indicate that a return
> status -ENOENT is not an error, just a "device not found" status.
> - Set status of sata_rescan() to -ENOENT when the SATA device is not found.
>
>  boot/bootdev-uclass.c | 2 +-
>  drivers/ata/sata.c    | 2 +-
>  include/bootdev.h     | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list