Skip to contentSkip to conversation

mmc: duplicated trial with same freq when mmc_rescan_try_freq()

PATCH In review Jaehoon Chung 4 participants 7 messages May 12, 2011 – May 13, 2011 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/mmc/core/core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mmc/core/core.c +1 -1
index 61c6c0b..a330c58 100644
@@ -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);
#1 lore raw

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

Quoted 47 lines

-----Original Message-----
From: [email protected] [mailto:linux-mmc- [email protected]] On Behalf Of Jaehoon Chung
Sent: Thursday, May 12, 2011 4:19 PM
To: [email protected]
Cc: Chris Ball; Kyungmin Park; [email protected]
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.

---
 drivers/mmc/core/core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mmc/core/core.c index renamed from drivers/mmc/core/core.c +0 -0

61c6c0b..a330c58 100644

drivers/mmc/core/core.c +1 -2
@@ -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 [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html

#2 lore raw

This patch didn't point that..

Quoted 1 line · 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

Quoted 59 lines

Thanks and Best Regards
Jerry Huang

Quoted 44 lines

-----Original Message-----
From: [email protected] [mailto:linux-mmc- [email protected]] On Behalf Of Jaehoon Chung
Sent: Thursday, May 12, 2011 4:19 PM
To: [email protected]
Cc: Chris Ball; Kyungmin Park; [email protected]
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.

---
 drivers/mmc/core/core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mmc/core/core.c index renamed from drivers/mmc/core/core.c +0 -0

61c6c0b..a330c58 100644

drivers/mmc/core/core.c +1 -2
@@ -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);
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected] 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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to Huang Changming-R66093

Hi,

Quoted 3 lines · 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.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
#4 lore raw

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

Quoted 10 lines · Chris Ball

Hi,

Quoted 3 lines · 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.

#5 lore raw
Quoted 3 lines · Jaehoon Chung

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

#6 lore raw
In reply to Jaehoon Chung

Hi Jaehoon,

Quoted 23 lines · Jaehoon Chung

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.

---
 drivers/mmc/core/core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mmc/core/core.c +0 -0
index 61c6c0b..a330c58 100644

drivers/mmc/core/core.c void mmc_rescan(struct work_struct *work) · line 1624

Quoted 8 lines
drivers/mmc/core/core.c +1 -1
@@ -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.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child