[PATCH v3 0/4] mmc: meson-gx: honour the busy timeout for R1b commands
Igor Velkov via B4 Relay
devnull+iav.iav.lv at kernel.org
Fri Oct 9 10:02:56 PDT 2026
For a command without data the driver programs a fixed 1024 ms into the
CMD_CFG timeout field and does not tell the core how long the controller
can wait for busy. Erase and cache flush then fail with -110 on eMMC.
Patch 3 fixes card_busy, which reported a busy card free; patch 4 makes
the core rely on it.
Tested on ODROID-N2+ (S922X), 256 GB eMMC, btrfs root with discard=async,
Armbian builds in docker as load. Without the series (7.3-rc6): 262
errors in 3 h and 68 in 2.5 h in two runs; the first came 4 and 43 min
into the build. With v1 (7.3-rc6): 0 in 16 h, 2.4 h of it under the
build. With v3: 0 in a 37 min kernel build and in a 20 GiB write +
fstrim; a sanitize went out as R1 and the core polled DAT0 for 523 ms
until the card was back in TRAN. On 7.1 with the previous eMMC module
a synthetic test (20 GiB write + fstrim) gave 48 errors without the
patches, 0 and 0 with them.
ODROID-N2 (S922X), 128 GB Kingston eMMC, 20 GiB write + fstrim:
without the series an erase hit the 1024 ms limit and failed with -110
in 3 of 3 runs. With v3, in 3 such runs and a fill of the card to 85 %
with rm + fstrim, 5 erases took over 1024 ms, up to 1219 ms, and
completed; 0 errors.
ODROID-HC4, SD card in SDR104 at 1.8 V: 0 errors in 5 boots.
The timeout is rounded up to a power of two: the field holds powers of
two only, and the timeout is a lower bound. MMC_CAP_WAIT_WHILE_BUSY is
not set: I have not checked that the controller waits for busy on every
R1b command, HS400 switches included.
---
Changes in v3:
- Clamp cmd->busy_timeout to the range of the field before rounding it
up to a power of two: the rounding of a value above 2^31 overflowed
unsigned int (Sashiko).
- New patch 3: card_busy reports busy from DAT0 alone. It required
DAT0..3 all low and reported a busy card free (Sashiko).
- Link to v2: https://lore.kernel.org/r/20261008-meson-gx-busy-timeout-v2-0-8bde1adfb5b4@iav.lv
Changes in v2:
- Split into three patches, as Neil asked: name the limit of the
timeout field, program the R1b timeout from cmd->busy_timeout, report
max_busy_timeout.
- Link to v1: https://lore.kernel.org/r/20261008-meson-gx-busy-timeout-v1-1-d92f3c68c409@iav.lv
---
Igor Velkov (4):
mmc: meson-gx: name the limit of the CMD_CFG timeout field
mmc: meson-gx: honour the busy timeout for R1b commands
mmc: meson-gx: report busy from DAT0 alone
mmc: meson-gx: report the longest busy wait the controller can do
drivers/mmc/host/meson-gx-mmc.c | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
---
base-commit: fd9af27f6c2319713bb23832066585f8a59a1771
change-id: 20261005-meson-gx-busy-timeout-7e8e3fdcb3e3
Best regards,
--
Igor Velkov <iav at iav.lv>
More information about the linux-amlogic
mailing list