From ec4dcbf19646e52389c72d85daf20b4e74dc0f92 Mon Sep 17 00:00:00 2001
From: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Date: Tue, 22 Aug 2017 20:53:41 +0530
Subject: [PATCH 1/5] devtree: Check status property for caches
Check status property for L1 cache before enabling cache node.
Also check status before enabling L2/L3 icache.
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
src/core/device-tree.cc | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/core/device-tree.cc b/src/core/device-tree.cc
index 05b5b3c..e14a3b3 100644
--- a/src/core/device-tree.cc
+++ b/src/core/device-tree.cc
@@ -670,7 +670,10 @@ static void scan_devtree_cpu_power(hwNode & core)
product = hw::strip(get_string(basepath + "/name"));
if (hw::strip(get_string(basepath + "/status")) != "okay")
+ {
cache.disable();
+ icache.disable();
+ }
if (product == "l2-cache")
fill_cache_info("L2 Cache", basepath, cache, icache);
@@ -773,6 +776,12 @@ static void scan_devtree_cpu_power(hwNode & core)
if (cache.getSize() > 0)
cpu.addChild(cache);
+
+ if (hw::strip(get_string(basepath + "/status")) != "okay")
+ {
+ cache.disable();
+ icache.disable();
+ }
}
if (exists(basepath + "/l2-cache"))
--
1.8.3.1