From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796316147; b=BM55RtpWukC2M9uO8kf0IDeox+qh3dvYA1vbGRF2yBpLzCnYJD00AyxY1uFLMrQZK6NZ OC0YoMFFrspeXOkXOVYX0OBS/guDsii4p002A53u+aWvUjwrLmyxS/qgnyzDey9e/nMUf Ha9QFivOz18OwGuVLpgqOwDYHa5AjVQgNBHzEu9O1edTVGSAhN10JGl+f2t/83zf8bvto qla8TfZMcfMCgEyxs1pllSTKCvdDkvKBnqF+7HS37UQV3KkaMw6Zdvf3UEaO2S/LCe0BK EByL8hzCO71Tn/EzKSu6awXqIZZ8/LxTS/PNw+LawtQPnvE26DpMVKlicYhE68HPt0g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796316147; h=Received:DKIM-Signature:Received:From:Date:MIME-Version:Content-Type: Content-Transfer-Encoding:To:Message-ID:Subject:X-Bugzilla-Product: X-Bugzilla-Component:X-Mailer; bh=Vz6uDgPKqEfTASnNXsBHLvdMxDE8bRBd0wlQ9K0QCh8=; b=t0CPidjPXgJJNkFP5Xvr/M7KI2UbNo9cBXo9eLZz/20cYMpDv2/wvYKlE9zfZpPd8qpJ 7uEr93AlWsjuhuhom2voRHCwYwNFx7rIknr7imKQZq4jMPu8AoCTAwRKu7kHGnYst4KdK l/qFY0CHpjWoFPGQqxaLUKfl++aa8aZG/gQlMtfM8vMYuvNmVMxht7q8fb/ymkSAiz2YA etB99XnPs5x/BCxUZUdoqM84y8GFI15PTA4HZmd7v/UIKX9oqzIaQW1MpQlIDv1g+IKKe Hi7i7YXTsSo99w2FnrRjLcNkLEVCzPEYeP3SvXvsdiyre6STq/Mvl16oWpMreJPWJFg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Sr4i47k3; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD43A606A32C for ; Thu, 3 Dec 2026 16:42:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Sr4i47k3 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA2CB1F000C1; Thu, 3 Dec 2026 16:42:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796316147; bh=Vz6uDgPKqEfTASnNXsBHLvdMxDE8bRBd0wlQ9K0QCh8=; h=From:Date:To:Subject; b=Sr4i47k3+yiXiTUuFobzjfrxBtjKXALhP+kGuFPn7OpSF2n3VP1qwKYlTXey2iRMR FnVfEPz2l6LPq/4uODj1J58VMnuCBFUzYzHyJ6zsoF1XzBjw4JwP4oiWoqns0CcuuY gkLnd1cwMvbMZfSpTBeHfTQ3e4Q1HIVN+m6i/7wZFgjA+PodLNMs47tatOMp0gfVLo /Mt6h8t/EJcTVB2VsdVZRdCYt+ziFV5evpj8GyE48C+iASOlBo/BEaFMtVgcUltXwK nA7hUgGCYbsq46A3ranXe/ZbLN3bvEXem99eg783KvHICsZ7XaeBClXlYCJreaqx0p fCH6ch2TfZF3Q== Received: from [10.30.226.235] (localhost [IPv6:::1]) by aws-us-west-2-korg-oddjob-rhel9-1.codeaurora.org (Postfix) with ESMTP id 96B593805D97; Thu, 3 Dec 2026 16:42:27 +0000 (UTC) From: QwertyChouskie via Bugspray Bot Date: Thu, 03 Dec 2026 16:42:23 +0000 X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: linux-mmc@vger.kernel.org, ulfh@kernel.org Message-ID: <20261203-b221781c0-ce6231a8450c@bugzilla.kernel.org> Subject: mmc_ops.c: Excessive tuning timeout causes significant boot slowdown X-Bugzilla-Product: Drivers X-Bugzilla-Component: MMC/SD X-Mailer: bugspray 0.1-dev 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)