linux-mips
[Top] [All Lists]

[PATCH] MIPS: Fix get_user_page_fast() for mips with cache alias

To: ralf@linux-mips.org, linux-mips@linux-mips.org
Subject: [PATCH] MIPS: Fix get_user_page_fast() for mips with cache alias
From: "Kamal Dasu" <kdasu.kdev@gmail.com>
Date: Fri, 14 Jun 2013 14:10:03 -0400
Cc: "Kamal Dasu" <kdasu.kdev@gmail.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
get_user_pages_fast() is missing cache flushes for MIPS platforms
with cache alias. Filesystem failures observed with DirectIO
operations due to missing flush_anon_page() that use page coloring
logic to work with cache aliases. This fix falls through to take
slow_irqon path that calls get_user_pages() that has required
logic for platforms where cpu_has_dc_aliases is true.

Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
---
 arch/mips/mm/gup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/mm/gup.c b/arch/mips/mm/gup.c
index d4ea5c9..346fb7e 100644
--- a/arch/mips/mm/gup.c
+++ b/arch/mips/mm/gup.c
@@ -273,7 +273,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, 
int write,
        len = (unsigned long) nr_pages << PAGE_SHIFT;
 
        end = start + len;
-       if (end < start)
+       if (end < start || cpu_has_dc_aliases)
                goto slow_irqon;
 
        /* XXX: batch / limit 'nr' */
-- 
1.8.2.3



<Prev in Thread] Current Thread [Next in Thread>