Skip to content

platform: msm_shared: mmc: bound MCLK register write wait - #757

Merged
TravMurav merged 1 commit into
msm8916-mainline:mainfrom
Smankusors:mmc-reg-wr-hang-fix
Aug 16, 2026
Merged

platform: msm_shared: mmc: bound MCLK register write wait#757
TravMurav merged 1 commit into
msm8916-mainline:mainfrom
Smankusors:mmc-reg-wr-hang-fix

Conversation

@Smankusors

Copy link
Copy Markdown
Contributor

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.

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>
@TravMurav

Copy link
Copy Markdown
Member

This is one of a series of PRs to support booting from microSD on the msm8960 platform.

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

@Smankusors

Copy link
Copy Markdown
Contributor Author

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. 😵

@TravMurav
TravMurav merged commit 3b7896f into msm8916-mainline:main Aug 16, 2026
42 checks passed
@TravMurav

Copy link
Copy Markdown
Member

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?)

Ack, I see, this change seems fine to me assuming it helps with whatever hacks you have locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants