Skip to content
Snippets Groups Projects
Commit d87ca0cd authored by Lingutla Chandrasekhar's avatar Lingutla Chandrasekhar
Browse files

ldrp_v2: sched-info: Fix finding number of clusters


Current script assumes last cpu would map to last cluster in cpu-map.
But it might not true always, device-tree can map cpus in different
order than its actual number. i.e. cpus0-3 could be part on cluster#1,
and cpus4-7 maps to cluster#0, in this case last cluster id is 0 and
breaks above assumption.

Fix this by dynamically extending the cluster list.

Change-Id: I907d89e33a1f57b656c6df374a23e18b2d2c42fa
Signed-off-by: default avatarLingutla Chandrasekhar <clingutla@codeaurora.org>
parent a3d39b29
No related branches found
No related tags found
No related merge requests found
...@@ -41,19 +41,18 @@ def verify_active_cpus(ramdump): ...@@ -41,19 +41,18 @@ def verify_active_cpus(ramdump):
if (cluster_id_off is None): if (cluster_id_off is None):
print_out_str("\n Invalid cluster topology detected\n") print_out_str("\n Invalid cluster topology detected\n")
clusters = ramdump.read_int(cpu_topology_addr + cluster_id_off + ((nr_cpus - 1) * cpu_topology_size))
clusters += 1
# INFO: from 4.19 onwards, core_sibling mask contains only online cpus, # INFO: from 4.19 onwards, core_sibling mask contains only online cpus,
# find out cluster cpus dynamically. # find out cluster cpus dynamically.
cluster_nrcpus = [0] * (clusters) cluster_nrcpus = [0]
for j in range(0, nr_cpus): for j in range(0, nr_cpus):
c_id = ramdump.read_int(cpu_topology_addr + (j * cpu_topology_size) + cluster_id_off) c_id = ramdump.read_int(cpu_topology_addr + (j * cpu_topology_size) + cluster_id_off)
if len(cluster_nrcpus) <= c_id :
cluster_nrcpus.extend([0])
cluster_nrcpus[c_id] += 1 cluster_nrcpus[c_id] += 1
next_cluster_cpu = 0 next_cluster_cpu = 0
for i in range(0, clusters): for i in range(0, len(cluster_nrcpus)):
cluster_cpus = ramdump.read_word(cpu_topology_addr + cluster_cpus = ramdump.read_word(cpu_topology_addr +
(next_cluster_cpu * cpu_topology_size) + core_sib_off) (next_cluster_cpu * cpu_topology_size) + core_sib_off)
cluster_online_cpus = cpu_online_bits & cluster_cpus cluster_online_cpus = cpu_online_bits & cluster_cpus
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment