Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel loads extremely slowly on some SD cards #262

Open
Gadget64 opened this issue Sep 7, 2024 · 2 comments
Open

Kernel loads extremely slowly on some SD cards #262

Gadget64 opened this issue Sep 7, 2024 · 2 comments

Comments

@Gadget64
Copy link

Gadget64 commented Sep 7, 2024

Whenever I use the UEFI firmware on my UHS-I SanDisk Extreme 64GB microSD, it takes extremely long for the bootloader to start Linux. The process clearly gets stuck while loading the kernel & initrd into memory, as shown by systemd-analyze:

Startup finished in 4.861s (firmware) + 1min 52.088s (loader) + 3.983s (kernel) + 12.310s (userspace) = 2min 13.244s

While I am using systemd-boot on my system, the exact same issue happens with GRUB. (Unfortunately, systemd-boot does not seem to have proper logging capabilities, and I didn't manage to get useful info trying to debug this with GRUB yet.) The only thing I can tell is that after the bootloader's picker is shown without issues and the boot has continued, it just stays at a black screen for a minute or two before Linux seems to have been loaded, which is when the following text is shown at once:

EFI stub: Booting Linux Kernel...
EFI stub: Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path
EFI stub: Using DTB from configuration table
EFI stub: Exiting boot services...

It seems that what took so long is for the kernel to load; and this is on a fresh install of NixOS, with a kernel image of just 70 MB. But once these messages have been shown after the wait, the Linux kernel starts booting quickly and properly as usual.

I can rule out that the card is not at fault, as it boots all non-UEFI configurations as quickly as expected. And even with UEFI, it performs well once the system has gotten past the point of loading the kernel into memory. Additionally, an identical install of UEFI + NixOS starts the kernel almost immediately on an USB 2.0 flash drive, although it's much slower than my microSD.

Is the card maybe simply running at an extremely low speed at that stage before the kernel has properly configured it? Linux does indeed only report it as sd high-speed with cat /sys/kernel/debug/mmc*/ios (which should be 25 MB/s) before I've properly applied the device-trees, and only then is it shown as sd uhs DDR50 (the expected UHS-I speed of 50 MB/s, which is what vanilla RPi OS reports too), although both should be fast enough. Let me know if I can provide any more information!

@pm4rcin
Copy link

pm4rcin commented Nov 8, 2024

I can confirm boot is really slow on Fedora IOT UEFI. I haven't tested with BIOS but checked with another SD Card that is slower and has raspbian on it and it's really fast to boot.

@ghost
Copy link

ghost commented Nov 11, 2024

I can confirm as well. Pretty much identical symptoms to Gadget64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants