platform: msm_shared: mmc: bound MCLK register write wait - #757
Conversation
mmc_mclk_reg_wr_delay() can hang indefinitely if the controller core clock is not running. This can happen when probing the microSD slot if its clocks were not enabled by the PBL. Add a 1 ms timeout to the wait, matching the behavior of msmsdcc_sync_reg_wr() in the downstream msm_sdcc driver. Tested on Sony Xperia SP (MSM8960T). Assisted-by: OpenCode:deepseek-v4-flash Signed-off-by: Antony K. S <postmarketos@smankusors.com>
Can you prepare a single PR with multiple commits that gets to that goal? I assume you have work done already, and it's probably better to review everything in-context |
Hmm, unfortunately, while I did get the phone to boot from the SD card, the rest of the changes are still in a... let's say "vibe-coded and not yet properly reviewed" state 😅 This is the only patch I've thoroughly reviewed and tested so far. If you'd prefer a single PR with the full set of changes, I'd like to properly review and test the rest first before submitting them. For now, my plan only goes as far as switching the main storage from eMMC to microSD. (This switch might stay on my local though, since forcing all legacy platforms to use only microSD would be bad idea?) Ideally, I'd like these legacy platforms to support both eMMC and microSD at the same time, like the newer platforms do. But from what I've looked into so far, that would require much more substantial changes. 😵 |
Ack, I see, this change seems fine to me assuming it helps with whatever hacks you have locally. |
Note
This is one of a series of PRs to support booting from microSD on the msm8960 platform.
mmc_mclk_reg_wr_delay()can hang indefinitely if the controller core clock is not running. This can happen when probing the microSD slot if its clocks were not enabled by the PBL.Add a 1 ms timeout to the wait, matching the behavior of
msmsdcc_sync_reg_wr()in the downstream msm_sdcc driver.References:
Tested on Sony Xperia SP (MSM8960T). Verified that a disabled core clock hits the timeout and prints the warning instead of hanging, while an enabled clock completes the write without hitting the timeout.