mmc: sdhci: only invoke clock re-tuning for adtc type commands
PATCH 1/1 mmc: sdhci: only invoke clock re-tuning for adtc type commands
In reply to a message not in the archiveFor high clock frequency modes, ie. SDR104 and possibly SDR50, the data window on the CMD and DAT lines needs to be tuned. Once tuned to a sample clock rate, a re-tuning might required because of drifted signal on different lines. This re-tuning is needed and only necessary for commands using the DAT lines, ie. adtc type commands. This patch is an optimization by adding the condition of the requested command being adtc type in order to execute the re-tuning procedure.
--- drivers/mmc/host/sdhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci.c +2 -1
@@ -1389,7 +1389,8 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)* tuning procedure before sending command. */ if ((host->flags &SDHCI_NEEDS_RETUNING ) && - !(present_state & (SDHCI_DOING_WRITE |SDHCI_DOING_READ ))) { + !(present_state & (SDHCI_DOING_WRITE |SDHCI_DOING_READ )) && +mmc_cmd_type (mrq->cmd) ==MMC_CMD_ADTC ) {if (mmc->card) {/* eMMC uses cmd21 but sd and sdio use cmd19 */ tuning_opcode =
Signature · 1 line
1.7.9.5
Hi Chris,
Quoted 10 lines · Franky Lin
For high clock frequency modes, ie. SDR104 and possibly SDR50, the data window on the CMD and DAT lines needs to be tuned. Once tuned to a sample clock rate, a re-tuning might required because of drifted signal on different lines. This re-tuning is needed and only necessary for commands using the DAT lines, ie. adtc type commands. This patch is an optimization by adding the condition of the requested command being adtc type in order to execute the re-tuning procedure.
Signed-off-by Franky Lin <[email protected]>---
Is this still in your queue? Any remarks on it?
Thanks,
Franky
Quoted 18 lines
drivers/mmc/host/sdhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/mmc/host/sdhci.c +2
-1@@ -1389,7 +1389,8 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)* tuning procedure before sending command. */ if ((host->flags &SDHCI_NEEDS_RETUNING ) && - !(present_state & (SDHCI_DOING_WRITE |SDHCI_DOING_READ ))) { + !(present_state & (SDHCI_DOING_WRITE |SDHCI_DOING_READ )) && +mmc_cmd_type (mrq->cmd) ==MMC_CMD_ADTC ) {if (mmc->card) {/* eMMC uses cmd21 but sd and sdio use cmd19 */ tuning_opcode =
Quoted 11 lines · Franky Lin
Hi Chris,
Quoted 8 lines · Franky Lin
For high clock frequency modes, ie. SDR104 and possibly SDR50, the data window on the CMD and DAT lines needs to be tuned. Once tuned to a sample clock rate, a re-tuning might required because of drifted signal on different lines. This re-tuning is needed and only necessary for commands using the DAT lines, ie. adtc type commands. This patch is an optimization by adding the condition of the requested command being adtc type in order to execute the re-tuning procedure.
Quoted 8 lines
Quoted 2 lines
Signed-off-by Franky Lin <[email protected]>---
Is this still in your queue? Any remarks on it?
Thanks,
Franky
Ping?
Quoted 24 lines
Quoted 17 lines
drivers/mmc/host/sdhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/mmc/host/sdhci.c +2
-1@@ -1389,7 +1389,8 @@ static void sdhci_request(struct mmc_host *mmc,struct mmc_request *mrq) * tuning procedure before sending command. */ if ((host->flags &SDHCI_NEEDS_RETUNING ) && - !(present_state & (SDHCI_DOING_WRITE |SDHCI_DOING_READ ))) { + !(present_state & (SDHCI_DOING_WRITE |SDHCI_DOING_READ )) && +mmc_cmd_type (mrq->cmd) ==MMC_CMD_ADTC ) {if (mmc->card) {/* eMMC uses cmd21 but sd and sdio use cmd19 */ Quoted 2 lines
tuning_opcode=--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Chris and Ulf,
Quoted 15 lines · Franky Lin
Quoted 14 lines · Franky Lin
Hi Chris,
Quoted 10 lines · Franky Lin
For high clock frequency modes, ie. SDR104 and possibly SDR50, the data window on the CMD and DAT lines needs to be tuned. Once tuned to a sample clock rate, a re-tuning might required because of drifted signal on different lines. This re-tuning is needed and only necessary for commands using the DAT lines, ie. adtc type commands. This patch is an optimization by adding the condition of the requested command being adtc type in order to execute the re-tuning procedure.
Signed-off-by Franky Lin <[email protected]>---
Quoted 7 lines
Quoted 5 lines
Is this still in your queue? Any remarks on it?
Thanks,
FrankyPing?
Need to try my luck again. :) Could you please share your thought about this patch?
Thanks,
Franky
Quoted 32 lines
Quoted 19 lines
Quoted 19 lines
drivers/mmc/host/sdhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/mmc/host/sdhci.c +1
-1@@ -1389,7 +1389,8 @@ static void sdhci_request(struct mmc_host *mmc,struct mmc_request *mrq) * tuning procedure before sending command. */ if ((host->flags &SDHCI_NEEDS_RETUNING ) && - !(present_state & (SDHCI_DOING_WRITE | SDHCI_DOING_READ))) { + !(present_state & (SDHCI_DOING_WRITE |
SDHCI_DOING_READ)) &&+ mmc_cmd_type(mrq->cmd) == MMC_CMD_ADTC) { if (mmc->card) {Quoted 8 lines
Quoted 3 lines
/* eMMC uses cmd21 but sd and sdio use cmd19 */ tuning_opcode =--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 9 lines · Franky Lin
For high clock frequency modes, ie. SDR104 and possibly SDR50, the data window on the CMD and DAT lines needs to be tuned. Once tuned to a sample clock rate, a re-tuning might required because of drifted signal on different lines. This re-tuning is needed and only necessary for commands using the DAT lines, ie. adtc type commands. This patch is an optimization by adding the condition of the requested command being adtc type in order to execute the re-tuning procedure.
Signed-off-by Franky Lin <[email protected]>
Hi Franky,
Sorry for the delay.
Quoted 9 lines
--- drivers/mmc/host/sdhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/mmc/host/sdhci.c +0
-0
drivers/mmc/host/sdhci.c static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) · line 1393
Quoted 6 lines
drivers/mmc/host/sdhci.c +2
-1@@ -1389,7 +1389,8 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)* tuning procedure before sending command. */ if ((host->flags &SDHCI_NEEDS_RETUNING ) && - !(present_state & (SDHCI_DOING_WRITE |SDHCI_DOING_READ ))) { + !(present_state & (SDHCI_DOING_WRITE |SDHCI_DOING_READ )) && +mmc_cmd_type (mrq->cmd) ==MMC_CMD_ADTC ) {
I don't have the in-depth knowledge about the sdhci; Still, to me it seems like checking for MMC_CMD_ADTC, is that not just the same a checking if there are a READ/WRITE?
Another note, we really should be working on moving the periodic "re-tuning trigger" mechanism into the mmc core layer, so all host driver's could benefit from this. Do you want to help out fixing this?
Kind regards
Ulf Hansson
Quoted 10 lines
drivers/mmc/host/sdhci.c +0
-1if (mmc->card) {/* eMMC uses cmd21 but sd and sdio use cmd19 */ tuning_opcode = --1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Ulf,
Quoted 19 lines · Ulf Hansson
Quoted 9 lines · Franky Lin
For high clock frequency modes, ie. SDR104 and possibly SDR50, the data window on the CMD and DAT lines needs to be tuned. Once tuned to a sample clock rate, a re-tuning might required because of drifted signal on different lines. This re-tuning is needed and only necessary for commands using the DAT lines, ie. adtc type commands. This patch is an optimization by adding the condition of the requested command being adtc type in order to execute the re-tuning procedure.
Signed-off-by Franky Lin <[email protected]>Hi Franky,
Sorry for the delay.
Quoted 4 lines
--- drivers/mmc/host/sdhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 15 lines
drivers/mmc/host/sdhci.c static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) · line 1393
Quoted 11 lines
drivers/mmc/host/sdhci.c +2
-1@@ -1389,7 +1389,8 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)* tuning procedure before sending command. */ if ((host->flags &SDHCI_NEEDS_RETUNING ) && - !(present_state & (SDHCI_DOING_WRITE |SDHCI_DOING_READ ))) { + !(present_state & (SDHCI_DOING_WRITE |SDHCI_DOING_READ )) && +mmc_cmd_type (mrq->cmd) ==MMC_CMD_ADTC ) {I don't have the in-depth knowledge about the sdhci; Still, to me it seems like checking for
MMC_CMD_ADTC, is that not just the same a checking if there are a READ/WRITE?
non-adtc commands like CMD17/CMD24/CMD52 do not use the data lines. Tuning is only necessary for adtc commands as CMD18/CMD25/CMD53 which involve data lines.
Quoted 3 lines
Another note, we really should be working on moving the periodic "re-tuning trigger" mechanism into the mmc core layer, so all host driver's could benefit from this. Do you want to help out fixing this?
I thought about this before but hesitated because of non-sdhci drivers. I have seen some of them don't have standardized implementation(well if they do they would have used sdhci anyway).
Thanks,
Franky
Quoted 18 lines
Kind regards
Ulf HanssonQuoted 10 lines
drivers/mmc/host/sdhci.c +0
-1if (mmc->card) {/* eMMC uses cmd21 but sd and sdio use cmd19 */ tuning_opcode = --1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 41 lines · Franky Lin
Hi Ulf,
Quoted 29 lines · Ulf Hansson
Quoted 9 lines · Franky Lin
For high clock frequency modes, ie. SDR104 and possibly SDR50, the data window on the CMD and DAT lines needs to be tuned. Once tuned to a sample clock rate, a re-tuning might required because of drifted signal on different lines. This re-tuning is needed and only necessary for commands using the DAT lines, ie. adtc type commands. This patch is an optimization by adding the condition of the requested command being adtc type in order to execute the re-tuning procedure.
Signed-off-by Franky Lin <[email protected]>Hi Franky,
Sorry for the delay.
Quoted 14 lines
--- drivers/mmc/host/sdhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/mmc/host/sdhci.c +0
-1@@ -1389,7 +1389,8 @@ static void sdhci_request(struct mmc_host*mmc, struct mmc_request *mrq) * tuning procedure before sending command. */ if ((host->flags & SDHCI_NEEDS_RETUNING) && - !(present_state & (SDHCI_DOING_WRITE |Quoted 8 lines
Quoted 4 lines
drivers/mmc/host/sdhci.c +1
-0SDHCI_DOING_READ))) { + !(present_state & (SDHCI_DOING_WRITE |
SDHCI_DOING_READ)) &&
+mmc_cmd_type(mrq->cmd)==MMC_CMD_ADTC) {I don't have the in-depth knowledge about the sdhci; Still, to me it seems like checking for
MMC_CMD_ADTC, is that not just the same a checking if there are a READ/WRITE?
Quoted 8 lines
non-adtc commands like CMD17/CMD24/CMD52 do not use the data lines. Tuning is only necessary for adtc commands as CMD18/CMD25/CMD53 which involve data lines.
Quoted 3 lines
Another note, we really should be working on moving the periodic "re-tuning trigger" mechanism into the mmc core layer, so all host driver's could benefit from this. Do you want to help out fixing this?
I thought about this before but hesitated because of non-sdhci drivers. I have seen some of them don't have standardized implementation(well if they do they would have used sdhci anyway).
Ping?