qcacmn: Enhance Runtime PM wakelock logging

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

Change-Id: I4d49c687fdd1dd3618f96f18acdaa9dad4197d74
CRs-fixed: 2152497
This commit is contained in:
Yue Ma 2017-11-15 11:05:11 -08:00 • committed by snandini
commit b4e12686e6

View file

@ -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 */