From 93bdd8c4773bcf85b0f07ccb06e3df1af68b7e1c Mon Sep 17 00:00:00 2001 From: Wolfgang Muees Date: Tue, 7 Apr 2009 14:48:16 +0100 Subject: [PATCH] --- yaml --- r: 142807 b: refs/heads/master c: 9d9f25c036dd584db175552a7d162403d3ab54b3 h: refs/heads/master i: 142805: 3258a73941cef5339051091947ae1dfbbab91250 142803: 1843f18514a665d2e128f594ce79e2c1943fa642 142799: b9b74f0e2ba6ac500580ec1b9cd668723a246ed0 v: v3 --- [refs] | 2 +- trunk/drivers/mmc/core/sd.c | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 39e102dd1bb1..424cbb2386ac 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 00adadc12196c7b3e8923729e728162267e98ff7 +refs/heads/master: 9d9f25c036dd584db175552a7d162403d3ab54b3 diff --git a/trunk/drivers/mmc/core/sd.c b/trunk/drivers/mmc/core/sd.c index 26fc098d77cd..cd81c395e164 100644 --- a/trunk/drivers/mmc/core/sd.c +++ b/trunk/drivers/mmc/core/sd.c @@ -362,15 +362,6 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, if (err) goto err; - /* - * For SPI, enable CRC as appropriate. - */ - if (mmc_host_is_spi(host)) { - err = mmc_spi_set_crc(host, use_spi_crc); - if (err) - goto err; - } - /* * Fetch CID from card. */ @@ -457,6 +448,18 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, goto free_card; } + /* + * For SPI, enable CRC as appropriate. + * This CRC enable is located AFTER the reading of the + * card registers because some SDHC cards are not able + * to provide valid CRCs for non-512-byte blocks. + */ + if (mmc_host_is_spi(host)) { + err = mmc_spi_set_crc(host, use_spi_crc); + if (err) + goto free_card; + } + /* * Attempt to change to high-speed (if supported) */