[68/93] [libata] Call flush_dcache_page after PIO data transfers in libata-sff.c
[Posted February 21, 2010 by corbet]
| From: |
| Greg KH <gregkh-AT-suse.de> |
| To: |
| linux-kernel-AT-vger.kernel.org, stable-AT-kernel.org |
| Subject: |
| [68/93] [libata] Call flush_dcache_page after PIO data transfers in libata-sff.c |
| Date: |
| Fri, 19 Feb 2010 08:30:01 -0800 |
| Cc: |
| stable-review-AT-kernel.org, torvalds-AT-linux-foundation.org,
akpm-AT-linux-foundation.org, alan-AT-lxorguk.ukuu.org.uk,
Catalin Marinas <catalin.marinas-AT-arm.com>,
Jeff Garzik <jgarzik-AT-redhat.com> |
| Archive-link: |
| Article, Thread
|
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Catalin Marinas <catalin.marinas@arm.com>
commit 2d68b7fe55d9e19a8a868224ed0dfd6526568521 upstream.
flush_dcache_page() must be called after (!ATA_TFLAG_WRITE) the
data copying to avoid D-cache aliasing with user space or I-D cache
coherency issues (when reading data from an ATA device using PIO,
the kernel dirties the D-cache but there is no flush_dcache_page()
required on Harvard architectures).
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/ata/libata-sff.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -893,6 +893,9 @@ static void ata_pio_sector(struct ata_qu
do_write);
}
+ if (!do_write)
+ flush_dcache_page(page);
+
qc->curbytes += qc->sect_size;
qc->cursg_ofs += qc->sect_size;
(
Log in to post comments)