qcacld-3.0: Check if unload is in progress during suspend

If unload in progress, abort suspend. causes null pointer ref otherwise

Change-Id: I7028b6f0efc9da62352b561e9def90ff9bffd5e6
CRs-Fixed: 878755
This commit is contained in:
Sanjay Devnani
2015-11-23 11:42:35 -08:00
committed by Satish Singh
parent 6bd8a2e02b
commit a64b512a9e
3 changed files with 30 additions and 0 deletions

View File

@@ -81,6 +81,8 @@ uint8_t cds_is_logp_in_progress(void);
void cds_set_logp_in_progress(uint8_t value);
uint8_t cds_is_load_unload_in_progress(void);
uint8_t cds_is_unload_in_progress(void);
void cds_set_load_unload_in_progress(uint8_t value);
CDF_STATUS cds_alloc_context(void *p_cds_context, CDF_MODULE_ID moduleID,

View File

@@ -1089,6 +1089,31 @@ uint8_t cds_is_load_unload_in_progress(void)
return gp_cds_context->isLoadUnloadInProgress;
}
/**
* cds_is_unload_in_progress() - check if driver unload in
* progress
*
* Return: true if unload is going on else false
*/
uint8_t cds_is_unload_in_progress(void)
{
hdd_context_t *hdd_ctx = NULL;
if (gp_cds_context == NULL) {
CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
"%s: global cds context is NULL", __func__);
return 0;
}
hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
if (hdd_ctx == NULL) {
CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
"%s: HDD context is NULL", __func__);
return 0;
}
return hdd_ctx->isUnloadInProgress;
}
/**
* cds_set_load_unload_in_progress() - set load/unload in progress
* @value: value to set

View File

@@ -1772,6 +1772,9 @@ static void hif_sleep_entry(void *arg)
if (scn->recovery)
return;
if (cds_is_unload_in_progress())
return;
cdf_spin_lock_irqsave(&hif_state->keep_awake_lock);
if (hif_state->verified_awake == false) {
idle_ms = cdf_system_ticks_to_msecs(cdf_system_ticks()