Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 65656
b: refs/heads/master
c: c783837
h: refs/heads/master
v: v3
  • Loading branch information
Nicolas Pitre authored and Pierre Ossman committed Oct 10, 2007
1 parent c47e727 commit a8bdb28
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 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: 599473cf15a3fae78cbc3192cfb38ca04d5abc72
refs/heads/master: c783837bc69dd0f329a441c1704f5a02d01d1bd5
19 changes: 16 additions & 3 deletions trunk/drivers/mmc/host/pxamci.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,17 @@ static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data)
host->dma_dir);

for (i = 0; i < host->dma_len; i++) {
unsigned int length = sg_dma_len(&data->sg[i]);
host->sg_cpu[i].dcmd = dcmd | length;
if (length & 31 && !(data->flags & MMC_DATA_READ))
host->sg_cpu[i].dcmd |= DCMD_ENDIRQEN;
if (data->flags & MMC_DATA_READ) {
host->sg_cpu[i].dsadr = host->res->start + MMC_RXFIFO;
host->sg_cpu[i].dtadr = sg_dma_address(&data->sg[i]);
} else {
host->sg_cpu[i].dsadr = sg_dma_address(&data->sg[i]);
host->sg_cpu[i].dtadr = host->res->start + MMC_TXFIFO;
}
host->sg_cpu[i].dcmd = dcmd | sg_dma_len(&data->sg[i]);
host->sg_cpu[i].ddadr = host->sg_dma + (i + 1) *
sizeof(struct pxa_dma_desc);
}
Expand Down Expand Up @@ -414,8 +417,18 @@ static const struct mmc_host_ops pxamci_ops = {

static void pxamci_dma_irq(int dma, void *devid)
{
printk(KERN_ERR "DMA%d: IRQ???\n", dma);
DCSR(dma) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR;
struct pxamci_host *host = devid;
int dcsr = DCSR(dma);
DCSR(dma) = dcsr & ~DCSR_STOPIRQEN;

if (dcsr & DCSR_ENDINTR) {
writel(BUF_PART_FULL, host->base + MMC_PRTBUF);
} else {
printk(KERN_ERR "%s: DMA error on channel %d (DCSR=%#x)\n",
mmc_hostname(host->mmc), dma, dcsr);
host->data->error = -EIO;
pxamci_data_done(host, 0);
}
}

static irqreturn_t pxamci_detect_irq(int irq, void *devid)
Expand Down

0 comments on commit a8bdb28

Please sign in to comment.