浏览代码

qcacmn: Enhance Runtime PM wakelock logging

It helps to track runtime PM wakelock allocation for each user.

Change-Id: I4d49c687fdd1dd3618f96f18acdaa9dad4197d74
CRs-fixed: 2152497
Yue Ma 7 年之前
父节点
当前提交
b4e12686e6
共有 1 个文件被更改,包括 10 次插入2 次删除
  1. 10 2
      hif/src/pcie/if_pci.c

+ 10 - 2
hif/src/pcie/if_pci.c

@@ -4393,9 +4393,11 @@ int hif_runtime_lock_init(qdf_runtime_lock_t *lock, const char *name)
 {
 	struct hif_pm_runtime_lock *context;
 
+	HIF_INFO("Initializing Runtime PM wakelock %s", name);
+
 	context = qdf_mem_malloc(sizeof(*context));
 	if (!context) {
-		HIF_ERROR("%s: No memory for Runtime PM wakelock context\n",
+		HIF_ERROR("%s: No memory for Runtime PM wakelock context",
 			  __func__);
 		return -ENOMEM;
 	}
@@ -4418,8 +4420,13 @@ void hif_runtime_lock_deinit(struct hif_opaque_softc *hif_ctx,
 	struct hif_pm_runtime_lock *context = data;
 	struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(hif_ctx);
 
-	if (!context)
+	if (!context) {
+		HIF_ERROR("Runtime PM wakelock context is NULL");
 		return;
+	}
+
+	HIF_INFO("Deinitializing Runtime PM wakelock %s", context->name);
+
 	/*
 	 * Ensure to delete the context list entry and reduce the usage count
 	 * before freeing the context if context is active.
@@ -4429,6 +4436,7 @@ void hif_runtime_lock_deinit(struct hif_opaque_softc *hif_ctx,
 		__hif_pm_runtime_allow_suspend(sc, context);
 		spin_unlock_bh(&sc->runtime_lock);
 	}
+
 	qdf_mem_free(context);
 }
 #endif /* FEATURE_RUNTIME_PM */