linux-mips
[Top] [All Lists]

Re: [MIPS] SB1: Build fix: delete initialization of flush_icache_page po

To: mark.e.mason@broadcom.com
Subject: Re: [MIPS] SB1: Build fix: delete initialization of flush_icache_page pointer.
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Fri, 18 Aug 2006 10:51:05 +0900 (JST)
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org, ths@networkno.de
In-reply-to: <7E000E7F06B05C49BDBB769ADAF44D07EEEC8C@NT-SJCA-0750.brcm.ad.broadcom.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <S20037884AbWHMBM7/20060813011259Z+2871@ftp.linux-mips.org> <7E000E7F06B05C49BDBB769ADAF44D07EEEC8C@NT-SJCA-0750.brcm.ad.broadcom.com>
Sender: linux-mips-bounce@linux-mips.org
On Thu, 17 Aug 2006 14:20:07 -0700, "Mark E Mason" <mark.e.mason@broadcom.com> 
wrote:
> The sb1_flash_icache_page change below breaks causes 1480 kernels to
> hang after freeing memory:

Does this (untested) patch work for you?

diff --git a/arch/mips/mm/c-sb1.c b/arch/mips/mm/c-sb1.c
index 4bd9ad8..0f5691a 100644
--- a/arch/mips/mm/c-sb1.c
+++ b/arch/mips/mm/c-sb1.c
@@ -253,6 +253,17 @@ void sb1___flush_cache_all(void)
        __attribute__((alias("local_sb1___flush_cache_all")));
 #endif
 
+static inline void local_sb1_flush_data_cache_page(void * addr)
+{
+       __sb1_writeback_inv_dcache_range((unsigned long)addr,
+                                        (unsigned long)addr + PAGE_SIZE);
+}
+
+static void sb1_flush_data_cache_page(unsigned long addr)
+{
+       on_each_cpu(local_sb1_flush_data_cache_page, (void *) addr, 1, 1);
+}
+
 /*
  * When flushing a range in the icache, we have to first writeback
  * the dcache for the same range, so new ifetches will see any
@@ -527,8 +538,8 @@ #endif
        flush_cache_page = sb1_flush_cache_page;
 
        flush_cache_sigtramp = sb1_flush_cache_sigtramp;
-       local_flush_data_cache_page = (void *) sb1_nop;
-       flush_data_cache_page = (void *) sb1_nop;
+       local_flush_data_cache_page = local_sb1_flush_data_cache_page;
+       flush_data_cache_page = sb1_flush_data_cache_page;
 
        /* Full flush */
        __flush_cache_all = sb1___flush_cache_all;

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