Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1b89e783 authored by Alan Chen's avatar Alan Chen Committed by nshrivas
Browse files

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
parent cc3b9693
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -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;
	}