JunyuanShen943 opened a new pull request, #22222:
URL: https://github.com/apache/nuttx/pull/22222
## Summary
* Why: the per-block read timeout in `drivers/mmcsd/mmcsd_sdio.c` is
hardcoded to 100ms (`MMCSD_BLOCK_RDATADELAY`), while the write timeout
is already configurable (`CONFIG_MMCSD_BLOCK_WDATADELAY`). The timeout
is armed before the read command is sent, so on a loaded host under
emulation a stall of the issuing thread can expire it although the
transfer completes, and the file system then keeps failing the read.
* How: add `CONFIG_MMCSD_BLOCK_RDATADELAY` (default 100, the current
value) and use it for `MMCSD_BLOCK_RDATADELAY`.
## Impact
* New feature or changed behavior: NO with the default value. New
Kconfig option `MMCSD_BLOCK_RDATADELAY`.
* User adaptation needed: NO.
* Build: NO.
* Hardware: SD/MMC over SDIO; only targets that raise the option are
affected.
* Documentation: Kconfig help only.
* Security: NO.
* Compatibility: NO.
## Testing
I confirm that changes are verified on local setup and works as intended:
* Build Host: Ubuntu 22.04 x86_64, arm-none-eabi-gcc
* Target: imxrt1020-evk:usdhc (build only), sim:nsh
1. imxrt1020-evk:usdhc on master and on this PR with the default: the
disassembly of `mmcsd_sdio.o` is identical.
2. Same board with `CONFIG_MMCSD_BLOCK_RDATADELAY=500`: only the read
timeout constants passed to `SDIO_WAITENABLE()` change:
```
- b2: movs r2, #100 @ 0x64
+ b2: mov.w r2, #500 @ 0x1f4
```
3. sim:nsh make and CMake builds pass, ostest exits with status 0,
`tools/checkpatch.sh -m` is clean.
Not run on SD hardware; with the default value the generated code is
unchanged.
## PR verification Self-Check
* [x] This PR introduces only one functional change.
* [x] I have updated all required description fields above.
* [x] My PR adheres to Contributing Guidelines and Documentation (git commit
title and message, coding standard, etc).
* [ ] My PR is still work in progress (not ready for review).
* [x] My PR is ready for review and can be safely merged into a codebase.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]