Re: [PATCH] mmc: Test bus-width for old MMC devices (v2)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Philip Rakity
Date: Tuesday, December 21, 2010 - 9:36 am

Can you please try this diff and see if it works for you.

Will do formal patch after your testing.  What card is failing ?   

Please let me know the manufacturing information so can add card to my test suite.

Philip

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 1d8409f..77072c8 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -558,6 +558,8 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 					 EXT_CSD_BUS_WIDTH,
 					 ext_csd_bits[idx][0]);
 			if (!err) {
+				mmc_set_bus_width_ddr(card->host,
+						      bus_width, MMC_SDR_MODE);
 				/*
 				 * If controller can't handle bus width test,
 				 * use the highest bus width to maintain
@@ -565,8 +567,6 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 				 */
 				if (!(host->caps & MMC_CAP_BUS_WIDTH_TEST))
 					break;
-				mmc_set_bus_width_ddr(card->host,
-						      bus_width, MMC_SDR_MODE);
 				err = mmc_bus_test(card, bus_width);
 				if (!err)
 					break;
@@ -586,7 +586,8 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 		} else if (ddr) {
 			mmc_card_set_ddr_mode(card);
 			mmc_set_bus_width_ddr(card->host, bus_width, ddr);
-		}
+		} else 
+			mmc_set_bus_width (card->host, bus_width);
 	}
 
 	if (!oldcard)


Philip

On Dec 21, 2010, at 2:59 AM, zhangfei gao wrote:


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] mmc: Test bus-width for old MMC devices (v2), Takashi Iwai, (Wed Dec 15, 12:14 am)
[PATCH] mmc: Enable bus-width tests on SDHCI host, Takashi Iwai, (Wed Dec 15, 6:17 am)
Re: [PATCH] mmc: Enable bus-width tests on SDHCI host, Takashi Iwai, (Wed Dec 15, 12:40 pm)
Re: [PATCH] mmc: Test bus-width for old MMC devices (v2), Philip Rakity, (Thu Dec 16, 7:33 pm)
Re: [PATCH] mmc: Test bus-width for old MMC devices (v2), Philip Rakity, (Tue Dec 21, 9:36 am)
Re: [PATCH] mmc: Test bus-width for old MMC devices (v2), Philip Rakity, (Tue Dec 21, 12:35 pm)