[PATCH] mmc: fix regression testing bus width when CAP not defined

Philip Rakity prakity at marvell.com
Tue Dec 21 14:29:33 EST 2010


First reported by Zhangfei Gao.

set mmc bus width before checking for CAP for mmc bus width testing.
set bus width when card is not ddr

Signed-off-by: Philip Rakity <prakity at marvell.com>
Tested-by: Philip Rakity
---
 drivers/mmc/core/mmc.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 1d8409f..3a2905f 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 =3D 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);
 	}
=20
 	if (!oldcard)
--=20
1.6.0.4

--_002_809DAEAF39234E7E968F62579BA961A5marvellcom_
Content-Type: application/octet-stream;
	name="0022-mmc-fix-regression-testing-bus-width-when-CAP-not-d.patch"
Content-Description: 0022-mmc-fix-regression-testing-bus-width-when-CAP-not-d.patch
Content-Disposition: attachment;
	filename="0022-mmc-fix-regression-testing-bus-width-when-CAP-not-d.patch";
	size=1596; creation-date="Tue, 21 Dec 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