summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2019-09-03 14:02:10 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2019-09-03 14:02:10 -0700
commit6dabdf86e74353c8529a47dc6c468d183116e4a6 (patch)
tree08245398b9492626982e077c636a737e4f527d98
parent3c8c50fdda8405b0d5fa7fbb3a34c91c9025f760 (diff)
parent32792728068ed47048ab7aa459cc9be97d47c722 (diff)
Merge "msm: ipa3: Fix to memory allocation failure"
-rw-r--r--drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_fltrt.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_fltrt.c b/drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_fltrt.c
index c5be5344f82d..e9ad7bcbf07a 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_fltrt.c
+++ b/drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_fltrt.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -3164,6 +3164,7 @@ bdy_alloc_fail:
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");
@@ -3181,10 +3182,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;