From 1b89e783de85d17dfa2dcdc11d946eabca1cf26d Mon Sep 17 00:00:00 2001 From: Alan Chen Date: Tue, 21 Jan 2020 13:27:05 -0800 Subject: [PATCH] qcacld-3.0: Use the hif api for doing PM idle operations wlan_hdd_pm_qos_notify() is currently directly calling the kernel runtime pm operation functions. Use the hif api functions to perform these operations instead. Change-Id: I8b13a8dd0d5a89f2208b4f319e71b4ffc217ae5c CRs-Fixed: 2607715 --- core/hdd/src/wlan_hdd_power.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 3a9bd8fce6c3..e9ff1d1b651e 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -950,17 +950,23 @@ int wlan_hdd_pm_qos_notify(struct notifier_block *nb, unsigned long curr_val, { struct hdd_context *hdd_ctx = container_of(nb, struct hdd_context, pm_qos_notifier); + void *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); + + if (!hif_ctx) { + hdd_err("Hif context is Null"); + return -EINVAL; + } hdd_debug("PM QOS update. Current value: %ld", curr_val); qdf_spin_lock_irqsave(&hdd_ctx->pm_qos_lock); if (!hdd_ctx->runtime_pm_prevented && curr_val != PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE) { - pm_runtime_get_noresume(hdd_ctx->parent_dev); + hif_pm_runtime_get_noresume(hif_ctx); hdd_ctx->runtime_pm_prevented = true; } else if (hdd_ctx->runtime_pm_prevented && curr_val == PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE) { - pm_runtime_put_noidle(hdd_ctx->parent_dev); + hif_pm_runtime_put_noidle(hif_ctx); hdd_ctx->runtime_pm_prevented = false; }