linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci: only invoke clock re-tuning for adtc type commands
       [not found] <1389119511-26228-1-git-send-email-frankyl@broadcom.com>
@ 2014-01-07 18:37 ` Franky Lin
  2014-02-24 19:57   ` Franky Lin
  2014-03-17  9:12   ` Ulf Hansson
  0 siblings, 2 replies; 7+ messages in thread
From: Franky Lin @ 2014-01-07 18:37 UTC (permalink / raw)
  To: chris; +Cc: linux-mmc

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 <frankyl@broadcom.com>
---
 drivers/mmc/host/sdhci.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index cc00bed..f301cd6 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -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 =
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] mmc: sdhci: only invoke clock re-tuning for adtc type commands
  2014-01-07 18:37 ` [PATCH] mmc: sdhci: only invoke clock re-tuning for adtc type commands Franky Lin
@ 2014-02-24 19:57   ` Franky Lin
  2014-03-07 19:54     ` Franky Lin
  2014-03-17  9:12   ` Ulf Hansson
  1 sibling, 1 reply; 7+ messages in thread
From: Franky Lin @ 2014-02-24 19:57 UTC (permalink / raw)
  To: chris; +Cc: linux-mmc

Hi Chris,

On 01/07/2014 10:37 AM, Franky Lin wrote:
> 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 <frankyl@broadcom.com>
> ---

Is this still in your queue? Any remarks on it?

Thanks,
Franky

>   drivers/mmc/host/sdhci.c |    3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index cc00bed..f301cd6 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -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 =
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mmc: sdhci: only invoke clock re-tuning for adtc type commands
  2014-02-24 19:57   ` Franky Lin
@ 2014-03-07 19:54     ` Franky Lin
  2014-03-15 19:16       ` Franky Lin
  0 siblings, 1 reply; 7+ messages in thread
From: Franky Lin @ 2014-03-07 19:54 UTC (permalink / raw)
  To: chris; +Cc: linux-mmc, ulf.hansson

On 02/24/2014 11:57 AM, Franky Lin wrote:
> Hi Chris,
>
> On 01/07/2014 10:37 AM, Franky Lin wrote:
>> 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 <frankyl@broadcom.com>
>> ---
>
> Is this still in your queue? Any remarks on it?
>
> Thanks,
> Franky
>

Ping?

>>   drivers/mmc/host/sdhci.c |    3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>> index cc00bed..f301cd6 100644
>> --- a/drivers/mmc/host/sdhci.c
>> +++ b/drivers/mmc/host/sdhci.c
>> @@ -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 =
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mmc: sdhci: only invoke clock re-tuning for adtc type commands
  2014-03-07 19:54     ` Franky Lin
@ 2014-03-15 19:16       ` Franky Lin
  0 siblings, 0 replies; 7+ messages in thread
From: Franky Lin @ 2014-03-15 19:16 UTC (permalink / raw)
  To: chris, ulf.hansson; +Cc: linux-mmc

Hi Chris and Ulf,

On 03/07/2014 11:54 AM, Franky Lin wrote:
> On 02/24/2014 11:57 AM, Franky Lin wrote:
>> Hi Chris,
>>
>> On 01/07/2014 10:37 AM, Franky Lin wrote:
>>> 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 <frankyl@broadcom.com>
>>> ---
>>
>> Is this still in your queue? Any remarks on it?
>>
>> Thanks,
>> Franky
>>
>
> Ping?

Need to try my luck again. :) Could you please share your thought about 
this patch?

Thanks,
Franky

>
>>>   drivers/mmc/host/sdhci.c |    3 ++-
>>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>>> index cc00bed..f301cd6 100644
>>> --- a/drivers/mmc/host/sdhci.c
>>> +++ b/drivers/mmc/host/sdhci.c
>>> @@ -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 =
>>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
>> the body of a message to majordomo@vger.kernel.org
>> 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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mmc: sdhci: only invoke clock re-tuning for adtc type commands
  2014-01-07 18:37 ` [PATCH] mmc: sdhci: only invoke clock re-tuning for adtc type commands Franky Lin
  2014-02-24 19:57   ` Franky Lin
@ 2014-03-17  9:12   ` Ulf Hansson
  2014-03-17 16:51     ` Franky Lin
  1 sibling, 1 reply; 7+ messages in thread
From: Ulf Hansson @ 2014-03-17  9:12 UTC (permalink / raw)
  To: Franky Lin; +Cc: Chris Ball, linux-mmc

On 7 January 2014 19:37, Franky Lin <frankyl@broadcom.com> wrote:
> 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 <frankyl@broadcom.com>

Hi Franky,

Sorry for the delay.

> ---
>  drivers/mmc/host/sdhci.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index cc00bed..f301cd6 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -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

>                         if (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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mmc: sdhci: only invoke clock re-tuning for adtc type commands
  2014-03-17  9:12   ` Ulf Hansson
@ 2014-03-17 16:51     ` Franky Lin
  2014-03-26 16:49       ` Franky Lin
  0 siblings, 1 reply; 7+ messages in thread
From: Franky Lin @ 2014-03-17 16:51 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: Chris Ball, linux-mmc

Hi Ulf,

On 03/17/2014 02:12 AM, Ulf Hansson wrote:
> On 7 January 2014 19:37, Franky Lin <frankyl@broadcom.com> wrote:
>> 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 <frankyl@broadcom.com>
>
> Hi Franky,
>
> Sorry for the delay.
>
>> ---
>>   drivers/mmc/host/sdhci.c |    3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>> index cc00bed..f301cd6 100644
>> --- a/drivers/mmc/host/sdhci.c
>> +++ b/drivers/mmc/host/sdhci.c
>> @@ -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.

> 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

> Kind regards
> Ulf Hansson
>
>>                          if (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 majordomo@vger.kernel.org
>> 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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] mmc: sdhci: only invoke clock re-tuning for adtc type commands
  2014-03-17 16:51     ` Franky Lin
@ 2014-03-26 16:49       ` Franky Lin
  0 siblings, 0 replies; 7+ messages in thread
From: Franky Lin @ 2014-03-26 16:49 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball; +Cc: linux-mmc

On 03/17/2014 09:51 AM, Franky Lin wrote:
> Hi Ulf,
>
> On 03/17/2014 02:12 AM, Ulf Hansson wrote:
>> On 7 January 2014 19:37, Franky Lin <frankyl@broadcom.com> wrote:
>>> 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 <frankyl@broadcom.com>
>>
>> Hi Franky,
>>
>> Sorry for the delay.
>>
>>> ---
>>>   drivers/mmc/host/sdhci.c |    3 ++-
>>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>>> index cc00bed..f301cd6 100644
>>> --- a/drivers/mmc/host/sdhci.c
>>> +++ b/drivers/mmc/host/sdhci.c
>>> @@ -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.
>
>> 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?



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-03-26 16:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1389119511-26228-1-git-send-email-frankyl@broadcom.com>
2014-01-07 18:37 ` [PATCH] mmc: sdhci: only invoke clock re-tuning for adtc type commands Franky Lin
2014-02-24 19:57   ` Franky Lin
2014-03-07 19:54     ` Franky Lin
2014-03-15 19:16       ` Franky Lin
2014-03-17  9:12   ` Ulf Hansson
2014-03-17 16:51     ` Franky Lin
2014-03-26 16:49       ` Franky Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).