@@ -497,7 +497,7 @@ static int __init get_cpu_for_node(struct device_node *node)
497
497
}
498
498
499
499
static int __init parse_core (struct device_node * core , int package_id ,
500
- int core_id )
500
+ int cluster_id , int core_id )
501
501
{
502
502
char name [20 ];
503
503
bool leaf = true;
@@ -513,6 +513,7 @@ static int __init parse_core(struct device_node *core, int package_id,
513
513
cpu = get_cpu_for_node (t );
514
514
if (cpu >= 0 ) {
515
515
cpu_topology [cpu ].package_id = package_id ;
516
+ cpu_topology [cpu ].cluster_id = cluster_id ;
516
517
cpu_topology [cpu ].core_id = core_id ;
517
518
cpu_topology [cpu ].thread_id = i ;
518
519
} else if (cpu != - ENODEV ) {
@@ -534,6 +535,7 @@ static int __init parse_core(struct device_node *core, int package_id,
534
535
}
535
536
536
537
cpu_topology [cpu ].package_id = package_id ;
538
+ cpu_topology [cpu ].cluster_id = cluster_id ;
537
539
cpu_topology [cpu ].core_id = core_id ;
538
540
} else if (leaf && cpu != - ENODEV ) {
539
541
pr_err ("%pOF: Can't get CPU for leaf core\n" , core );
@@ -543,7 +545,8 @@ static int __init parse_core(struct device_node *core, int package_id,
543
545
return 0 ;
544
546
}
545
547
546
- static int __init parse_cluster (struct device_node * cluster , int depth )
548
+ static int __init
549
+ parse_cluster (struct device_node * cluster , int cluster_id , int depth )
547
550
{
548
551
char name [20 ];
549
552
bool leaf = true;
@@ -563,7 +566,7 @@ static int __init parse_cluster(struct device_node *cluster, int depth)
563
566
c = of_get_child_by_name (cluster , name );
564
567
if (c ) {
565
568
leaf = false;
566
- ret = parse_cluster (c , depth + 1 );
569
+ ret = parse_cluster (c , i , depth + 1 );
567
570
of_node_put (c );
568
571
if (ret != 0 )
569
572
return ret ;
@@ -587,7 +590,7 @@ static int __init parse_cluster(struct device_node *cluster, int depth)
587
590
}
588
591
589
592
if (leaf ) {
590
- ret = parse_core (c , 0 , core_id ++ );
593
+ ret = parse_core (c , 0 , cluster_id , core_id ++ );
591
594
} else {
592
595
pr_err ("%pOF: Non-leaf cluster with core %s\n" ,
593
596
cluster , name );
@@ -627,7 +630,7 @@ static int __init parse_dt_topology(void)
627
630
if (!map )
628
631
goto out ;
629
632
630
- ret = parse_cluster (map , 0 );
633
+ ret = parse_cluster (map , -1 , 0 );
631
634
if (ret != 0 )
632
635
goto out_map ;
633
636
0 commit comments