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

Commit 02739d64 authored by Praveen Kurapati's avatar Praveen Kurapati
Browse files

msm: ipa3: Fix to memory allocation failure



During IPA shutdown the allocation for memory request fails.
So modify IPA to not sleep while memory allocation.

Change-Id: I4b12462ca65a753f91a0ede757b6ddf31afe9044
Signed-off-by: default avatarPraveen Kurapati <pkurapat@codeaurora.org>
parent 1d45792c
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ static const u32 ipa_hdr_proc_ctx_bin_sz[IPA_HDR_PROC_CTX_BIN_MAX] = { 32, 64};
static int ipa3_generate_hdr_hw_tbl(struct ipa_mem_buffer *mem)
{
	struct ipa3_hdr_entry *entry;
	gfp_t flag = GFP_KERNEL;

	mem->size = ipa3_ctx->hdr_tbl.end;

@@ -33,9 +34,14 @@ static int ipa3_generate_hdr_hw_tbl(struct ipa_mem_buffer *mem)
	}
	IPADBG_LOW("tbl_sz=%d\n", ipa3_ctx->hdr_tbl.end);

alloc:
	mem->base = dma_zalloc_coherent(ipa3_ctx->pdev, mem->size,
			&mem->phys_base, GFP_KERNEL);
			&mem->phys_base, flag);
	if (!mem->base) {
		if (flag == GFP_KERNEL) {
			flag = GFP_ATOMIC;
			goto alloc;
		}
		IPAERR("fail to alloc DMA buff of size %d\n", mem->size);
		return -ENOMEM;
	}
+7 −1
Original line number Diff line number Diff line
@@ -3600,6 +3600,7 @@ static int ipa_fltrt_alloc_init_tbl_hdr(
	u64 addr;
	int i;
	struct ipahal_fltrt_obj *obj;
	gfp_t flag = GFP_KERNEL;

	obj = &ipahal_fltrt_objs[ipahal_ctx->hw_type];

@@ -3609,10 +3610,15 @@ static int ipa_fltrt_alloc_init_tbl_hdr(
	}

	params->nhash_hdr.size = params->tbls_num * obj->tbl_hdr_width;
alloc:
	params->nhash_hdr.base = dma_alloc_coherent(ipahal_ctx->ipa_pdev,
		params->nhash_hdr.size,
		&params->nhash_hdr.phys_base, GFP_KERNEL);
		&params->nhash_hdr.phys_base, flag);
	if (!params->nhash_hdr.base) {
		if (flag == GFP_KERNEL) {
			flag = GFP_ATOMIC;
			goto alloc;
		}
		IPAHAL_ERR_RL("fail to alloc DMA buff of size %d\n",
			params->nhash_hdr.size);
		goto nhash_alloc_fail;