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 <prasad.kale@live.com>
Cc: Dan Murphy <dmurphy@ti.com>
Cc: Sean Anderson <seanga2@gmail.com>
This commit is contained in:
Prasad Kale
2025-10-30 22:33:01 +05:30
committed by Tom Rini
parent 77905c333e
commit c488907f91

View 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;
}