mmc: mxcmmc: fix SD cards not being detected sometimes.
authorJavier Martin <[email protected]>
Tue, 30 Oct 2012 15:54:07 +0000 (16:54 +0100)
committerChris Ball <[email protected]>
Thu, 6 Dec 2012 18:54:38 +0000 (13:54 -0500)
When a SD card is initialized some data transfers of 64 and 8 bytes
are issued. It seems the DMA has some problems dealing with these kind
of "short" transfers, leading sometimes to the SD card not being detected.

In order to solve this problem, do not use DMA for transfer sizes lower
than the sector size.

Signed-off-by: Javier Martin <[email protected]>
Acked-by: Sascha Hauer <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
drivers/mmc/host/mxcmmc.c

index 6290b7f1ccfec2d56f31675663923e057a1570c8..29e680f193a0a44bce9abd723e5b23c9758df402 100644 (file)
@@ -240,7 +240,7 @@ static int mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
                return 0;
 
        for_each_sg(data->sg, sg, data->sg_len, i) {
-               if (sg->offset & 3 || sg->length & 3) {
+               if (sg->offset & 3 || sg->length & 3 || sg->length < 512) {
                        host->do_dma = 0;
                        return 0;
                }