linux-mips
[Top] [All Lists]

[PATCH 09/11] MIPS: Netlogic: Fixup memory regions for prefetch

To: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: [PATCH 09/11] MIPS: Netlogic: Fixup memory regions for prefetch
From: "Jayachandran C" <jchandra@broadcom.com>
Date: Mon, 10 Jun 2013 13:11:08 +0530
Cc: "Jayachandran C" <jchandra@broadcom.com>
In-reply-to: <1370850070-5127-1-git-send-email-jchandra@broadcom.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
References: <1370850070-5127-1-git-send-email-jchandra@broadcom.com>
Sender: linux-mips-bounce@linux-mips.org
Fix a cache error found in stress test, caused by the prefetch instruction
going beyond valid memory when acessing the last page of a region. Add
the pref_backup logic similar to XLR in XLP too.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
---
 arch/mips/netlogic/xlp/setup.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/mips/netlogic/xlp/setup.c b/arch/mips/netlogic/xlp/setup.c
index 8f69924..50e9855 100644
--- a/arch/mips/netlogic/xlp/setup.c
+++ b/arch/mips/netlogic/xlp/setup.c
@@ -61,6 +61,18 @@ static void nlm_linux_exit(void)
                cpu_wait();
 }
 
+static void nlm_fixup_mem(void)
+{
+       const int pref_backup = 512;
+       int i;
+
+       for (i = 0; i < boot_mem_map.nr_map; i++) {
+               if (boot_mem_map.map[i].type != BOOT_MEM_RAM)
+                       continue;
+               boot_mem_map.map[i].size -= pref_backup;
+       }
+}
+
 void __init plat_mem_setup(void)
 {
        panic_timeout   = 5;
@@ -70,6 +82,7 @@ void __init plat_mem_setup(void)
 
        /* memory and bootargs from DT */
        early_init_devtree(initial_boot_params);
+       nlm_fixup_mem();
 }
 
 const char *get_system_type(void)
-- 
1.7.9.5



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