Skip to contentSkip to conversation

mmc: sdhci: Start status timeout after command issue

PATCH In review Tanmay Kathpalia 2 participants 2 messages May 10 – May 13 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: sdhci: Start status timeout after command issue

The status polling timeout in sdhci_send_command() should measure the time spent waiting for the command interrupt after the command has been issued.

Do not initialize the timer at function entry, since the command inhibit wait and setup path can consume time before SDHCI_COMMAND is written. Start the timer immediately after issuing the command instead.

---
 drivers/mmc/sdhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/sdhci.c +1 -1
index 648dfa4b5ef..08594e10266 100644
@@ -215,7 +215,7 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
 	u32 mask, flags, mode = 0;
 	unsigned int time = 0;
 	int mmc_dev = mmc_get_blk_desc(mmc)->devnum;
-	ulong start = get_timer(0);
+	ulong start;
 
 	host->start_addr = 0;
 	/* Timeout unit - ms */
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Tanmay Kathpalia

The status polling timeout in sdhci_send_command() should measure the time spent waiting for the command interrupt after the command has been issued.

Do not initialize the timer at function entry, since the command inhibit wait and setup path can consume time before SDHCI_COMMAND is written. Start the timer immediately after issuing the command instead.