]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.32.9/call-flush_dcache_page-after-pio-data-transfers-in-libata-sff.c.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.9 / call-flush_dcache_page-after-pio-data-transfers-in-libata-sff.c.patch
CommitLineData
c7880ca6
GKH
1From 2d68b7fe55d9e19a8a868224ed0dfd6526568521 Mon Sep 17 00:00:00 2001
2From: Catalin Marinas <catalin.marinas@arm.com>
3Date: Thu, 4 Feb 2010 01:04:50 -0500
4Subject: [libata] Call flush_dcache_page after PIO data transfers in libata-sff.c
5
6From: Catalin Marinas <catalin.marinas@arm.com>
7
8commit 2d68b7fe55d9e19a8a868224ed0dfd6526568521 upstream.
9
10flush_dcache_page() must be called after (!ATA_TFLAG_WRITE) the
11data copying to avoid D-cache aliasing with user space or I-D cache
12coherency issues (when reading data from an ATA device using PIO,
13the kernel dirties the D-cache but there is no flush_dcache_page()
14required on Harvard architectures).
15
16Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
17Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
18Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
19
20---
21 drivers/ata/libata-sff.c | 3 +++
22 1 file changed, 3 insertions(+)
23
24--- a/drivers/ata/libata-sff.c
25+++ b/drivers/ata/libata-sff.c
26@@ -893,6 +893,9 @@ static void ata_pio_sector(struct ata_qu
27 do_write);
28 }
29
30+ if (!do_write)
31+ flush_dcache_page(page);
32+
33 qc->curbytes += qc->sect_size;
34 qc->cursg_ofs += qc->sect_size;
35