浏览代码

msm: eva: Identify the actual number of silver cores available with target

As PM QOS request needs to done for silver cores only for EVA and
number of silver cores would be different for different target so,
better to identify the actual number of available silver cores.
Added cpu_possible check to confirm if cpu is available or not.

Change-Id: Ibccc7688200732c3c666041a8fe414b4f2818993
Signed-off-by: Palak Joshi <[email protected]>
Palak Joshi 2 年之前
父节点
当前提交
0eedd436e1
共有 2 个文件被更改,包括 13 次插入1 次删除
  1. 6 0
      msm/eva/cvp_hfi.c
  2. 7 1
      msm/eva/msm_cvp_res_parse.c

+ 6 - 0
msm/eva/cvp_hfi.c

@@ -2027,6 +2027,8 @@ static void cvp_pm_qos_update(struct iris_hfi_device *device, bool vote_on)
 
 	if (device->res->pm_qos.latency_us && device->res->pm_qos.pm_qos_hdls)
 		for (i = 0; i < device->res->pm_qos.silver_count; i++) {
+			if (!cpu_possible(device->res->pm_qos.silver_cores[i]))
+				continue;
 			err = dev_pm_qos_update_request(
 				&device->res->pm_qos.pm_qos_hdls[i],
 				latency);
@@ -2299,6 +2301,8 @@ static int iris_hfi_core_init(void *device)
 
 		for (i = 0; i < dev->res->pm_qos.silver_count; i++) {
 			cpu = dev->res->pm_qos.silver_cores[i];
+			if (!cpu_possible(cpu))
+				continue;
 			err = dev_pm_qos_add_request(
 				get_cpu_device(cpu),
 				&dev->res->pm_qos.pm_qos_hdls[i],
@@ -2355,6 +2359,8 @@ static int iris_hfi_core_release(void *dev)
 	if (device->res->pm_qos.latency_us &&
 		device->res->pm_qos.pm_qos_hdls) {
 		for (i = 0; i < device->res->pm_qos.silver_count; i++) {
+			if (!cpu_possible(device->res->pm_qos.silver_cores[i]))
+				continue;
 			qos_hdl = &device->res->pm_qos.pm_qos_hdls[i];
 			if ((qos_hdl != NULL) && dev_pm_qos_request_active(qos_hdl))
 				dev_pm_qos_remove_request(qos_hdl);

+ 7 - 1
msm/eva/msm_cvp_res_parse.c

@@ -848,7 +848,13 @@ int cvp_read_platform_resources_from_drv_data(
 
 	res->pm_qos.latency_us = find_key_value(platform_data,
 			"qcom,pm-qos-latency-us");
-	res->pm_qos.silver_count = 4;
+	res->pm_qos.silver_count = 0;
+	for(i = 0; i < MAX_SILVER_CORE_NUM; i++) {
+		if(topology_cluster_id(i) == 0)
+			res->pm_qos.silver_count++;
+		else
+			break;
+	}
 	for (i = 0; i < res->pm_qos.silver_count; i++)
 		res->pm_qos.silver_cores[i] = i;
 	res->pm_qos.off_vote_cnt = 0;