drivers/sdmmc_sdhc: add timeout to wait for ISR mutex unlock#21432
drivers/sdmmc_sdhc: add timeout to wait for ISR mutex unlock#21432crasbe merged 2 commits intoRIOT-OS:masterfrom
Conversation
drivers/sdmmc/sdmmc_sdhc.c
Outdated
| #define _ZTIMER_CLOCK ZTIMER_MSEC | ||
| #define _ZTIMER_TICKS_PER_MS 1 |
There was a problem hiding this comment.
| #define _ZTIMER_CLOCK ZTIMER_MSEC | |
| #define _ZTIMER_TICKS_PER_MS 1 | |
| # define _ZTIMER_CLOCK ZTIMER_MSEC | |
| # define _ZTIMER_TICKS_PER_MS 1 |
drivers/sdmmc/sdmmc_sdhc.c
Outdated
| #define _ZTIMER_CLOCK ZTIMER_USEC | ||
| #define _ZTIMER_TICKS_PER_MS US_PER_MS |
There was a problem hiding this comment.
| #define _ZTIMER_CLOCK ZTIMER_USEC | |
| #define _ZTIMER_TICKS_PER_MS US_PER_MS | |
| # define _ZTIMER_CLOCK ZTIMER_USEC | |
| # define _ZTIMER_TICKS_PER_MS US_PER_MS |
I'm not sure if it makes sense to partially apply the indentation style now?
OR you could use the opportunity to apply it to the other #if-#else statements as well.
Ping @maribu?
There was a problem hiding this comment.
I'm always happy when we add the indent. But as long as the CI does not enforce this, it is not really mandatory.
There was a problem hiding this comment.
|
One small thing: The title and commit message should have a slash instead of colon. So |
48b1ae9 to
7ffe014
Compare
drivers/sdmmc/sdmmc_sdhc.c
Outdated
| { | ||
| sdhc_t *sdhc = sdhc_dev->conf->sdhc; | ||
|
|
||
| DEBUG_PUTS("[sdmmc] IRQ"); |
There was a problem hiding this comment.
This is probably a leftover from debugging, but it probably shouldn't stay.
| if (timeout || (sdhc_dev->error & error_mask)) { | ||
| if (IS_USED(ENABLE_DEBUG)) { | ||
| if (timeout) { | ||
| DEBUG("[sdmmc] IRQ wait timeout\n"); | ||
| } | ||
| DEBUG("[sdmmc] SDHC error: EISTR=%04x, ", sdhc_dev->error); | ||
| switch (reset) { | ||
| case SDHC_SRR_SWRSTCMD: |
There was a problem hiding this comment.
???
| if (timeout || (sdhc_dev->error & error_mask)) { | |
| if (IS_USED(ENABLE_DEBUG)) { | |
| if (timeout) { | |
| DEBUG("[sdmmc] IRQ wait timeout\n"); | |
| } | |
| DEBUG("[sdmmc] SDHC error: EISTR=%04x, ", sdhc_dev->error); | |
| switch (reset) { | |
| case SDHC_SRR_SWRSTCMD: | |
| if (timeout || (sdhc_dev->error & error_mask)) { | |
| if (IS_USED(ENABLE_DEBUG)) { | |
| if (timeout) { | |
| DEBUG("[sdmmc] IRQ wait timeout\n"); | |
| } | |
| else { | |
| DEBUG("[sdmmc] SDHC error: EISTR=%04x, ", sdhc_dev->error); | |
| switch (reset) { | |
| case SDHC_SRR_SWRSTCMD: | |
| ... |
Either a timeout happend or an SDHC error happened, right? If so, the DEBUG message for SDHC error shouldn't be generated in case of timeout error.
gschorcht
left a comment
There was a problem hiding this comment.
Looks good, please quash.
562958b to
94286a3
Compare
Contribution description
I witnessed situations where the sdmmc driver stalls while waiting for an IRQ.
It might be hardware though ...
However even if it is hardware, it keeps going with this changes in this PR.
Testing procedure
Internal app where data is written to an eMMC and I keep pressing ENTER to continuously execute
vfs ls.Without the change it was stalling. With this change it keeps working afterwards.
Issues/PRs references