qcacld-3.0: Use for_each_present_cpu() to traverse each cpu

On quad-core cpu paltform, the qdf_for_each_possible_cpu() iterate
8 times in the hdd_pm_qos_add_request() trying to add pm qos request
for CPU0~7, but only CPU0~3 actually. There is same issue in the
hdd_pm_qos_update_request()/hdd_pm_qos_remove_request(), it hit the
kernel waring about "called for unknown object" when try to update
/remove pm qos request for non-existed CPU4~7.

The fix is to use for_each_present_cpu() to traverse each cpu
to avoid the kernel warning.

Change-Id: I38fe4a6807452e11eb7230c2c194af7cbae28564
CRs-Fixed: 2902547
Este commit está contenido en:
Li Feng
2021-03-18 15:42:32 +08:00
cometido por snandini
padre dfff97c69e
commit 8b8f61989c

Ver fichero

@@ -9779,7 +9779,7 @@ static inline void hdd_pm_qos_update_request(struct hdd_context *hdd_ctx,
if (qdf_cpumask_empty(pm_qos_cpu_mask)) {
latency = wlan_hdd_get_pm_qos_cpu_latency();
qdf_for_each_possible_cpu(cpu) {
for_each_present_cpu(cpu) {
dev_pm_qos_update_request(
&hdd_ctx->pm_qos_req[cpu],
latency);
@@ -9815,7 +9815,7 @@ static inline void hdd_pm_qos_add_request(struct hdd_context *hdd_ctx)
qdf_cpumask_clear(&hdd_ctx->qos_cpu_mask);
hdd_pm_qos_update_cpu_mask(&hdd_ctx->qos_cpu_mask, false);
for_each_possible_cpu(cpu) {
for_each_present_cpu(cpu) {
cpu_dev = get_cpu_device(cpu);
dev_pm_qos_add_request(cpu_dev, &hdd_ctx->pm_qos_req[cpu],
@@ -9830,7 +9830,7 @@ static inline void hdd_pm_qos_remove_request(struct hdd_context *hdd_ctx)
{
int cpu;
for_each_possible_cpu(cpu) {
for_each_present_cpu(cpu) {
dev_pm_qos_remove_request(&hdd_ctx->pm_qos_req[cpu]);
hdd_debug("Remove dev_pm_qos_request for all cpus: %d", cpu);
}