drivers/sdmmc: fix stall in _disable_sd_clk#21930
Merged
crasbe merged 2 commits intoRIOT-OS:masterfrom Dec 5, 2025
Merged
Conversation
benpicco
approved these changes
Dec 4, 2025
Contributor
benpicco
left a comment
There was a problem hiding this comment.
_wait_sdhc_busy() does just what was open-coded here with a timeout.
benpicco
reviewed
Dec 4, 2025
drivers/sdmmc/sdmmc_sdhc.c
Outdated
| /* wait for command/data to go inactive */ | ||
| while (sdhc->PSR.reg & (SDHC_PSR_CMDINHC | SDHC_PSR_CMDINHD)) {} | ||
| if (_wait_sdhc_busy(sdhc)) { | ||
| _reset_sdhc(sdhc, SDHC_SRR_SWRSTALL); |
Contributor
There was a problem hiding this comment.
sdmmc_sdhc.c: In function '_disable_sd_clk':
sdmmc_sdhc.c:814:25: error: passing argument 1 of '_reset_sdhc' from incompatible pointer type [-Werror=incompatible-pointer-types]
814 | _reset_sdhc(sdhc, SDHC_SRR_SWRSTALL);
| ^~~~
| |
| sdhc_t *
sdmmc_sdhc.c:685:37: note: expected 'sdhc_dev_t *' but argument is of type 'sdhc_t *'
685 | static void _reset_sdhc(sdhc_dev_t *sdhc_dev, uint8_t type)
| ~~~~~~~~~~~~^~~~~~~~
Contributor
Author
There was a problem hiding this comment.
sorry, I tested it in another repository and did a mistake when I copied it over to my RIOT repo.
Contributor
Author
There was a problem hiding this comment.
But if CI passed then there is no compile test yet. :(
I can try to add one
Contributor
Author
There was a problem hiding this comment.
make: Entering directory '/home/[email protected]/RIOT/tests/drivers/sdmmc'
There are unsatisfied feature requirements: periph_sdmmc
There is a compile tets but the default board BOARD ?= samr21-xpro is lacking the feature
Contributor
There was a problem hiding this comment.
The full compile test is only on merge, 'CI: ready for build' just does a quick run with a subset of boards.
d27960d to
63c0dc9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
I saw a situation in GDB where it was hanging in this function because of
SDHC_PSR_CMDINHD.There was already a comment to handle timeout and a function
_wait_sdhc_busy.Maybe it was just forgotten here.
Testing procedure
Issues/PRs references