Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 270233
b: refs/heads/master
c: 341fa4c
h: refs/heads/master
i:
  270231: 3c79cb5
v: v3
  • Loading branch information
Ludovic Desroches authored and Chris Ball committed Oct 26, 2011
1 parent e568c22 commit 0b82b2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 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: 1ebbe3d31fd96865b4d4874f3c74fef0e386fb79
refs/heads/master: 341fa4c3affe1171005597847a86e4c26dea8bb1
7 changes: 3 additions & 4 deletions trunk/drivers/mmc/host/atmel-mci.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ static void atmci_pdc_set_single_buf(struct atmel_mci *host,
}

atmci_writel(host, pointer_reg, sg_dma_address(host->sg));
if (host->data_size <= PAGE_SIZE) {
if (host->data_size <= sg_dma_len(host->sg)) {
if (host->data_size & 0x3) {
/* If size is different from modulo 4, transfer bytes */
atmci_writel(host, counter_reg, host->data_size);
Expand All @@ -620,8 +620,8 @@ static void atmci_pdc_set_single_buf(struct atmel_mci *host,
host->data_size = 0;
} else {
/* We assume the size of a page is 32-bits aligned */
atmci_writel(host, counter_reg, PAGE_SIZE / 4);
host->data_size -= PAGE_SIZE;
atmci_writel(host, counter_reg, sg_dma_len(host->sg) / 4);
host->data_size -= sg_dma_len(host->sg);
if (host->data_size)
host->sg = sg_next(host->sg);
}
Expand Down Expand Up @@ -808,7 +808,6 @@ atmci_prepare_data_pdc(struct atmel_mci *host, struct mmc_data *data)
/* Configure PDC */
host->data_size = data->blocks * data->blksz;
sg_len = dma_map_sg(&host->pdev->dev, data->sg, data->sg_len, dir);
BUG_ON(sg_len < host->data_size / PAGE_SIZE);
if (host->data_size)
atmci_pdc_set_both_buf(host,
((dir == DMA_FROM_DEVICE) ? XFER_RECEIVE : XFER_TRANSMIT));
Expand Down

0 comments on commit 0b82b2c

Please sign in to comment.