diff mbox

mmc: duplicated trial with same freq when mmc_rescan_try_freq()

Message ID 4DCB97F3.9060704@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jaehoon Chung May 12, 2011, 8:18 a.m. UTC
when running mmc_rescan_try_freq(), try to init two times with last frequency.
For example, assume that host->f_min is 400KHz, we can find the below message.

mmc1: mmc_rescan_try_freq: trying to init card at 400000 Hz
mmc1: mmc_rescan_try_freq: trying to init card at 400000 Hz

i didn't find to mention about this..why try to init the two times with same frequency?
Is there any reason? If i missed the history, plz let me know them.

I think that trial is not necessary. Trial needs to running with other frequency.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/mmc/core/core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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

Comments

Huang Changming-R66093 May 12, 2011, 8:57 a.m. UTC | #1
The required min frequency (f_min) is 400KHz during identify stage, is it necessary to use the  frequency table (freqs[], including 300KHz, 200KHz and 100KHz)?

Thanks and Best Regards
Jerry Huang


> -----Original Message-----
> From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
> owner@vger.kernel.org] On Behalf Of Jaehoon Chung
> Sent: Thursday, May 12, 2011 4:19 PM
> To: linux-mmc@vger.kernel.org
> Cc: Chris Ball; Kyungmin Park; andy.ross@windriver.com
> Subject: [PATCH] mmc: duplicated trial with same freq when
> mmc_rescan_try_freq()
> 
> when running mmc_rescan_try_freq(), try to init two times with last
> frequency.
> For example, assume that host->f_min is 400KHz, we can find the below
> message.
> 
> mmc1: mmc_rescan_try_freq: trying to init card at 400000 Hz
> mmc1: mmc_rescan_try_freq: trying to init card at 400000 Hz
> 
> i didn't find to mention about this..why try to init the two times with
> same frequency?
> Is there any reason? If i missed the history, plz let me know them.
> 
> I think that trial is not necessary. Trial needs to running with other
> frequency.
> 
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  drivers/mmc/core/core.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index
> 61c6c0b..a330c58 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1618,7 +1618,7 @@ void mmc_rescan(struct work_struct *work)
>  	for (i = 0; i < ARRAY_SIZE(freqs); i++) {
>  		if (!mmc_rescan_try_freq(host, max(freqs[i], host->f_min)))
>  			break;
> -		if (freqs[i] < host->f_min)
> +		if (freqs[i] <= host->f_min)
>  			break;
>  	}
>  	mmc_release_host(host);
> --
> 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 12, 2011, 11:18 a.m. UTC | #2
This patch didn't point that..

Huang Changming-R66093 wrote:
> The required min frequency (f_min) is 400KHz during identify stage, is it necessary to use the  frequency table (freqs[], including 300KHz, 200KHz and 100KHz)?

i known that some card needs lower than 400KHz..so this approach is not problem..
But i mentions that try to init two times with same frequency.

Regards,
Jaehoon Chung

> 
> Thanks and Best Regards
> Jerry Huang
> 
> 
>> -----Original Message-----
>> From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
>> owner@vger.kernel.org] On Behalf Of Jaehoon Chung
>> Sent: Thursday, May 12, 2011 4:19 PM
>> To: linux-mmc@vger.kernel.org
>> Cc: Chris Ball; Kyungmin Park; andy.ross@windriver.com
>> Subject: [PATCH] mmc: duplicated trial with same freq when
>> mmc_rescan_try_freq()
>>
>> when running mmc_rescan_try_freq(), try to init two times with last
>> frequency.
>> For example, assume that host->f_min is 400KHz, we can find the below
>> message.
>>
>> mmc1: mmc_rescan_try_freq: trying to init card at 400000 Hz
>> mmc1: mmc_rescan_try_freq: trying to init card at 400000 Hz
>>
>> i didn't find to mention about this..why try to init the two times with
>> same frequency?
>> Is there any reason? If i missed the history, plz let me know them.
>>
>> I think that trial is not necessary. Trial needs to running with other
>> frequency.
>>
>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>>  drivers/mmc/core/core.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index
>> 61c6c0b..a330c58 100644
>> --- a/drivers/mmc/core/core.c
>> +++ b/drivers/mmc/core/core.c
>> @@ -1618,7 +1618,7 @@ void mmc_rescan(struct work_struct *work)
>>  	for (i = 0; i < ARRAY_SIZE(freqs); i++) {
>>  		if (!mmc_rescan_try_freq(host, max(freqs[i], host->f_min)))
>>  			break;
>> -		if (freqs[i] < host->f_min)
>> +		if (freqs[i] <= host->f_min)
>>  			break;
>>  	}
>>  	mmc_release_host(host);
>> --
>> 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
Chris Ball May 12, 2011, 2:04 p.m. UTC | #3
Hi,

On Thu, May 12 2011, Huang Changming-R66093 wrote:
> The required min frequency (f_min) is 400KHz during identify stage, is
> it necessary to use the frequency table (freqs[], including 300KHz,
> 200KHz and 100KHz)?

Yes.  Some hardware is buggy/out of compliance with the spec.

- Chris.
Jaehoon Chung May 13, 2011, 2:16 a.m. UTC | #4
Hi Chris..

My question is others..I agreed the using frequency table..

But my questions is this...
For example, if f_min is 300KHz, you can the below message.

mmc1: mmc_rescan_try_freq: trying to init card at 400000 Hz
mmc1: mmc_rescan_try_freq: trying to init card at 300000 Hz
mmc1: mmc_rescan_try_freq: trying to init card at 300000 Hz

In other words, first init card with 400KHZ, 
but second/third to init with 300KHz. 
i think not necessary that try to initialize the two times with 300KHz.

I want to know your opinion..

Regards,
Jaehoon Chung

Chris Ball wrote:
> Hi,
> 
> On Thu, May 12 2011, Huang Changming-R66093 wrote:
>> The required min frequency (f_min) is 400KHz during identify stage, is
>> it necessary to use the frequency table (freqs[], including 300KHz,
>> 200KHz and 100KHz)?
> 
> Yes.  Some hardware is buggy/out of compliance with the spec.
> 
> - Chris.

--
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
Andy Ross May 13, 2011, 4:18 p.m. UTC | #5
On 05/12/2011 07:16 PM, Jaehoon Chung wrote:
> In other words, first init card with 400KHZ, 
> but second/third to init with 300KHz. 
> i think not necessary that try to initialize the two times with 300KHz.

This sounds like a correct patch to me.  Presumably the board I was
using had a f_min that didn't match one of the table entries exactly,
so I didn't see the mixed up equality condition.  Unfortunately that
board is gone now, so I can't test.  But the logic looks fine.

Andy
--
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
Chris Ball May 13, 2011, 4:48 p.m. UTC | #6
Hi Jaehoon,

On Thu, May 12 2011, Jaehoon Chung wrote:
> when running mmc_rescan_try_freq(), try to init two times with last frequency.
> For example, assume that host->f_min is 400KHz, we can find the below message.
>
> mmc1: mmc_rescan_try_freq: trying to init card at 400000 Hz
> mmc1: mmc_rescan_try_freq: trying to init card at 400000 Hz
>
> i didn't find to mention about this..why try to init the two times with same frequency?
> Is there any reason? If i missed the history, plz let me know them.
>
> I think that trial is not necessary. Trial needs to running with other frequency.
>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  drivers/mmc/core/core.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 61c6c0b..a330c58 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1618,7 +1618,7 @@ void mmc_rescan(struct work_struct *work)
>  	for (i = 0; i < ARRAY_SIZE(freqs); i++) {
>  		if (!mmc_rescan_try_freq(host, max(freqs[i], host->f_min)))
>  			break;
> -		if (freqs[i] < host->f_min)
> +		if (freqs[i] <= host->f_min)
>  			break;
>  	}
>  	mmc_release_host(host);
>

Thanks, merged to mmc-next for .40.

- Chris.
diff mbox

Patch

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 61c6c0b..a330c58 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1618,7 +1618,7 @@  void mmc_rescan(struct work_struct *work)
 	for (i = 0; i < ARRAY_SIZE(freqs); i++) {
 		if (!mmc_rescan_try_freq(host, max(freqs[i], host->f_min)))
 			break;
-		if (freqs[i] < host->f_min)
+		if (freqs[i] <= host->f_min)
 			break;
 	}
 	mmc_release_host(host);