diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-07 10:43:40 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-07 10:43:40 -0800 |
commit | f9c5d0451b406a6bd0d0bf1fdd63c7777af6ebc6 (patch) | |
tree | 717e9fc0044e9d94dd363670cacc2dff9d5b4407 /drivers/mmc/mmci.c | |
parent | d354d9afe923eb08f7ee89128b38ddb6415de01d (diff) | |
parent | f3e2628bed0d5a88ced8239b35f1534557f9631c (diff) | |
download | blackbird-op-linux-f9c5d0451b406a6bd0d0bf1fdd63c7777af6ebc6.tar.gz blackbird-op-linux-f9c5d0451b406a6bd0d0bf1fdd63c7777af6ebc6.zip |
Merge master.kernel.org:/home/rmk/linux-2.6-mmc
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 @@ #include <linux/mmc/host.h> #include <linux/mmc/protocol.h> +#include <asm/cacheflush.h> #include <asm/div64.h> #include <asm/io.h> #include <asm/scatterlist.h> @@ -157,6 +158,13 @@ mmci_data_irq(struct mmci_host *host, struct mmc_data *data, else if (status & (MCI_TXUNDERRUN|MCI_RXOVERRUN)) data->error = MMC_ERR_FIFO; status |= MCI_DATAEND; + + /* + * We hit an error condition. Ensure that any data + * partially written to a page is properly coherent. + */ + if (host->sg_len && data->flags & MMC_DATA_READ) + flush_dcache_page(host->sg_ptr->page); } if (status & MCI_DATAEND) { mmci_stop_data(host); @@ -292,7 +300,7 @@ static irqreturn_t mmci_pio_irq(int irq, void *dev_id, struct pt_regs *regs) /* * Unmap the buffer. */ - mmci_kunmap_atomic(host, &flags); + mmci_kunmap_atomic(host, buffer, &flags); host->sg_off += len; host->size -= len; @@ -301,6 +309,13 @@ static irqreturn_t mmci_pio_irq(int irq, void *dev_id, struct pt_regs *regs) if (remain) break; + /* + * If we were reading, and we have completed this + * page, ensure that the data cache is coherent. + */ + if (status & MCI_RXACTIVE) + flush_dcache_page(host->sg_ptr->page); + if (!mmci_next_sg(host)) break; |