]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
Invalidate cached FAT device upon boot error
authorPrasad Kale <prasad.kale@live.com>
Thu, 30 Oct 2025 17:03:01 +0000 (22:33 +0530)
committerTom Rini <trini@konsulko.com>
Thu, 6 Nov 2025 14:31:34 +0000 (08:31 -0600)
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 <prasad.kale@live.com>
Cc: Dan Murphy <dmurphy@ti.com>
Cc: Sean Anderson <seanga2@gmail.com>
common/spl/spl_fat.c

index e9ee5487d6e39b8701b8c793ae4bd6eef43531f5..8b1d01cff4b443b651655764589fb234b75eb364 100644 (file)
@@ -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;
 }