From c984192e1bfe0b46fd54b56a6f36ee653f91b7a3 Mon Sep 17 00:00:00 2001 From: Yue Ma Date: Fri, 27 Mar 2020 14:57:51 -0700 Subject: [PATCH] qcacld-3.0: Fix bugs from PM QOS notifier for runtime PM Destroy PM QOS spinlock after unregistering PM QOS notifier. Use hif_pm_runtime_put() instead of hif_pm_runtime_put_noidle() so that it can trigger a runtime PM suspend after usage count reaching 0. Change-Id: I93949857636de6d9807fa2abceec818a8584c596 CRs-fixed: 2651516 --- core/hdd/src/wlan_hdd_main.c | 2 ++ core/hdd/src/wlan_hdd_power.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 8580df4d112a..d6f37ff22129 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -3520,6 +3520,8 @@ static void hdd_wlan_unregister_pm_qos_notifier(struct hdd_context *hdd_ctx) } qdf_spin_unlock_irqrestore(&hdd_ctx->pm_qos_lock); + + qdf_spinlock_destroy(&hdd_ctx->pm_qos_lock); } #else static int hdd_wlan_register_pm_qos_notifier(struct hdd_context *hdd_ctx) diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index f8b602e903d1..7091e45a9135 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -935,7 +935,7 @@ int wlan_hdd_pm_qos_notify(struct notifier_block *nb, unsigned long curr_val, hdd_ctx->runtime_pm_prevented = true; } else if (hdd_ctx->runtime_pm_prevented && curr_val == PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE) { - hif_pm_runtime_put_noidle(hif_ctx); + hif_pm_runtime_put(hif_ctx); hdd_ctx->runtime_pm_prevented = false; }