From: QwertyChouskie via Bugspray Bot <bugbot@kernel.org>
To: linux-mmc@vger.kernel.org, ulfh@kernel.org
Subject: mmc_ops.c: Excessive tuning timeout causes significant boot slowdown
Date: Thu, 03 Dec 2026 16:42:23 +0000 [thread overview]
Message-ID: <20261203-b221781c0-ce6231a8450c@bugzilla.kernel.org> (raw)
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)
next reply other threads:[~2026-12-03 16:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 16:42 QwertyChouskie via Bugspray Bot [this message]
2026-12-03 16:42 ` mmc_ops.c: Excessive tuning timeout causes significant boot slowdown QwertyChouskie via Bugspray Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261203-b221781c0-ce6231a8450c@bugzilla.kernel.org \
--to=bugbot@kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ulfh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox