Skip to contentSkip to conversation

mmc: fixed wrong SD card detection

PATCH In review Jaehoon Chung 3 participants 6 messages May 6, 2011 – May 12, 2011 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: fixed wrong SD card detection

This patch added mmc_power_off after mmc_attach_sd()

i found that didn't detect the second card insert.(using SDHCI) you can see the below log.

i want to know that somebody know this issue...

->first card inserted (correct card detect)
# mmc1: new SDHC card at address e624
mmcblk1: mmc1:e624 SU04G 3.69 GiB
mmcblk1: p1
#
# mmc1: card e624 removed
-> second card inserted
mmc1: error -110 whilst initialising SD card
mmc1: Card removed during transfer!
mmc1: Resetting controller.
-> third card inserted
mmc1: new SDHC card at address e624
mmcblk1: mmc1:e624 SU04G 3.69 GiB
mmcblk1: p1

I added mmc_power_off() after only mmc_attach_sd().

---
 drivers/mmc/core/core.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/mmc/core/core.c +3 -1
index 1dbc185..d5d8ac0 100644
@@ -1522,8 +1522,10 @@ static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq)
 	/* Order's important: probe SDIO, then SD, then MMC */
 	if (!mmc_attach_sdio(host))
 		return 0;
-	if (!mmc_attach_sd(host))
+	if (!mmc_attach_sd(host)) {
+		mmc_power_off(host);
 		return 0;
+	}
 	if (!mmc_attach_mmc(host))
 		return 0;
 
#1 lore raw

Hi Jaehoon,

Quoted 36 lines · Jaehoon Chung

This patch added mmc_power_off after mmc_attach_sd()

i found that didn't detect the second card insert.(using SDHCI) you can see the below log.

i want to know that somebody know this issue...

->first card inserted (correct card detect)
# mmc1: new SDHC card at address e624
mmcblk1: mmc1:e624 SU04G 3.69 GiB
mmcblk1: p1
#
# mmc1: card e624 removed
-> second card inserted
mmc1: error -110 whilst initialising SD card
mmc1: Card removed during transfer!
mmc1: Resetting controller.
-> third card inserted
mmc1: new SDHC card at address e624
mmcblk1: mmc1:e624 SU04G 3.69 GiB
mmcblk1: p1

I added mmc_power_off() after only mmc_attach_sd().

---
 drivers/mmc/core/core.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/mmc/core/core.c +0 -0
index 1dbc185..d5d8ac0 100644
@@ -1522,8 +1522,10 @@ static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq)
 	/* Order's important: probe SDIO, then SD, then MMC */

drivers/mmc/core/core.c static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq) · line 1531

Quoted 10 lines
drivers/mmc/core/core.c +3 -1
 	if (!mmc_attach_sdio(host))
 		return 0;
-	if (!mmc_attach_sd(host))
+	if (!mmc_attach_sd(host)) {
+		mmc_power_off(host);
 		return 0;
+	}
 	if (!mmc_attach_mmc(host))
 		return 0;
 

It looks to me like this patch says "if we successfully attach/power up an SD card, then power it back off again immediately". Why would that make sense?

- Chris.

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

Hi Chris..

Quoted 45 lines · Chris Ball

Hi Jaehoon,

Quoted 42 lines · Jaehoon Chung

This patch added mmc_power_off after mmc_attach_sd()

i found that didn't detect the second card insert.(using SDHCI) you can see the below log.

i want to know that somebody know this issue...

->first card inserted (correct card detect)
# mmc1: new SDHC card at address e624
mmcblk1: mmc1:e624 SU04G 3.69 GiB
mmcblk1: p1
#
# mmc1: card e624 removed
-> second card inserted
mmc1: error -110 whilst initialising SD card
mmc1: Card removed during transfer!
mmc1: Resetting controller.
-> third card inserted
mmc1: new SDHC card at address e624
mmcblk1: mmc1:e624 SU04G 3.69 GiB
mmcblk1: p1

I added mmc_power_off() after only mmc_attach_sd().

---
 drivers/mmc/core/core.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/mmc/core/core.c +2 -1
index 1dbc185..d5d8ac0 100644
@@ -1522,8 +1522,10 @@ static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq)
 	/* Order's important: probe SDIO, then SD, then MMC */
 	if (!mmc_attach_sdio(host))
 		return 0;
-	if (!mmc_attach_sd(host))
+	if (!mmc_attach_sd(host)) {
+		mmc_power_off(host);
 		return 0;
Quoted 8 lines

drivers/mmc/core/core.c static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq) · line 1531

Quoted 4 lines
drivers/mmc/core/core.c +1 -0
+	}
 	if (!mmc_attach_mmc(host))
 		return 0;
 

It looks to me like this patch says "if we successfully attach/power up an SD card, then power it back off again immediately". Why would that make sense?

It's non-sense...i know...How did you think about that problem..? I want to get your advise...

Quoted 2 lines

- Chris.

#3 lore raw
In reply to Jaehoon Chung

I don't see this.
Maybe that is your hardware issue.

Thanks and Best Regards
Jerry Huang

Quoted 59 lines

-----Original Message-----
From: [email protected] [mailto:linux-mmc- [email protected]] On Behalf Of Jaehoon Chung
Sent: Friday, May 06, 2011 5:39 PM
To: [email protected]
Cc: Chris Ball; Kyungmin Park
Subject: [PATCH] mmc: fixed wrong SD card detection

This patch added mmc_power_off after mmc_attach_sd()

i found that didn't detect the second card insert.(using SDHCI) you can see the below log.

i want to know that somebody know this issue...

->first card inserted (correct card detect)
# mmc1: new SDHC card at address e624
mmcblk1: mmc1:e624 SU04G 3.69 GiB
mmcblk1: p1
#
# mmc1: card e624 removed
-> second card inserted
mmc1: error -110 whilst initialising SD card
mmc1: Card removed during transfer!
mmc1: Resetting controller.
-> third card inserted
mmc1: new SDHC card at address e624
mmcblk1: mmc1:e624 SU04G 3.69 GiB
mmcblk1: p1

I added mmc_power_off() after only mmc_attach_sd().

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

1dbc185..d5d8ac0 100644

drivers/mmc/core/core.c +3 -2
@@ -1522,8 +1522,10 @@ static int mmc_rescan_try_freq(struct mmc_host
 *host, unsigned freq)
 	/* Order's important: probe SDIO, then SD, then MMC */
 	if (!mmc_attach_sdio(host))
 		return 0;
-	if (!mmc_attach_sd(host))
+	if (!mmc_attach_sd(host)) {
+		mmc_power_off(host);
 		return 0;
+	}
 	if (!mmc_attach_mmc(host))
 		return 0;
 
--

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

#4 lore raw

Hi Huang.

Thanks for your comments. but this is not my hardware issue. :) But i found out your patch "[PATCH 3/3] SDHC/MMC: add f_min to mmc_power_on"

I think that related with this problem.
I will test then share the results

Best regards,
Jaehoon Chung

Quoted 73 lines · Huang Changming-R66093 wrote:

I don't see this.
Maybe that is your hardware issue.

Thanks and Best Regards
Jerry Huang

Quoted 56 lines

-----Original Message-----
From: [email protected] [mailto:linux-mmc- [email protected]] On Behalf Of Jaehoon Chung
Sent: Friday, May 06, 2011 5:39 PM
To: [email protected]
Cc: Chris Ball; Kyungmin Park
Subject: [PATCH] mmc: fixed wrong SD card detection

This patch added mmc_power_off after mmc_attach_sd()

i found that didn't detect the second card insert.(using SDHCI) you can see the below log.

i want to know that somebody know this issue...

->first card inserted (correct card detect)
# mmc1: new SDHC card at address e624
mmcblk1: mmc1:e624 SU04G 3.69 GiB
mmcblk1: p1
#
# mmc1: card e624 removed
-> second card inserted
mmc1: error -110 whilst initialising SD card
mmc1: Card removed during transfer!
mmc1: Resetting controller.
-> third card inserted
mmc1: new SDHC card at address e624
mmcblk1: mmc1:e624 SU04G 3.69 GiB
mmcblk1: p1

I added mmc_power_off() after only mmc_attach_sd().

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

1dbc185..d5d8ac0 100644

drivers/mmc/core/core.c +3 -2
@@ -1522,8 +1522,10 @@ static int mmc_rescan_try_freq(struct mmc_host
 *host, unsigned freq)
 	/* Order's important: probe SDIO, then SD, then MMC */
 	if (!mmc_attach_sdio(host))
 		return 0;
-	if (!mmc_attach_sd(host))
+	if (!mmc_attach_sd(host)) {
+		mmc_power_off(host);
 		return 0;
+	}
 	if (!mmc_attach_mmc(host))
 		return 0;
 
--
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

#5 lore raw

I didn't see my patch :(
I use the f_min to replace the f_init when f_init is zero and that is used for get_cd callback function.

Thanks and Best Regards
Jerry Huang

Quoted 93 lines

-----Original Message-----
From: Jaehoon Chung [mailto:[email protected]]
Sent: Thursday, May 12, 2011 1:14 PM
To: Huang Changming-R66093
Cc: Jaehoon Chung; [email protected]; Chris Ball; Kyungmin Park
Subject: Re: [PATCH] mmc: fixed wrong SD card detection

Hi Huang.

Thanks for your comments. but this is not my hardware issue. :) But i found out your patch "[PATCH 3/3] SDHC/MMC: add f_min to mmc_power_on"

I think that related with this problem.
I will test then share the results

Best regards,
Jaehoon Chung

Quoted 73 lines · Huang Changming-R66093 wrote:

I don't see this.
Maybe that is your hardware issue.

Thanks and Best Regards
Jerry Huang

Quoted 56 lines

-----Original Message-----
From: [email protected] [mailto:linux-mmc- [email protected]] On Behalf Of Jaehoon Chung
Sent: Friday, May 06, 2011 5:39 PM
To: [email protected]
Cc: Chris Ball; Kyungmin Park
Subject: [PATCH] mmc: fixed wrong SD card detection

This patch added mmc_power_off after mmc_attach_sd()

i found that didn't detect the second card insert.(using SDHCI) you can see the below log.

i want to know that somebody know this issue...

->first card inserted (correct card detect)
# mmc1: new SDHC card at address e624
mmcblk1: mmc1:e624 SU04G 3.69 GiB
mmcblk1: p1
#
# mmc1: card e624 removed
-> second card inserted
mmc1: error -110 whilst initialising SD card
mmc1: Card removed during transfer!
mmc1: Resetting controller.
-> third card inserted
mmc1: new SDHC card at address e624
mmcblk1: mmc1:e624 SU04G 3.69 GiB
mmcblk1: p1

I added mmc_power_off() after only mmc_attach_sd().

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

1dbc185..d5d8ac0 100644

drivers/mmc/core/core.c +3 -2
@@ -1522,8 +1522,10 @@ static int mmc_rescan_try_freq(struct mmc_host
 *host, unsigned freq)
 	/* Order's important: probe SDIO, then SD, then MMC */
 	if (!mmc_attach_sdio(host))
 		return 0;
-	if (!mmc_attach_sd(host))
+	if (!mmc_attach_sd(host)) {
+		mmc_power_off(host);
 		return 0;
+	}
 	if (!mmc_attach_mmc(host))
 		return 0;
 
--
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