Commit ff4ce813 authored by Jarkko Lavinen's avatar Jarkko Lavinen Committed by Tony Lindgren

[PATCH] ARM: OMAP: Writing large files onto sync mounted MMC corrupts the FS

Fixed incorrect DMA flags as noted by David Brownell.
Signed-off-by: default avatarJarkko Lavinen <jarkko.lavinen@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent b364b982
...@@ -643,6 +643,7 @@ static inline void set_data_timeout(struct mmc_omap_host *host, struct mmc_reque ...@@ -643,6 +643,7 @@ static inline void set_data_timeout(struct mmc_omap_host *host, struct mmc_reque
static void mmc_omap_prepare_data(struct mmc_omap_host *host, struct mmc_request *req) static void mmc_omap_prepare_data(struct mmc_omap_host *host, struct mmc_request *req)
{ {
struct mmc_data *data = req->data; struct mmc_data *data = req->data;
enum dma_data_direction dma_data_dir;
host->data = data; host->data = data;
if (data == NULL) { if (data == NULL) {
...@@ -664,12 +665,16 @@ static void mmc_omap_prepare_data(struct mmc_omap_host *host, struct mmc_request ...@@ -664,12 +665,16 @@ static void mmc_omap_prepare_data(struct mmc_omap_host *host, struct mmc_request
OMAP_MMC_WRITE(host->base, BLEN, (1 << data->blksz_bits) - 1); OMAP_MMC_WRITE(host->base, BLEN, (1 << data->blksz_bits) - 1);
set_data_timeout(host, req); set_data_timeout(host, req);
host->datadir = (data->flags & MMC_DATA_WRITE) ? if (data->flags & MMC_DATA_WRITE) {
OMAP_MMC_DATADIR_WRITE : OMAP_MMC_DATADIR_READ; host->datadir = OMAP_MMC_DATADIR_WRITE;
host->dma_len = 0; dma_data_dir = DMA_TO_DEVICE;
} else {
host->dma_len = dma_map_sg(mmc_dev(host->mmc), data->sg, data->sg_len, host->datadir = OMAP_MMC_DATADIR_READ;
host->datadir); dma_data_dir = DMA_FROM_DEVICE;
}
host->dma_len = dma_map_sg(mmc_dev(host->mmc), data->sg, data->sg_len,
dma_data_dir);
/* No SG-DMA */ /* No SG-DMA */
if (unlikely(host->dma_len > 1)) if (unlikely(host->dma_len > 1))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment