Blame SOURCES/0020-devtree-Display-CPU-nodes-before-memory.patch

99c779
From 6a75f4e52f0a356d54e1cd06f99f91d21bd03663 Mon Sep 17 00:00:00 2001
99c779
From: Chandni Verma <chandni@linux.vnet.ibm.com>
99c779
Date: Thu, 14 Jul 2016 23:46:42 +0530
99c779
Subject: [PATCH 20/43] devtree: Display CPU nodes before memory
99c779
99c779
Present lshw displays memory node before cpu node for Power System. But
99c779
on x86, it displays cpu before memory. Lets use same output format on
99c779
x86 and Power Systems.
99c779
99c779
Note that I've made sure it doesn't hurt other platforms (like Apple)
99c779
which has device tree.
99c779
99c779
Signed-off-by: Chandni Verma <chandni@linux.vnet.ibm.com>
99c779
[Made sure this patch doesn't impact non-IBM Power systems,
99c779
 updated description - Vasant]
99c779
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
99c779
---
99c779
 src/core/device-tree.cc | 11 +++++++----
99c779
 1 file changed, 7 insertions(+), 4 deletions(-)
99c779
99c779
diff --git a/src/core/device-tree.cc b/src/core/device-tree.cc
99c779
index 700dff0..b8feb12 100644
99c779
--- a/src/core/device-tree.cc
99c779
+++ b/src/core/device-tree.cc
99c779
@@ -931,8 +931,8 @@ bool scan_device_tree(hwNode & n)
99c779
     {
99c779
       core->addHint("icon", string("board"));
99c779
       scan_devtree_root(*core);
99c779
-      scan_devtree_memory_powernv(*core);
99c779
       scan_devtree_cpu_power(*core);
99c779
+      scan_devtree_memory_powernv(*core);
99c779
       n.addCapability("powernv", "Non-virtualized");
99c779
       n.addCapability("opal", "OPAL firmware");
99c779
     }
99c779
@@ -982,11 +982,14 @@ bool scan_device_tree(hwNode & n)
99c779
       core->addHint("icon", string("board"));
99c779
       scan_devtree_root(*core);
99c779
       scan_devtree_bootrom(*core);
99c779
-      scan_devtree_memory(*core);
99c779
-      if (exists(DEVICETREE "/ibm,lpar-capable"))
99c779
+      if (exists(DEVICETREE "/ibm,lpar-capable")) {
99c779
         scan_devtree_cpu_power(*core);
99c779
-      else
99c779
+        scan_devtree_memory(*core);
99c779
+      }
99c779
+      else {
99c779
+        scan_devtree_memory(*core);
99c779
         scan_devtree_cpu(*core);
99c779
+     }
99c779
     }
99c779
   }
99c779
 
99c779
-- 
99c779
2.10.2
99c779