summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrashanth Bhatta <bhattap@qca.qualcomm.com>2015-10-15 20:46:16 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2015-10-16 00:57:47 -0700
commit01ae45b557e662b39fcdf41eed2bfc804ae5bd99 (patch)
tree28a68dba748427d4b9e9a11130bd29b160f6d8f0
parent4856602f03ec9f5ae78ba8df8c2ae3000a87396d (diff)
qcacld: Prevent runtime suspend when recovery initiated
When self recovery initiated, CRASH_INJECT command is sent to firmware. If firmware crash doesn't reach the host in time then RuntimePM may kick in and try to suspend the PCIe link. At this time, firmware might already been crashed just that host missed the interrupt. Add the logic to prevent the Runtime suspend when initiating the recovery so that host driver doesn't attempt the suspend which may not go through and cause stability issues. Change-Id: Ie8d5fc6aa08e4864fa5f03119c25037f5aeb5cec CRs-fixed: 924538
-rw-r--r--CORE/VOSS/src/vos_api.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/CORE/VOSS/src/vos_api.c b/CORE/VOSS/src/vos_api.c
index cfb24850ff83..43a8afa2c63b 100644
--- a/CORE/VOSS/src/vos_api.c
+++ b/CORE/VOSS/src/vos_api.c
@@ -2478,6 +2478,7 @@ void vos_trigger_recovery(void)
pVosContextType vos_context;
tp_wma_handle wma_handle;
VOS_STATUS status = VOS_STATUS_SUCCESS;
+ void *runtime_context = NULL;
vos_context = vos_get_global_context(VOS_MODULE_ID_VOSS, NULL);
if (!vos_context) {
@@ -2494,6 +2495,9 @@ void vos_trigger_recovery(void)
return;
}
+ runtime_context = vos_runtime_pm_prevent_suspend_init("vos_recovery");
+ vos_runtime_pm_prevent_suspend(runtime_context);
+
wma_crash_inject(wma_handle, RECOVERY_SIM_SELF_RECOVERY, 0);
status = vos_wait_single_event(&wma_handle->recovery_event,
@@ -2506,14 +2510,16 @@ void vos_trigger_recovery(void)
if (vos_is_logp_in_progress(VOS_MODULE_ID_VOSS, NULL)) {
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
"LOGP is in progress, ignore!");
- return;
+ goto out;
}
vos_set_logp_in_progress(VOS_MODULE_ID_VOSS, TRUE);
cnss_schedule_recovery_work();
#endif
-
- return;
}
+
+out:
+ vos_runtime_pm_allow_suspend(runtime_context);
+ vos_runtime_pm_prevent_suspend_deinit(runtime_context);
}
/**