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 <quic_palakash@quicinc.com>
This commit is contained in:
Palak Joshi
2023-06-03 12:01:26 +05:30
committed by Gerrit - the friendly Code Review server
parent 304e2cf9c0
commit 0eedd436e1
2 changed files with 13 additions and 1 deletions

View File

@@ -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);

View File

@@ -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;