public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: duplicated trial with same freq when mmc_rescan_try_freq()
@ 2011-05-12  8:18 Jaehoon Chung
  2011-05-12  8:57 ` Huang Changming-R66093
  2011-05-13 16:48 ` Chris Ball
  0 siblings, 2 replies; 7+ messages in thread
From: Jaehoon Chung @ 2011-05-12  8:18 UTC (permalink / raw)
  To: linux-mmc@vger.kernel.org; +Cc: Chris Ball, Kyungmin Park, andy.ross

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

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

* RE: [PATCH] mmc: duplicated trial with same freq when mmc_rescan_try_freq()
  2011-05-12  8:18 [PATCH] mmc: duplicated trial with same freq when mmc_rescan_try_freq() Jaehoon Chung
@ 2011-05-12  8:57 ` Huang Changming-R66093
  2011-05-12 11:18   ` Jaehoon Chung
  2011-05-12 14:04   ` Chris Ball
  2011-05-13 16:48 ` Chris Ball
  1 sibling, 2 replies; 7+ messages in thread
From: Huang Changming-R66093 @ 2011-05-12  8:57 UTC (permalink / raw)
  To: Jaehoon Chung, linux-mmc@vger.kernel.org
  Cc: Chris Ball, Kyungmin Park, andy.ross@windriver.com

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



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

* Re: [PATCH] mmc: duplicated trial with same freq when mmc_rescan_try_freq()
  2011-05-12  8:57 ` Huang Changming-R66093
@ 2011-05-12 11:18   ` Jaehoon Chung
  2011-05-12 14:04   ` Chris Ball
  1 sibling, 0 replies; 7+ messages in thread
From: Jaehoon Chung @ 2011-05-12 11:18 UTC (permalink / raw)
  To: Huang Changming-R66093
  Cc: Jaehoon Chung, linux-mmc@vger.kernel.org, Chris Ball,
	Kyungmin Park, andy.ross@windriver.com

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
> 


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

* Re: [PATCH] mmc: duplicated trial with same freq when mmc_rescan_try_freq()
  2011-05-12  8:57 ` Huang Changming-R66093
  2011-05-12 11:18   ` Jaehoon Chung
@ 2011-05-12 14:04   ` Chris Ball
  2011-05-13  2:16     ` Jaehoon Chung
  1 sibling, 1 reply; 7+ messages in thread
From: Chris Ball @ 2011-05-12 14:04 UTC (permalink / raw)
  To: Huang Changming-R66093
  Cc: Jaehoon Chung, linux-mmc@vger.kernel.org, Kyungmin Park,
	andy.ross@windriver.com

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.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: [PATCH] mmc: duplicated trial with same freq when mmc_rescan_try_freq()
  2011-05-12 14:04   ` Chris Ball
@ 2011-05-13  2:16     ` Jaehoon Chung
  2011-05-13 16:18       ` Andy Ross
  0 siblings, 1 reply; 7+ messages in thread
From: Jaehoon Chung @ 2011-05-13  2:16 UTC (permalink / raw)
  To: Chris Ball
  Cc: Huang Changming-R66093, Jaehoon Chung, linux-mmc@vger.kernel.org,
	Kyungmin Park, andy.ross@windriver.com

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.


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

* Re: [PATCH] mmc: duplicated trial with same freq when mmc_rescan_try_freq()
  2011-05-13  2:16     ` Jaehoon Chung
@ 2011-05-13 16:18       ` Andy Ross
  0 siblings, 0 replies; 7+ messages in thread
From: Andy Ross @ 2011-05-13 16:18 UTC (permalink / raw)
  To: Jaehoon Chung
  Cc: Chris Ball, Huang Changming-R66093, linux-mmc@vger.kernel.org,
	Kyungmin Park

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

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

* Re: [PATCH] mmc: duplicated trial with same freq when mmc_rescan_try_freq()
  2011-05-12  8:18 [PATCH] mmc: duplicated trial with same freq when mmc_rescan_try_freq() Jaehoon Chung
  2011-05-12  8:57 ` Huang Changming-R66093
@ 2011-05-13 16:48 ` Chris Ball
  1 sibling, 0 replies; 7+ messages in thread
From: Chris Ball @ 2011-05-13 16:48 UTC (permalink / raw)
  To: Jaehoon Chung; +Cc: linux-mmc@vger.kernel.org, Kyungmin Park, andy.ross

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.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

end of thread, other threads:[~2011-05-13 16:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-12  8:18 [PATCH] mmc: duplicated trial with same freq when mmc_rescan_try_freq() Jaehoon Chung
2011-05-12  8:57 ` Huang Changming-R66093
2011-05-12 11:18   ` Jaehoon Chung
2011-05-12 14:04   ` Chris Ball
2011-05-13  2:16     ` Jaehoon Chung
2011-05-13 16:18       ` Andy Ross
2011-05-13 16:48 ` Chris Ball

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox