diff mbox

[1/2] mmc: dw_mmc: retry to switch voltage when failed

Message ID 1462346074-19113-1-git-send-email-jh80.chung@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jaehoon Chung May 4, 2016, 7:14 a.m. UTC
If vqmmc is used and failed to switch voltage, then retry to switch
voltage. MMC core is providing the retrying scheame.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
 drivers/mmc/host/dw_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Shawn Lin May 4, 2016, 10:41 a.m. UTC | #1
? 2016/5/4 15:14, Jaehoon Chung ??:
> If vqmmc is used and failed to switch voltage, then retry to switch
> voltage. MMC core is providing the retrying scheame.
>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> ---
>  drivers/mmc/host/dw_mmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 9dd1bd3..28602cc 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -1416,7 +1416,7 @@ static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)
>  			dev_dbg(&mmc->class_dev,
>  					 "Regulator set error %d - %s V\n",
>  					 ret, uhs & v18 ? "1.8" : "3.3");
> -			return ret;
> +			return -EAGAIN;
>  		}
>  	}

If not vqmmc is assigned, dw_mci_switch_voltage still returns success to
mmc core?

>  	mci_writel(host, UHS_REG, uhs);
>
Jaehoon Chung May 10, 2016, 1:55 a.m. UTC | #2
Hi Shawn,

On 05/04/2016 07:41 PM, Shawn Lin wrote:
> ? 2016/5/4 15:14, Jaehoon Chung ??:
>> If vqmmc is used and failed to switch voltage, then retry to switch
>> voltage. MMC core is providing the retrying scheame.
>>
>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>> ---
>>  drivers/mmc/host/dw_mmc.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
>> index 9dd1bd3..28602cc 100644
>> --- a/drivers/mmc/host/dw_mmc.c
>> +++ b/drivers/mmc/host/dw_mmc.c
>> @@ -1416,7 +1416,7 @@ static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)
>>              dev_dbg(&mmc->class_dev,
>>                       "Regulator set error %d - %s V\n",
>>                       ret, uhs & v18 ? "1.8" : "3.3");
>> -            return ret;
>> +            return -EAGAIN;
>>          }
>>      }
> 
> If not vqmmc is assigned, dw_mci_switch_voltage still returns success to
> mmc core?

There is comment in dw_mci_switch_voltage().. In some SoC, it's not harmful to switch voltage.
But we can decide this condition whether try to set both or not. 

Best Regards,
Jaehoon Chung

> 
>>      mci_writel(host, UHS_REG, uhs);
>>
> 
> 

--
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
Shawn Lin May 10, 2016, 9:24 a.m. UTC | #3
On 2016/5/10 9:55, Jaehoon Chung wrote:
> Hi Shawn,
>
> On 05/04/2016 07:41 PM, Shawn Lin wrote:
>> ? 2016/5/4 15:14, Jaehoon Chung ??:
>>> If vqmmc is used and failed to switch voltage, then retry to switch
>>> voltage. MMC core is providing the retrying scheame.
>>>
>>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>>> ---
>>>  drivers/mmc/host/dw_mmc.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
>>> index 9dd1bd3..28602cc 100644
>>> --- a/drivers/mmc/host/dw_mmc.c
>>> +++ b/drivers/mmc/host/dw_mmc.c
>>> @@ -1416,7 +1416,7 @@ static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)
>>>              dev_dbg(&mmc->class_dev,
>>>                       "Regulator set error %d - %s V\n",
>>>                       ret, uhs & v18 ? "1.8" : "3.3");
>>> -            return ret;
>>> +            return -EAGAIN;
>>>          }
>>>      }
>>
>> If not vqmmc is assigned, dw_mci_switch_voltage still returns success to
>> mmc core?
>
> There is comment in dw_mci_switch_voltage().. In some SoC, it's not harmful to switch voltage.
> But we can decide this condition whether try to set both or not.


Because for dw_mmc-rockchip, we always need to swicth voltage by
regulator. So do you mean some exynos Socs can switch voltage just
by setting UHS_REG!?  So to make things safe, we can set UHS_REG and
switch voltage by  regulator both?



>
> Best Regards,
> Jaehoon Chung
>
>>
>>>      mci_writel(host, UHS_REG, uhs);
>>>
>>
>>
>
> --
> 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
Jaehoon Chung May 11, 2016, 2:51 a.m. UTC | #4
On 05/10/2016 06:24 PM, Shawn Lin wrote:
> On 2016/5/10 9:55, Jaehoon Chung wrote:
>> Hi Shawn,
>>
>> On 05/04/2016 07:41 PM, Shawn Lin wrote:
>>> ? 2016/5/4 15:14, Jaehoon Chung ??:
>>>> If vqmmc is used and failed to switch voltage, then retry to switch
>>>> voltage. MMC core is providing the retrying scheame.
>>>>
>>>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>>>> ---
>>>>  drivers/mmc/host/dw_mmc.c | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
>>>> index 9dd1bd3..28602cc 100644
>>>> --- a/drivers/mmc/host/dw_mmc.c
>>>> +++ b/drivers/mmc/host/dw_mmc.c
>>>> @@ -1416,7 +1416,7 @@ static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)
>>>>              dev_dbg(&mmc->class_dev,
>>>>                       "Regulator set error %d - %s V\n",
>>>>                       ret, uhs & v18 ? "1.8" : "3.3");
>>>> -            return ret;
>>>> +            return -EAGAIN;
>>>>          }
>>>>      }
>>>
>>> If not vqmmc is assigned, dw_mci_switch_voltage still returns success to
>>> mmc core?
>>
>> There is comment in dw_mci_switch_voltage().. In some SoC, it's not harmful to switch voltage.
>> But we can decide this condition whether try to set both or not.
> 
> 
> Because for dw_mmc-rockchip, we always need to swicth voltage by
> regulator. So do you mean some exynos Socs can switch voltage just
> by setting UHS_REG!?  So to make things safe, we can set UHS_REG and
> switch voltage by  regulator both?

Ok. I will update the patch.

Best Regards,
Jaehoon Chung

> 
> 
> 
>>
>> Best Regards,
>> Jaehoon Chung
>>
>>>
>>>>      mci_writel(host, UHS_REG, uhs);
>>>>
>>>
>>>
>>
>> -- 
>> 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
> 
> 

--
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
diff mbox

Patch

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 9dd1bd3..28602cc 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1416,7 +1416,7 @@  static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)
 			dev_dbg(&mmc->class_dev,
 					 "Regulator set error %d - %s V\n",
 					 ret, uhs & v18 ? "1.8" : "3.3");
-			return ret;
+			return -EAGAIN;
 		}
 	}
 	mci_writel(host, UHS_REG, uhs);