summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhangq <zhangq@qti.qualcomm.com>2016-05-17 10:39:22 +0800
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2016-06-03 12:12:12 +0530
commitd9299803cc08ffbcb135b5bcb5e11bfc45931bcc (patch)
tree8539993a7db40431530de5a097c1c0c4b493c584
parentf4504502baa45e5574eb3d9bf1039bb4a8db8274 (diff)
qcacld-2.0: Resolve mem_alloc failure for FW dump
On some NON-QC platform, more than 1Mbytes physically contiguous memory are requested for target ram dump. But vos_mem_malloc cannot allocate memory larger than 1Mbytes. hif_get_virt_ramdump_mem is used to pre-allocate this buffer at SDIO probing. Change-Id: I9d2c9b2d4916552d37aba05b4beb0ac6d3fc2d75 CRs-Fixed: 1017213
-rw-r--r--CORE/SERVICES/BMI/ol_fw.c12
-rw-r--r--CORE/SERVICES/HIF/sdio/linux/if_ath_sdio.c16
2 files changed, 15 insertions, 13 deletions
diff --git a/CORE/SERVICES/BMI/ol_fw.c b/CORE/SERVICES/BMI/ol_fw.c
index b8373d4878a6..7b194bab0e73 100644
--- a/CORE/SERVICES/BMI/ol_fw.c
+++ b/CORE/SERVICES/BMI/ol_fw.c
@@ -1087,10 +1087,7 @@ static void ramdump_work_handler(struct work_struct *ramdump)
goto out_fail;
}
- ramdump_scn->ramdump_size = DRAM_SIZE + IRAM_SIZE + AXI_SIZE;
- ramdump_scn->ramdump_base =
- vos_mem_malloc(ramdump_scn->ramdump_size);
-
+ /* Buffer for ramdump should be pre-allocated when probing SDIO */
if (!ramdump_scn->ramdump_base) {
pr_err("%s: fail to alloc mem for FW RAM dump\n",
__func__);
@@ -1141,13 +1138,6 @@ out_fail:
#endif
#endif
-#ifdef TARGET_DUMP_FOR_NON_QC_PLATFORM
- if (ramdump_scn->ramdump_base) {
- vfree(ramdump_scn->ramdump_base);
- ramdump_scn->ramdump_base = NULL;
- ramdump_scn->ramdump_size = 0;
- }
-#endif
vos_set_logp_in_progress(VOS_MODULE_ID_VOSS, FALSE);
return;
}
diff --git a/CORE/SERVICES/HIF/sdio/linux/if_ath_sdio.c b/CORE/SERVICES/HIF/sdio/linux/if_ath_sdio.c
index 602adf59432a..3786d71036c4 100644
--- a/CORE/SERVICES/HIF/sdio/linux/if_ath_sdio.c
+++ b/CORE/SERVICES/HIF/sdio/linux/if_ath_sdio.c
@@ -114,12 +114,24 @@ static inline void hif_release_ramdump_mem(unsigned long *address)
#else
static inline void *hif_get_virt_ramdump_mem(unsigned long *size)
{
- *size = 0;
- return NULL;
+ size_t length = 0;
+ int flags = GFP_KERNEL;
+
+ length = DRAM_SIZE + IRAM_SIZE + AXI_SIZE;
+
+ if (size != NULL)
+ *size = (unsigned long)length;
+
+ if (in_interrupt() || irqs_disabled() || in_atomic())
+ flags = GFP_ATOMIC;
+
+ return kzalloc(length, flags);
}
static inline void hif_release_ramdump_mem(unsigned long *address)
{
+ if (address != NULL)
+ kfree(address);
}
#endif
#endif