]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
sh: Fix alias calculation for non-aliasing cases.
authorPaul Mundt <lethal@linux-sh.org>
Mon, 24 Sep 2007 07:38:25 +0000 (16:38 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Mon, 24 Sep 2007 07:38:25 +0000 (16:38 +0900)
There was an off-by-1 on the cache alias detection logic on SH-4,
which caused n_aliases to always be 1 even when the page size
precluded the existence of aliases.

With this corrected, 64KB pages happily reports n_aliases == 0, and
hits the appropriate fast paths in the flushing routines.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/mm/cache-sh4.c

index bbc226469aa1c1ad4bfb0bea994f8b6f0076005f..6c36c2fb819906d06de1ae88b87bc3df455d27b2 100644 (file)
@@ -2,7 +2,7 @@
  * arch/sh/mm/cache-sh4.c
  *
  * Copyright (C) 1999, 2000, 2002  Niibe Yutaka
- * Copyright (C) 2001 - 2006  Paul Mundt
+ * Copyright (C) 2001 - 2007  Paul Mundt
  * Copyright (C) 2003  Richard Curnow
  *
  * This file is subject to the terms and conditions of the GNU General Public
@@ -44,7 +44,7 @@ static void (*__flush_dcache_segment_fn)(unsigned long, unsigned long) =
 static void compute_alias(struct cache_info *c)
 {
        c->alias_mask = ((c->sets - 1) << c->entry_shift) & ~(PAGE_SIZE - 1);
-       c->n_aliases = (c->alias_mask >> PAGE_SHIFT) + 1;
+       c->n_aliases = c->alias_mask ? (c->alias_mask >> PAGE_SHIFT) + 1 : 0;
 }
 
 static void __init emit_cache_params(void)