Kernel/SDHC: Return ENOTSUP if no base clock frequency provided

We would otherwise crash here on the Raspberry Pi 4.
This commit is contained in:
Sönke Holz 2024-12-22 17:15:49 +01:00
parent 6fa8165d91
commit 1d29f02274

View file

@ -963,7 +963,8 @@ ErrorOr<u32> SDHostController::retrieve_sd_clock_frequency()
if (m_registers->capabilities.base_clock_frequency == 0) {
// Spec says:
// If these bits are all 0, the Host System has to get information via another method
TODO();
dbgln("FIXME: The SD Host Controller does not provide the base clock frequency; get this frequency using another method");
return ENOTSUP;
}
i64 const one_mhz = 1'000'000;
return { m_registers->capabilities.base_clock_frequency * one_mhz };