mmc: CMD7:MMC_CMD_SELECT_CARD response fix
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 mmc: CMD7:MMC_CMD_SELECT_CARD response fix
Quoted 36 lines · ----- "Andy Fleming
Quoted 1 line
Quoted 1 line
I need to think about this. Was this causing you a problem? What
were
Quoted 3 lines
Quoted 2 lines
the symptoms?
yes... I am working on adding mmc support for Marvell GplugD board
(Armada168 SoC). So during mmc startup,
MMC_CMD_SELECT_CARD(CMD7)gets timed out. So digging more I found out that CMD7 in driver was expecting R1b instead of R1. I referred SD specs and JEDEC document for confirmation, and it clearly said in its footnote (which I added to patch description) that from stand-by to transfer mode response will be R1. I even crosschecked mmc driver in Kernel code, where in functionmmc_select_card; CMD7 response is expected to be R1.Quoted 2 lines
I also checked if the standard SDHCI driver I am using is at fault
or what, But I did not find any problem with mmc driver (
sdhci.c). I then referred to blackfin SDH driver to see how they are handing this... so they are kind of bypassing this. According to specs, for R1b one should wait forCMD_SENTand data end flag to get set as card may send busy response. whereas blackfin driver simply checks if any of the flag is set it comes out of loop see code below for reference.Quoted 13 lines
ref
bfin_sdh.c
[..]
?/* wait for a while */
? ? ? ?timeout = 0;
? ? ? ?do {
? ? ? ? ? ? ? ?if (++timeout > 1000000) {
? ? ? ? ? ? ? ? ? ? ? ?status =CMD_TIME_OUT;
? ? ? ? ? ? ? ? ? ? ? ?break;
? ? ? ? ? ? ? ?}
? ? ? ? ? ? ? ?udelay(1);
? ? ? ? ? ? ? ?status =bfin_read_SDH_STATUS();
? ? ? ?} while (!(status & (CMD_SENT|CMD_RESP_END|CMD_TIME_OUT|
Quoted 2 lines
? ? ? ? ? ? ? ?CMD_CRC_FAIL)));
Quoted 8 lines
Quoted 1 line
Incase of sdhci, driver waits for response endlessly. till both
SDHCI_INT_RESPONSEandSDHCI_INT_DATA_ENDflags are set.Quoted 2 lines
I hope I am able to clear the issue?
Yes, that sounds fine, then. I'll apply it for this release.
waited long for this reply :D thanks...
Cheers!
Ajay Bhargav