Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255203
b: refs/heads/master
c: 03e8cb5
h: refs/heads/master
i:
  255201: a485518
  255199: 120f3ed
v: v3
  • Loading branch information
James Hogan authored and Chris Ball committed Jul 20, 2011
1 parent 8c0b84c commit b92b156
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 65d13516b2358c38ac56a5f83e989a6837dcf825
refs/heads/master: 03e8cb534e7cc3f71a07528a44da7ce68e5b5708
6 changes: 5 additions & 1 deletion trunk/drivers/mmc/host/dw_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/mmc/dw_mmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -121,6 +122,7 @@ struct dw_mci {

/* DMA interface members*/
int use_dma;
int using_dma;

dma_addr_t sg_dma;
void *sg_cpu;
Expand Down

0 comments on commit b92b156

Please sign in to comment.