Linux MultiMedia Card development
 help / color / mirror / Atom feed
* mmc_ops.c: Excessive tuning timeout causes significant boot slowdown
@ 2026-12-03 16:42 QwertyChouskie via Bugspray Bot
  2026-12-03 16:42 ` QwertyChouskie via Bugspray Bot
  0 siblings, 1 reply; 2+ messages in thread
From: QwertyChouskie via Bugspray Bot @ 2026-12-03 16:42 UTC (permalink / raw)
  To: linux-mmc, ulfh

QwertyChouskie added an attachment on Kernel.org Bugzilla:

Created attachment 310495
Boot log before changing timeout

mmc_ops.c has this:

```
	/*
	 * According to the tuning specs, Tuning process
	 * is normally shorter 40 executions of CMD19,
	 * and timeout value should be shorter than 150 ms
	 */
	data.timeout_ns = 150 * NSEC_PER_MSEC;
```

However, on my device (dw_mmc-rockchip, HS200 eMMC), some debug logging I added showed me that all successful and most non-successful tuning phases take well under 1 millisecond, while on my board at least, one particular tuning test far outside any of the good zones runs until it hits the timeout.  With the default timeout, this causes a significant delay to boot (and boards that might hit the timeout for multiple tests would encounter even more significant boot delays).

I suspect there may have been some confusion about total tuning process time vs individual test time when writing that timeout.  In my case, since each tuning phase is easily well under 1 millisecond, I set the timeout to 5 milliseconds, and it still tunes just fine while avoiding the massive boot stall when hitting the particularly bad phase.

Example log snippet showing how fast each tuning phase actually is:
```
[    0.809959] dwmmc_rockchip ff390000.mmc: timeout_ns: 150000000 => TMOUT[31:8]: 0xffffff
[    0.810065] dwmmc_rockchip ff390000.mmc: tuning i=8 phase=40 pass=1
[    0.810077] dwmmc_rockchip ff390000.mmc: tuning i=9 phase=45 presend
[    0.810088] dwmmc_rockchip ff390000.mmc: timeout_ns: 150000000 => TMOUT[31:8]: 0xffffff
[    0.810158] dwmmc_rockchip ff390000.mmc: drto_ms: 112
[    0.810204] dwmmc_rockchip ff390000.mmc: tuning i=9 phase=45 pass=1
[    0.810214] dwmmc_rockchip ff390000.mmc: tuning i=10 phase=50 presend
[    0.810225] dwmmc_rockchip ff390000.mmc: timeout_ns: 150000000 => TMOUT[31:8]: 0xffffff
[    0.810322] dwmmc_rockchip ff390000.mmc: tuning i=10 phase=50 pass=1
[    0.810333] dwmmc_rockchip ff390000.mmc: tuning i=11 phase=55 presend
[    0.810343] dwmmc_rockchip ff390000.mmc: timeout_ns: 150000000 => TMOUT[31:8]: 0xffffff
[    0.810408] dwmmc_rockchip ff390000.mmc: drto_ms: 112
[    0.810485] dwmmc_rockchip ff390000.mmc: tuning i=11 phase=55 pass=1
[    0.810496] dwmmc_rockchip ff390000.mmc: tuning i=12 phase=60 presend
[    0.810506] dwmmc_rockchip ff390000.mmc: timeout_ns: 150000000 => TMOUT[31:8]: 0xffffff
[    0.810614] dwmmc_rockchip ff390000.mmc: tuning i=12 phase=60 pass=1
[    0.810627] dwmmc_rockchip ff390000.mmc: tuning i=13 phase=65 presend
[    0.810637] dwmmc_rockchip ff390000.mmc: timeout_ns: 150000000 => TMOUT[31:8]: 0xffffff
[    0.810738] dwmmc_rockchip ff390000.mmc: tuning i=13 phase=65 pass=1
[    0.810749] dwmmc_rockchip ff390000.mmc: tuning i=14 phase=70 presend
[    0.810759] dwmmc_rockchip ff390000.mmc: timeout_ns: 150000000 => TMOUT[31:8]: 0xffffff
[    0.810825] dwmmc_rockchip ff390000.mmc: drto_ms: 112
[    0.810873] dwmmc_rockchip ff390000.mmc: tuning i=14 phase=70 pass=1
[    0.810884] dwmmc_rockchip ff390000.mmc: tuning i=15 phase=75 presend
[    0.810894] dwmmc_rockchip ff390000.mmc: timeout_ns: 150000000 => TMOUT[31:8]: 0xffffff
[    0.810961] dwmmc_rockchip ff390000.mmc: drto_ms: 112
[    0.811035] dwmmc_rockchip ff390000.mmc: tuning i=15 phase=75 pass=1
```
This all is logged over the period of about 1 millisecond.

File: pre-fix.log (text/plain)
Size: 67.10 KiB
Link: https://bugzilla.kernel.org/attachment.cgi?id=310495
---
Boot log before changing timeout

You can reply to this message to join the discussion.
-- 
Deet-doot-dot, I am a bot.
Kernel.org Bugzilla (bugspray 0.1-dev)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: mmc_ops.c: Excessive tuning timeout causes significant boot slowdown
  2026-12-03 16:42 mmc_ops.c: Excessive tuning timeout causes significant boot slowdown QwertyChouskie via Bugspray Bot
@ 2026-12-03 16:42 ` QwertyChouskie via Bugspray Bot
  0 siblings, 0 replies; 2+ messages in thread
From: QwertyChouskie via Bugspray Bot @ 2026-12-03 16:42 UTC (permalink / raw)
  To: linux-mmc, ulfh

QwertyChouskie added an attachment on Kernel.org Bugzilla:

Created attachment 310496
Boot log after changing timeout to a reasonably small value

File: post-fix.log (text/plain)
Size: 66.11 KiB
Link: https://bugzilla.kernel.org/attachment.cgi?id=310496
---
Boot log after changing timeout to a reasonably small value

You can reply to this message to join the discussion.
-- 
Deet-doot-dot, I am a bot.
Kernel.org Bugzilla (bugspray 0.1-dev)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-03 16:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 16:42 mmc_ops.c: Excessive tuning timeout causes significant boot slowdown QwertyChouskie via Bugspray Bot
2026-12-03 16:42 ` QwertyChouskie via Bugspray Bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox