Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 307938
b: refs/heads/master
c: 31463b1
h: refs/heads/master
v: v3
  • Loading branch information
Venkatraman S authored and Chris Ball committed Apr 22, 2012
1 parent c282992 commit 40a22fe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 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: 03b5d924b926dd994b16f30f7a13bfb71ee0f478
refs/heads/master: 31463b141587001781d86b2ef360544f101bd998
19 changes: 11 additions & 8 deletions trunk/drivers/mmc/host/omap_hsmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,11 +806,12 @@ omap_hsmmc_get_dma_dir(struct omap_hsmmc_host *host, struct mmc_data *data)
static void omap_hsmmc_request_done(struct omap_hsmmc_host *host, struct mmc_request *mrq)
{
int dma_ch;
unsigned long flags;

spin_lock(&host->irq_lock);
spin_lock_irqsave(&host->irq_lock, flags);
host->req_in_progress = 0;
dma_ch = host->dma_ch;
spin_unlock(&host->irq_lock);
spin_unlock_irqrestore(&host->irq_lock, flags);

omap_hsmmc_disable_irq(host);
/* Do not complete the request if DMA is still in progress */
Expand Down Expand Up @@ -887,13 +888,14 @@ omap_hsmmc_cmd_done(struct omap_hsmmc_host *host, struct mmc_command *cmd)
static void omap_hsmmc_dma_cleanup(struct omap_hsmmc_host *host, int errno)
{
int dma_ch;
unsigned long flags;

host->data->error = errno;

spin_lock(&host->irq_lock);
spin_lock_irqsave(&host->irq_lock, flags);
dma_ch = host->dma_ch;
host->dma_ch = -1;
spin_unlock(&host->irq_lock);
spin_unlock_irqrestore(&host->irq_lock, flags);

if (host->use_dma && dma_ch != -1) {
dma_unmap_sg(mmc_dev(host->mmc), host->data->sg,
Expand Down Expand Up @@ -1247,16 +1249,17 @@ static void omap_hsmmc_dma_cb(int lch, u16 ch_status, void *cb_data)
struct omap_hsmmc_host *host = cb_data;
struct mmc_data *data;
int dma_ch, req_in_progress;
unsigned long flags;

if (!(ch_status & OMAP_DMA_BLOCK_IRQ)) {
dev_warn(mmc_dev(host->mmc), "unexpected dma status %x\n",
ch_status);
return;
}

spin_lock(&host->irq_lock);
spin_lock_irqsave(&host->irq_lock, flags);
if (host->dma_ch < 0) {
spin_unlock(&host->irq_lock);
spin_unlock_irqrestore(&host->irq_lock, flags);
return;
}

Expand All @@ -1266,7 +1269,7 @@ static void omap_hsmmc_dma_cb(int lch, u16 ch_status, void *cb_data)
/* Fire up the next transfer. */
omap_hsmmc_config_dma_params(host, data,
data->sg + host->dma_sg_idx);
spin_unlock(&host->irq_lock);
spin_unlock_irqrestore(&host->irq_lock, flags);
return;
}

Expand All @@ -1277,7 +1280,7 @@ static void omap_hsmmc_dma_cb(int lch, u16 ch_status, void *cb_data)
req_in_progress = host->req_in_progress;
dma_ch = host->dma_ch;
host->dma_ch = -1;
spin_unlock(&host->irq_lock);
spin_unlock_irqrestore(&host->irq_lock, flags);

omap_free_dma(dma_ch);

Expand Down

0 comments on commit 40a22fe

Please sign in to comment.