m4xw / emuMMC

A SDMMC driver replacement for Nintendo's Filesystem Services.
GNU General Public License v2.0
290 stars 23 forks source link

Fix slow boot and speed in HOS 11.0.0 #18

Closed CTCaer closed 3 years ago

CTCaer commented 3 years ago

Until now, we relied on a race condition that is broken on 11.0.0.

In 11.0.0 there's an eMMC request that happens while FS kills power to SD. This causese the emuMMC driver to fail and do rereads and reinit SD. That slows down boot by 30s to 1min.

Additionally, because FS finds the sd card already powered while its init happens, it gets no support for UHS and initializes into HS25. Effectively decimating performance.

This commit adds sdmmc_wrapper_controller_open hook, in order to catch that and lock any eMMC access. After the full FS sd init happens it gets unlocked.

TODO: For now it only hooks 11.0.0. Any other version is skipped.