Skip to content

Commit

Permalink
MIPS: Fix get_user_page_fast() for mips with cache alias
Browse files Browse the repository at this point in the history
get_user_pages_fast() is missing cache flushes for MIPS platforms with
cache aliases.  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.

[ralf@linux-mips.org: Explicity include <asm/cpu-features.h>.]

Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/5469/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Kamal Dasu authored and Ralf Baechle committed Aug 26, 2013
1 parent d8dfad3 commit 5b167c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/mips/mm/gup.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <linux/swap.h>
#include <linux/hugetlb.h>

#include <asm/cpu-features.h>
#include <asm/pgtable.h>

static inline pte_t gup_get_pte(pte_t *ptep)
Expand Down Expand Up @@ -273,7 +274,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' */
Expand Down

0 comments on commit 5b167c1

Please sign in to comment.