From: Prasad Kale Date: Thu, 30 Oct 2025 17:03:01 +0000 (+0530) Subject: Invalidate cached FAT device upon boot error X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c488907f91ec90bb6a93803b1db53e24b93b52ea;p=thirdparty%2Fu-boot.git Invalidate cached FAT device upon boot error When spl boot device list has multiple FAT devices, any previousely registered FAT device should be deregistered before registering next FAT boot device, otherwise the function may not attempt boot from next FAT device.One of the situations where this issue can be observed is when the boot device list has two FAT partitions of a memory device and if booting fails on first partition (because of file or partition related errors), boot from next partition actually gets attempted on previous boot device only, as the previous device has remained marked as registered. Call the function that invalidates cached boot device in case of failure in booting from current FAT boot device. Signed-off-by: Prasad Kale Cc: Dan Murphy Cc: Sean Anderson --- diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c index e9ee5487d6e..8b1d01cff4b 100644 --- a/common/spl/spl_fat.c +++ b/common/spl/spl_fat.c @@ -96,9 +96,11 @@ int spl_load_image_fat(struct spl_image_info *spl_image, err = spl_load(spl_image, bootdev, &load, size, 0); end: - if (err < 0) + if (err < 0) { + spl_fat_force_reregister(); printf("%s: error reading image %s, err - %d\n", __func__, filename, err); + } return err; }