Blame SOURCES/0023-devtree-Fix-physical-ID-info-for-CPU-nodes.patch

21ef37
From 9faf09f9851fafd50b96b59d7eac77fcd1b641d7 Mon Sep 17 00:00:00 2001
21ef37
From: Chandni Verma <chandni@linux.vnet.ibm.com>
21ef37
Date: Thu, 20 Oct 2016 14:23:50 +0530
21ef37
Subject: [PATCH 23/43] devtree: Fix physical ID info for CPU nodes
21ef37
21ef37
'reg' property contains processor core id. Use this info to fill
21ef37
processor physical ID. This is useful to map processor core to
21ef37
sysfs entry in cpufreq.cc code.
21ef37
21ef37
Signed-off-by: Chandni Verma <chandni@linux.vnet.ibm.com>
21ef37
[Splited original patch and updated description - Vasant]
21ef37
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
21ef37
---
21ef37
 src/core/device-tree.cc | 4 ++++
21ef37
 1 file changed, 4 insertions(+)
21ef37
21ef37
diff --git a/src/core/device-tree.cc b/src/core/device-tree.cc
21ef37
index c60e49c..9c74e5a 100644
21ef37
--- a/src/core/device-tree.cc
21ef37
+++ b/src/core/device-tree.cc
21ef37
@@ -473,6 +473,7 @@ static void scan_devtree_cpu_power(hwNode & core)
21ef37
   {
21ef37
     uint32_t l2_key = 0;
21ef37
     uint32_t version = 0;
21ef37
+    uint32_t reg;
21ef37
     string basepath = string(DEVICETREE "/cpus/") + string(namelist[i]->d_name);
21ef37
     hwNode cpu("cpu", hw::processor);
21ef37
 
21ef37
@@ -491,6 +492,9 @@ static void scan_devtree_cpu_power(hwNode & core)
21ef37
     cpu.setDescription("CPU");
21ef37
     set_cpu(cpu, currentcpu++, basepath);
21ef37
 
21ef37
+    reg = get_u32(basepath + "/reg");
21ef37
+    cpu.setPhysId(tostring(reg));
21ef37
+
21ef37
     version = get_u32(basepath + "/cpu-version");
21ef37
     if (version != 0)
21ef37
       cpu.setVersion(tostring(version));
21ef37
-- 
21ef37
2.10.2
21ef37