summaryrefslogtreecommitdiff
path: root/packages/linux/linux-2.6.18/atmel-mci-init-nr_blocks-in-dma-request.patch
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2007-11-29 13:46:08 +0000
committerKoen Kooi <koen@openembedded.org>2007-11-29 13:46:08 +0000
commitfb66e592cba4e91fdb85570cfb51e4110ea75b28 (patch)
tree018f99af09b92a1ec7734192984798db855ccac7 /packages/linux/linux-2.6.18/atmel-mci-init-nr_blocks-in-dma-request.patch
parent82ef14e73032b4364c7ef2b372f9868f5ceed793 (diff)
parent8c1a5e33bf439c0274b795cc580a30c5de951df7 (diff)
propagate from branch 'org.openembedded.dev' (head 0238eff8862126ac83c3f05d7a6fb094feff89e9)
to branch 'org.openembedded.dev.avr32' (head afeaa97ba6962d277699aab10b0b6a8089342824)
Diffstat (limited to 'packages/linux/linux-2.6.18/atmel-mci-init-nr_blocks-in-dma-request.patch')
-rw-r--r--packages/linux/linux-2.6.18/atmel-mci-init-nr_blocks-in-dma-request.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/packages/linux/linux-2.6.18/atmel-mci-init-nr_blocks-in-dma-request.patch b/packages/linux/linux-2.6.18/atmel-mci-init-nr_blocks-in-dma-request.patch
new file mode 100644
index 0000000000..d6d91ae0e8
--- /dev/null
+++ b/packages/linux/linux-2.6.18/atmel-mci-init-nr_blocks-in-dma-request.patch
@@ -0,0 +1,47 @@
+From nobody Mon Sep 17 00:00:00 2001
+From: Haavard Skinnemoen <hskinnemoen@atmel.com>
+Date: Sun, 14 Jan 2007 19:07:06 +0100
+Subject: [ATMEL MCI] Initialize the nr_blocks member of the dma request
+
+It seems like the mmc driver might get asked to write less data
+than what is available in the associated scatterlist. Previously,
+the dmac driver assumed that an sg request should transfer all
+the data in the scatterlist, which would break in this case.
+
+Resolve this by passing the number of blocks to transfer explicitly.
+This will probably fix a number of cases where the mmc controller
+seemed to be out of sync with the dma controller.
+
+Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
+---
+ drivers/mmc/atmel-mci.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+Index: linux-2.6.18-avr32/drivers/mmc/atmel-mci.c
+===================================================================
+--- linux-2.6.18-avr32.orig/drivers/mmc/atmel-mci.c 2007-01-15 15:39:13.000000000 +0100
++++ linux-2.6.18-avr32/drivers/mmc/atmel-mci.c 2007-01-15 15:39:25.000000000 +0100
+@@ -51,7 +51,6 @@ struct atmel_mci_dma {
+ struct dma_request_sg req;
+ unsigned short rx_periph_id;
+ unsigned short tx_periph_id;
+- int blocks_left;
+ };
+
+ struct atmel_mci {
+@@ -428,6 +427,7 @@ static u32 atmci_prepare_data(struct mmc
+ mci_writel(host, BLKR, (MCI_BF(BCNT, data->blocks)
+ | MCI_BF(BLKLEN, data->blksz)));
+ host->dma.req.block_size = data->blksz;
++ host->dma.req.nr_blocks = data->blocks;
+
+ cmd_flags = MCI_BF(TRCMD, MCI_TRCMD_START_TRANS);
+ if (data->flags & MMC_DATA_STREAM)
+@@ -454,7 +454,6 @@ static u32 atmci_prepare_data(struct mmc
+ host->dma.req.data_reg = host->mapbase + MCI_TDR;
+ }
+ host->dma.req.sg = data->sg;
+- host->dma.blocks_left = data->blocks;
+
+ dma_prepare_request_sg(host->dma.req.req.dmac, &host->dma.req);
+