From 723e88b3c82ccefab2e9380b7585a68ca1457e7d Mon Sep 17 00:00:00 2001 From: Cliff Brake Date: Thu, 22 Jan 2009 17:07:03 -0500 Subject: [PATCH] --- yaml --- r: 130729 b: refs/heads/master c: b6018958a57f6621d6979c4384e42a3df636beed h: refs/heads/master i: 130727: f00d3c4605a36eee8ed3d30f4596e8a630becc5a v: v3 --- [refs] | 2 +- trunk/drivers/mmc/host/pxamci.c | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index a21418e59a11..101c1a4b0c1d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e10a854c4602072c34c03380b99da0a3ee15682c +refs/heads/master: b6018958a57f6621d6979c4384e42a3df636beed diff --git a/trunk/drivers/mmc/host/pxamci.c b/trunk/drivers/mmc/host/pxamci.c index 3000422f4d81..9702ad3774cf 100644 --- a/trunk/drivers/mmc/host/pxamci.c +++ b/trunk/drivers/mmc/host/pxamci.c @@ -180,7 +180,15 @@ static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data) else DALGN &= ~(1 << host->dma); DDADR(host->dma) = host->sg_dma; - DCSR(host->dma) = DCSR_RUN; + + /* + * workaround for erratum #91: + * only start DMA now if we are doing a read, + * otherwise we wait until CMD/RESP has finished + * before starting DMA. + */ + if (!cpu_is_pxa27x() || data->flags & MMC_DATA_READ) + DCSR(host->dma) = DCSR_RUN; } static void pxamci_start_cmd(struct pxamci_host *host, struct mmc_command *cmd, unsigned int cmdat) @@ -267,6 +275,12 @@ static int pxamci_cmd_done(struct pxamci_host *host, unsigned int stat) pxamci_disable_irq(host, END_CMD_RES); if (host->data && !cmd->error) { pxamci_enable_irq(host, DATA_TRAN_DONE); + /* + * workaround for erratum #91, if doing write + * enable DMA late + */ + if (cpu_is_pxa27x() && host->data->flags & MMC_DATA_WRITE) + DCSR(host->dma) = DCSR_RUN; } else { pxamci_finish_request(host, host->mrq); }