From b92b1568bbe8288104ec29bf9f668c1781394131 Mon Sep 17 00:00:00 2001 From: James Hogan Date: Wed, 29 Jun 2011 09:28:43 +0100 Subject: [PATCH] --- yaml --- r: 255203 b: refs/heads/master c: 03e8cb534e7cc3f71a07528a44da7ce68e5b5708 h: refs/heads/master i: 255201: a4855189f171117cbdede5d001984543adea4514 255199: 120f3ede30ab4ca703b2ff88dd566983eef0c825 v: v3 --- [refs] | 2 +- trunk/drivers/mmc/host/dw_mmc.c | 6 +++++- trunk/include/linux/mmc/dw_mmc.h | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 78d9a8d5b083..fbe52b6647e0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 65d13516b2358c38ac56a5f83e989a6837dcf825 +refs/heads/master: 03e8cb534e7cc3f71a07528a44da7ce68e5b5708 diff --git a/trunk/drivers/mmc/host/dw_mmc.c b/trunk/drivers/mmc/host/dw_mmc.c index 10b697986283..fcff3c042f69 100644 --- a/trunk/drivers/mmc/host/dw_mmc.c +++ b/trunk/drivers/mmc/host/dw_mmc.c @@ -287,7 +287,7 @@ static void send_stop_cmd(struct dw_mci *host, struct mmc_data *data) /* DMA interface functions */ static void dw_mci_stop_dma(struct dw_mci *host) { - if (host->use_dma) { + if (host->using_dma) { host->dma_ops->stop(host); host->dma_ops->cleanup(host); } else { @@ -435,6 +435,8 @@ static int dw_mci_submit_data_dma(struct dw_mci *host, struct mmc_data *data) unsigned int i, direction, sg_len; u32 temp; + host->using_dma = 0; + /* If we don't have a channel, we can't do DMA */ if (!host->use_dma) return -ENODEV; @@ -454,6 +456,8 @@ static int dw_mci_submit_data_dma(struct dw_mci *host, struct mmc_data *data) return -EINVAL; } + host->using_dma = 1; + if (data->flags & MMC_DATA_READ) direction = DMA_FROM_DEVICE; else diff --git a/trunk/include/linux/mmc/dw_mmc.h b/trunk/include/linux/mmc/dw_mmc.h index f3f68ee08a1e..6b46819705d1 100644 --- a/trunk/include/linux/mmc/dw_mmc.h +++ b/trunk/include/linux/mmc/dw_mmc.h @@ -48,6 +48,7 @@ struct mmc_data; * @data: The data currently being transferred, or NULL if no data * transfer is in progress. * @use_dma: Whether DMA channel is initialized or not. + * @using_dma: Whether DMA is in use for the current transfer. * @sg_dma: Bus address of DMA buffer. * @sg_cpu: Virtual address of DMA buffer. * @dma_ops: Pointer to platform-specific DMA callbacks. @@ -121,6 +122,7 @@ struct dw_mci { /* DMA interface members*/ int use_dma; + int using_dma; dma_addr_t sg_dma; void *sg_cpu;