mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 15:49:17 -04:00
qcacmn: Add validation assert for runtime pm get/put out of sync
As part of HIF runtime PM close add assert to make sure no runtime PM user has missed any put which may lead to runtime PM getting disabled at runtime. This assert ensures all runtime PM users have get and put in sync. Change-Id: I6663be013e85b8a262ccc0f60c8bd9c59bac25ef CRs-Fixed: 2665231
This commit is contained in:
parent
a208da2cfc
commit
0dffbe0845
1 changed files with 22 additions and 0 deletions
|
|
@ -39,6 +39,7 @@
|
|||
#include <linux/seq_file.h>
|
||||
#include "qdf_status.h"
|
||||
#include "qdf_atomic.h"
|
||||
#include "qdf_platform.h"
|
||||
#include "pld_common.h"
|
||||
#include "mp_dev.h"
|
||||
#include "hif_debug.h"
|
||||
|
|
@ -1273,6 +1274,25 @@ static void hif_pm_runtime_open(struct hif_pci_softc *sc)
|
|||
INIT_LIST_HEAD(&sc->prevent_suspend_list);
|
||||
}
|
||||
|
||||
static void hif_check_for_get_put_out_of_sync(struct hif_pci_softc *sc)
|
||||
{
|
||||
int32_t i;
|
||||
int32_t get_count, put_count;
|
||||
|
||||
if (qdf_is_fw_down())
|
||||
return;
|
||||
|
||||
for (i = 0; i < RTPM_ID_MAX; i++) {
|
||||
get_count = qdf_atomic_read(&sc->pm_stats.runtime_get_dbgid[i]);
|
||||
put_count = qdf_atomic_read(&sc->pm_stats.runtime_put_dbgid[i]);
|
||||
if (get_count != put_count) {
|
||||
QDF_DEBUG_PANIC("%s get-put out of sync. get %d put %d",
|
||||
rtpm_string_from_dbgid(i),
|
||||
get_count, put_count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* hif_pm_runtime_sanitize_on_exit(): sanitize the pm usage count and state
|
||||
* @sc: pci context
|
||||
|
|
@ -1289,6 +1309,8 @@ static void hif_pm_runtime_sanitize_on_exit(struct hif_pci_softc *sc)
|
|||
{
|
||||
struct hif_pm_runtime_lock *ctx, *tmp;
|
||||
|
||||
hif_check_for_get_put_out_of_sync(sc);
|
||||
|
||||
if (atomic_read(&sc->dev->power.usage_count) != 2)
|
||||
hif_pci_runtime_pm_warn(sc, "Driver Module Closing");
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue