diff options
Diffstat (limited to 'drivers/mmc/mmci.c')
| -rw-r--r-- | drivers/mmc/mmci.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/mmc/mmci.c b/drivers/mmc/mmci.c index 166c9b0ad04e..2b10a2d4ae09 100644 --- a/drivers/mmc/mmci.c +++ b/drivers/mmc/mmci.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/mmc/host.h> | 20 | #include <linux/mmc/host.h> |
| 21 | #include <linux/mmc/protocol.h> | 21 | #include <linux/mmc/protocol.h> |
| 22 | 22 | ||
| 23 | #include <asm/cacheflush.h> | ||
| 23 | #include <asm/div64.h> | 24 | #include <asm/div64.h> |
| 24 | #include <asm/io.h> | 25 | #include <asm/io.h> |
| 25 | #include <asm/scatterlist.h> | 26 | #include <asm/scatterlist.h> |
| @@ -157,6 +158,13 @@ mmci_data_irq(struct mmci_host *host, struct mmc_data *data, | |||
| 157 | else if (status & (MCI_TXUNDERRUN|MCI_RXOVERRUN)) | 158 | else if (status & (MCI_TXUNDERRUN|MCI_RXOVERRUN)) |
| 158 | data->error = MMC_ERR_FIFO; | 159 | data->error = MMC_ERR_FIFO; |
| 159 | status |= MCI_DATAEND; | 160 | status |= MCI_DATAEND; |
| 161 | |||
| 162 | /* | ||
| 163 | * We hit an error condition. Ensure that any data | ||
| 164 | * partially written to a page is properly coherent. | ||
| 165 | */ | ||
| 166 | if (host->sg_len && data->flags & MMC_DATA_READ) | ||
| 167 | flush_dcache_page(host->sg_ptr->page); | ||
| 160 | } | 168 | } |
| 161 | if (status & MCI_DATAEND) { | 169 | if (status & MCI_DATAEND) { |
| 162 | mmci_stop_data(host); | 170 | mmci_stop_data(host); |
| @@ -292,7 +300,7 @@ static irqreturn_t mmci_pio_irq(int irq, void *dev_id, struct pt_regs *regs) | |||
| 292 | /* | 300 | /* |
| 293 | * Unmap the buffer. | 301 | * Unmap the buffer. |
| 294 | */ | 302 | */ |
| 295 | mmci_kunmap_atomic(host, &flags); | 303 | mmci_kunmap_atomic(host, buffer, &flags); |
| 296 | 304 | ||
| 297 | host->sg_off += len; | 305 | host->sg_off += len; |
| 298 | host->size -= len; | 306 | host->size -= len; |
| @@ -301,6 +309,13 @@ static irqreturn_t mmci_pio_irq(int irq, void *dev_id, struct pt_regs *regs) | |||
| 301 | if (remain) | 309 | if (remain) |
| 302 | break; | 310 | break; |
| 303 | 311 | ||
| 312 | /* | ||
| 313 | * If we were reading, and we have completed this | ||
| 314 | * page, ensure that the data cache is coherent. | ||
| 315 | */ | ||
| 316 | if (status & MCI_RXACTIVE) | ||
| 317 | flush_dcache_page(host->sg_ptr->page); | ||
| 318 | |||
| 304 | if (!mmci_next_sg(host)) | 319 | if (!mmci_next_sg(host)) |
| 305 | break; | 320 | break; |
| 306 | 321 | ||
