From b4e12686e6145670242f0f8a2ec6eead694a157e Mon Sep 17 00:00:00 2001 From: Yue Ma Date: Wed, 15 Nov 2017 11:05:11 -0800 Subject: [PATCH] qcacmn: Enhance Runtime PM wakelock logging It helps to track runtime PM wakelock allocation for each user. Change-Id: I4d49c687fdd1dd3618f96f18acdaa9dad4197d74 CRs-fixed: 2152497 --- hif/src/pcie/if_pci.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c index 153271c11ab3..6fbbd472234a 100644 --- a/hif/src/pcie/if_pci.c +++ b/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 */