Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 553a567e authored by Pooja Kumari's avatar Pooja Kumari Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa3: Fix to memory allocation failure



During device reboot when IPA is going for shutdown,
the allocation for memory request fails.  Add change in
IPA to not sleep while memory allocation.

Change-Id: I0bdbf0f622770566ad1135c76f6edc2790285420
Signed-off-by: default avatarPooja Kumari <kumarip@codeaurora.org>
parent 8fbc286d
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -4077,6 +4077,7 @@ int ipahal_fltrt_allocate_hw_tbl_imgs(
int ipahal_fltrt_allocate_hw_sys_tbl(struct ipa_mem_buffer *tbl_mem)
{
	struct ipahal_fltrt_obj *obj;
	gfp_t flag = GFP_KERNEL;

	IPAHAL_DBG_LOW("Entry\n");

@@ -4094,10 +4095,14 @@ int ipahal_fltrt_allocate_hw_sys_tbl(struct ipa_mem_buffer *tbl_mem)

	/* add word for rule-set terminator */
	tbl_mem->size += obj->tbl_width;

alloc:
	tbl_mem->base = dma_alloc_coherent(ipahal_ctx->ipa_pdev, tbl_mem->size,
		&tbl_mem->phys_base, GFP_KERNEL);
		&tbl_mem->phys_base, flag);
	if (!tbl_mem->base) {
		if (flag == GFP_KERNEL) {
			flag = GFP_ATOMIC;
			goto alloc;
		}
		IPAHAL_ERR("fail to alloc DMA buf of size %d\n",
			tbl_mem->size);
		return -ENOMEM;