-
Notifications
You must be signed in to change notification settings - Fork 8.4k
drivers: sdhc: imx_usdhc: add retry for DAT3 card detection #101464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
drivers: sdhc: imx_usdhc: add retry for DAT3 card detection #101464
Conversation
DAT3-based card detection may fail for the first attempt on RT1060evkc + NXP_IW610x_v1 card, caused by transient signal states during initialization. Add a short retry loop (by default 10 attempts, 1 ms delay) to improve detection reliability. Signed-off-by: Maochen Wang <[email protected]>
c6dcb7a to
7faeeca
Compare
|
| /* Default transfer timeout in ms for tuning */ | ||
| #define IMX_USDHC_DEFAULT_TIMEOUT (5000U) | ||
| /* USDHC DAT3 detect attempts */ | ||
| #define IMX_USDHC_DAT3_DETECT_RETRY_MAX (10U) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to make this a Kconfig, and only set it for boards that need it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, a Kconfig item for retry count, the default value could be 1, and could be changed by boards
| /* Default transfer timeout in ms for tuning */ | ||
| #define IMX_USDHC_DEFAULT_TIMEOUT (5000U) | ||
| /* USDHC DAT3 detect attempts */ | ||
| #define IMX_USDHC_DAT3_DETECT_RETRY_MAX (10U) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, a Kconfig item for retry count, the default value could be 1, and could be changed by boards



DAT3-based card detection may fail for the first attempt on RT1060evkc + NXP_IW610x_v1 card, caused by transient signal states during initialization. Add a short retry loop (by default 10 attempts, 1 ms delay) to improve detection reliability.