Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1562560 > unrolled thread

Re: [RESEND PATCHv1 6/8] mmc: sdhci: Clear SDHCI_HS400_TUNING flag after platform_execute_tuning

Started byAdrian Hunter <adrian.hunter@intel.com>
First post2017-01-19 11:20 +0100
Last post2017-01-19 12:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [RESEND PATCHv1 6/8] mmc: sdhci: Clear SDHCI_HS400_TUNING flag  after platform_execute_tuning Adrian Hunter <adrian.hunter@intel.com> - 2017-01-19 11:20 +0100
    Re: [RESEND PATCHv1 6/8] mmc: sdhci: Clear SDHCI_HS400_TUNING flag  after platform_execute_tuning Ritesh Harjani <riteshh@codeaurora.org> - 2017-01-19 12:50 +0100

#1562560 — Re: [RESEND PATCHv1 6/8] mmc: sdhci: Clear SDHCI_HS400_TUNING flag after platform_execute_tuning

FromAdrian Hunter <adrian.hunter@intel.com>
Date2017-01-19 11:20 +0100
SubjectRe: [RESEND PATCHv1 6/8] mmc: sdhci: Clear SDHCI_HS400_TUNING flag after platform_execute_tuning
Message-ID<t1hZ0-cB-19@gated-at.bofh.it>
On 10/01/17 09:00, Ritesh Harjani wrote:
> Clear SDHCI_HS400_TUNING flag after platform_execute_tuning
> so that platform_execute_tuning may use it if needed.

Sorry for the slow reply.

platform_execute_tuning() should not really exist because it doesn't do
anything useful.

If it is not too much trouble please consider just hooking
->execute_tuning() directly i.e.

	host->mmc_host_ops.execute_tuning = sdhci_msm_execute_tuning;

Then you can use and clear the flag in sdhci_msm_execute_tuning().

> 
> Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
> ---
>  drivers/mmc/host/sdhci.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 2390980..2658f89 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -2114,7 +2114,6 @@ int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
>  	spin_lock_irqsave(&host->lock, flags);
>  
>  	hs400_tuning = host->flags & SDHCI_HS400_TUNING;
> -	host->flags &= ~SDHCI_HS400_TUNING;
>  
>  	if (host->tuning_mode == SDHCI_TUNING_MODE_1)
>  		tuning_count = host->tuning_count;
> @@ -2156,7 +2155,9 @@ int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
>  
>  	if (host->ops->platform_execute_tuning) {
>  		spin_unlock_irqrestore(&host->lock, flags);
> -		return host->ops->platform_execute_tuning(host, opcode);
> +		err = host->ops->platform_execute_tuning(host, opcode);
> +		spin_lock_irqsave(&host->lock, flags);
> +		goto out_unlock;
>  	}
>  
>  	host->mmc->retune_period = tuning_count;
> @@ -2167,6 +2168,7 @@ int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
>  
>  	sdhci_end_tuning(host);
>  out_unlock:
> +	host->flags &= ~SDHCI_HS400_TUNING;
>  	spin_unlock_irqrestore(&host->lock, flags);
>  
>  	return err;
> 

[toc] | [next] | [standalone]


#1562643

FromRitesh Harjani <riteshh@codeaurora.org>
Date2017-01-19 12:50 +0100
Message-ID<t1jo6-10B-15@gated-at.bofh.it>
In reply to#1562560
Hi Adrian,

Thanks for reviewing.

On 1/19/2017 3:40 PM, Adrian Hunter wrote:
> On 10/01/17 09:00, Ritesh Harjani wrote:
>> Clear SDHCI_HS400_TUNING flag after platform_execute_tuning
>> so that platform_execute_tuning may use it if needed.
>
> Sorry for the slow reply.
>
> platform_execute_tuning() should not really exist because it doesn't do
> anything useful.
>
> If it is not too much trouble please consider just hooking
> ->execute_tuning() directly i.e.
>
> 	host->mmc_host_ops.execute_tuning = sdhci_msm_execute_tuning;
>
> Then you can use and clear the flag in sdhci_msm_execute_tuning().
Sure, this seems fine. I will try it and re-submit based on your above 
suggestion.

Regards
Ritesh


>
>>
>> Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
>> ---
>>  drivers/mmc/host/sdhci.c | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>> index 2390980..2658f89 100644
>> --- a/drivers/mmc/host/sdhci.c
>> +++ b/drivers/mmc/host/sdhci.c
>> @@ -2114,7 +2114,6 @@ int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
>>  	spin_lock_irqsave(&host->lock, flags);
>>
>>  	hs400_tuning = host->flags & SDHCI_HS400_TUNING;
>> -	host->flags &= ~SDHCI_HS400_TUNING;
>>
>>  	if (host->tuning_mode == SDHCI_TUNING_MODE_1)
>>  		tuning_count = host->tuning_count;
>> @@ -2156,7 +2155,9 @@ int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
>>
>>  	if (host->ops->platform_execute_tuning) {
>>  		spin_unlock_irqrestore(&host->lock, flags);
>> -		return host->ops->platform_execute_tuning(host, opcode);
>> +		err = host->ops->platform_execute_tuning(host, opcode);
>> +		spin_lock_irqsave(&host->lock, flags);
>> +		goto out_unlock;
>>  	}
>>
>>  	host->mmc->retune_period = tuning_count;
>> @@ -2167,6 +2168,7 @@ int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
>>
>>  	sdhci_end_tuning(host);
>>  out_unlock:
>> +	host->flags &= ~SDHCI_HS400_TUNING;
>>  	spin_unlock_irqrestore(&host->lock, flags);
>>
>>  	return err;
>>
>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web