* [PATCH 1/9] mmc: meson-gx: fix setting f_min
@ 2017-01-31 20:57 ` Heiner Kallweit
2017-02-01 11:49 ` Jaehoon Chung
0 siblings, 1 reply; 4+ messages in thread
From: Heiner Kallweit @ 2017-01-31 20:57 UTC (permalink / raw)
To: Ulf Hansson; +Cc: Carlo Caione, Kevin Hilman, linux-mmc
Currently f_min is set to 4 MHz whilst the comment states 400 MHz.
I think the itention is to set f_min to 400 kHz.
Change value and comment accordingly.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/mmc/host/meson-gx-mmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index 5eca88bc..da3cce31 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -268,7 +268,7 @@ static int meson_mmc_clk_init(struct meson_host *host)
if (f_min != UINT_MAX)
f_min = DIV_ROUND_UP(CLK_SRC_XTAL_RATE, CLK_DIV_MAX);
else
- f_min = 4000000; /* default min: 400 MHz */
+ f_min = 400000; /* default min: 400 kHz */
host->mmc->f_min = f_min;
/* create the mux */
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/9] mmc: meson-gx: fix setting f_min
2017-01-31 20:57 ` [PATCH 1/9] mmc: meson-gx: fix setting f_min Heiner Kallweit
@ 2017-02-01 11:49 ` Jaehoon Chung
2017-02-01 20:14 ` Heiner Kallweit
0 siblings, 1 reply; 4+ messages in thread
From: Jaehoon Chung @ 2017-02-01 11:49 UTC (permalink / raw)
To: Heiner Kallweit, Ulf Hansson; +Cc: Carlo Caione, Kevin Hilman, linux-mmc
On 02/01/2017 05:57 AM, Heiner Kallweit wrote:
> Currently f_min is set to 4 MHz whilst the comment states 400 MHz.
> I think the itention is to set f_min to 400 kHz.
> Change value and comment accordingly.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> drivers/mmc/host/meson-gx-mmc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
> index 5eca88bc..da3cce31 100644
> --- a/drivers/mmc/host/meson-gx-mmc.c
> +++ b/drivers/mmc/host/meson-gx-mmc.c
> @@ -268,7 +268,7 @@ static int meson_mmc_clk_init(struct meson_host *host)
> if (f_min != UINT_MAX)
> f_min = DIV_ROUND_UP(CLK_SRC_XTAL_RATE, CLK_DIV_MAX);
> else
> - f_min = 4000000; /* default min: 400 MHz */
> + f_min = 400000; /* default min: 400 kHz */
I'm not sure but f_min can be 100KHz by default, not 400KHz.
Because mmc-core should be try to find frequency from 400KHz to "f_min" value.
Best Regards,
Jaehoon Chung
> host->mmc->f_min = f_min;
>
> /* create the mux */
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/9] mmc: meson-gx: fix setting f_min
2017-02-01 11:49 ` Jaehoon Chung
@ 2017-02-01 20:14 ` Heiner Kallweit
2017-02-03 13:58 ` Kevin Hilman
0 siblings, 1 reply; 4+ messages in thread
From: Heiner Kallweit @ 2017-02-01 20:14 UTC (permalink / raw)
To: Jaehoon Chung, Ulf Hansson, Kevin Hilman; +Cc: Carlo Caione, linux-mmc
Am 01.02.2017 um 12:49 schrieb Jaehoon Chung:
> On 02/01/2017 05:57 AM, Heiner Kallweit wrote:
>> Currently f_min is set to 4 MHz whilst the comment states 400 MHz.
>> I think the itention is to set f_min to 400 kHz.
>> Change value and comment accordingly.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>> drivers/mmc/host/meson-gx-mmc.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
>> index 5eca88bc..da3cce31 100644
>> --- a/drivers/mmc/host/meson-gx-mmc.c
>> +++ b/drivers/mmc/host/meson-gx-mmc.c
>> @@ -268,7 +268,7 @@ static int meson_mmc_clk_init(struct meson_host *host)
>> if (f_min != UINT_MAX)
>> f_min = DIV_ROUND_UP(CLK_SRC_XTAL_RATE, CLK_DIV_MAX);
>> else
>> - f_min = 4000000; /* default min: 400 MHz */
>> + f_min = 400000; /* default min: 400 kHz */
>
> I'm not sure but f_min can be 100KHz by default, not 400KHz.
> Because mmc-core should be try to find frequency from 400KHz to "f_min" value.
>
Actually I wonder how we can ever reach this part of the if clause.
If at least one parent clock is defined and we can get its clock rate
then f_min != UINT_MAX.
Can we think of a case where no parent clock is defined?
And would it make sense at all to proceed in this case?
> Best Regards,
> Jaehoon Chung
>
>> host->mmc->f_min = f_min;
>>
>> /* create the mux */
>>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/9] mmc: meson-gx: fix setting f_min
2017-02-01 20:14 ` Heiner Kallweit
@ 2017-02-03 13:58 ` Kevin Hilman
0 siblings, 0 replies; 4+ messages in thread
From: Kevin Hilman @ 2017-02-03 13:58 UTC (permalink / raw)
To: Heiner Kallweit; +Cc: Jaehoon Chung, Ulf Hansson, Carlo Caione, linux-mmc
Heiner Kallweit <hkallweit1@gmail.com> writes:
> Am 01.02.2017 um 12:49 schrieb Jaehoon Chung:
>> On 02/01/2017 05:57 AM, Heiner Kallweit wrote:
>>> Currently f_min is set to 4 MHz whilst the comment states 400 MHz.
>>> I think the itention is to set f_min to 400 kHz.
>>> Change value and comment accordingly.
>>>
>>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>>> ---
>>> drivers/mmc/host/meson-gx-mmc.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
>>> index 5eca88bc..da3cce31 100644
>>> --- a/drivers/mmc/host/meson-gx-mmc.c
>>> +++ b/drivers/mmc/host/meson-gx-mmc.c
>>> @@ -268,7 +268,7 @@ static int meson_mmc_clk_init(struct meson_host *host)
>>> if (f_min != UINT_MAX)
>>> f_min = DIV_ROUND_UP(CLK_SRC_XTAL_RATE, CLK_DIV_MAX);
>>> else
>>> - f_min = 4000000; /* default min: 400 MHz */
>>> + f_min = 400000; /* default min: 400 kHz */
>>
>> I'm not sure but f_min can be 100KHz by default, not 400KHz.
>> Because mmc-core should be try to find frequency from 400KHz to "f_min" value.
>>
> Actually I wonder how we can ever reach this part of the if clause.
> If at least one parent clock is defined and we can get its clock rate
> then f_min != UINT_MAX.
> Can we think of a case where no parent clock is defined?
> And would it make sense at all to proceed in this case?
This is actually common while adding a new board or SoC and is a useful
fallback/safeguard.
Kevin
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-02-03 13:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20170131210651epcas5p37ca57e71ecbab37efe9b0227e4449d30@epcas5p3.samsung.com>
2017-01-31 20:57 ` [PATCH 1/9] mmc: meson-gx: fix setting f_min Heiner Kallweit
2017-02-01 11:49 ` Jaehoon Chung
2017-02-01 20:14 ` Heiner Kallweit
2017-02-03 13:58 ` Kevin Hilman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox