cpu-topology: Change the size of allocation for cpu's raw_capacity

Allocating raw_capacity nodes as per max possible cpus gives issues
when there are cores in between which are not available. Allocate as 
many elements for holding raw_capacity as is last set bit position
in possible mask.

Change-Id: I90055f96c320b15960efac10d8d92c69413eeb6b
Signed-off-by: Avaneesh Kumar Dwivedi <quic_akdwived@quicinc.com>
This commit is contained in:
Avaneesh Kumar Dwivedi 2022-11-29 02:52:46 +05:30 • committed by Gerrit - the friendly Code Review server
commit ccce7f7c52

View file

@ -167,7 +167,7 @@ bool __init topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu)
&cpu_capacity);
if (!ret) {
if (!raw_capacity) {
raw_capacity = kcalloc(num_possible_cpus(),
raw_capacity = kcalloc(cpumask_last(cpu_possible_mask),
sizeof(*raw_capacity),
GFP_KERNEL);
if (!raw_capacity) {