Skip to content

Conversation

@AlvinPaul26
Copy link
Contributor

As part of the MMC card initialization sequence, CMD1 command send multiple times to the card, first time to identify the card type and second time to check the requested voltage window is supported or not. There is a chance that after issuing the CMD1 for first time, card will move to the ready state before issuing the CMD1 for second time. In this case, card will not respond to the CMD1 send for the second time as card is already moved to ready state and this leads to failures. Hence remove the separate card identification logic and call mmc_send_op_cond only once to check both supported voltage window and card type identification.

decsny
decsny previously approved these changes Feb 21, 2025
Copy link
Member

@decsny decsny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems fine to me

Copy link
Contributor

@danieldegrasse danieldegrasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the spec I agree the second CMD1 could cause issues. We should drop the LOG_ERR (or reduce it to a LOG_DBG) on line 130 though- I suppose that since MMC cards are queried last, this isn't really a big issue (as working SDIO and SDMMC cards should never make it to this code flow). I just would prefer that SDIO/SDMMC cards that fail initialization don't also have a "Failed to query card OCR" log from the MMC code included in the output

@AlvinPaul26
Copy link
Contributor Author

yeah, I will better change it into LOG_DBG.
thanks.

As part of the MMC card initialization sequence, CMD1 command send
multiple times to the card, first time to identify the card type and
second time to check the requested voltage window is supported or not.
There is a chance that after issuing the CMD1 for first time, card will
move to the ready state before issuing the CMD1 for second time. In this
case, card will not respond to the CMD1 send for the second time as card
is already moved to ready state and this leads to failures. Hence remove
the separate card identification logic and call mmc_send_op_cond only
once to check both supported voltage window and card type
identification.

Signed-off-by: Paul Alvin <alvin.paulp@amd.com>
@AlvinPaul26 AlvinPaul26 requested a review from decsny February 26, 2025 04:09
@fabiobaltieri fabiobaltieri added this to the v4.1.0 milestone Feb 26, 2025
@fabiobaltieri fabiobaltieri merged commit c897adb into zephyrproject-rtos:main Feb 26, 2025
21 checks passed
@AlvinPaul26 AlvinPaul26 deleted the remove_send_op_cond branch February 27, 2025 03:54
kedareswararao pushed a commit to Xilinx/zephyr-amd that referenced this pull request May 23, 2025
As part of the MMC card initialization sequence, CMD1 command send
multiple times to the card, first time to identify the card type and
second time to check the requested voltage window is supported or not.
There is a chance that after issuing the CMD1 for first time, card will
move to the ready state before issuing the CMD1 for second time. In this
case, card will not respond to the CMD1 send for the second time as card
is already moved to ready state and this leads to failures. Hence remove
the separate card identification logic and call mmc_send_op_cond only
once to check both supported voltage window and card type
identification.

Signed-off-by: Paul Alvin <alvin.paulp@amd.com>
Message-ID: <20250221113857.2112-1-alvin.paulp@amd.com>
Link: zephyrproject-rtos/zephyr#86144
State: waiting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants