Merge "msm: ipa: exit when hdr proc ctx table is full"
This commit is contained in:
commit
57cfb76cee
2 changed files with 18 additions and 0 deletions
|
@ -485,6 +485,7 @@ static int __ipa_add_hdr_proc_ctx(struct ipa_hdr_proc_ctx_add *proc_ctx,
|
|||
struct ipa_hdr_proc_ctx_tbl *htbl = &ipa_ctx->hdr_proc_ctx_tbl;
|
||||
int id;
|
||||
int needed_len;
|
||||
int mem_size;
|
||||
|
||||
IPADBG("processing type %d hdr_hdl %d\n",
|
||||
proc_ctx->type, proc_ctx->hdr_hdl);
|
||||
|
@ -529,6 +530,14 @@ static int __ipa_add_hdr_proc_ctx(struct ipa_hdr_proc_ctx_add *proc_ctx,
|
|||
goto bad_len;
|
||||
}
|
||||
|
||||
mem_size = (ipa_ctx->hdr_proc_ctx_tbl_lcl) ?
|
||||
IPA_MEM_PART(apps_hdr_proc_ctx_size) :
|
||||
IPA_MEM_PART(apps_hdr_proc_ctx_size_ddr);
|
||||
if (htbl->end + ipa_hdr_proc_ctx_bin_sz[bin] > mem_size) {
|
||||
IPAERR("hdr proc ctx table overflow\n");
|
||||
goto bad_len;
|
||||
}
|
||||
|
||||
if (list_empty(&htbl->head_free_offset_list[bin])) {
|
||||
offset = kmem_cache_zalloc(ipa_ctx->hdr_proc_ctx_offset_cache,
|
||||
GFP_KERNEL);
|
||||
|
|
|
@ -324,6 +324,7 @@ static int __ipa_add_hdr_proc_ctx(struct ipa_hdr_proc_ctx_add *proc_ctx,
|
|||
struct ipa3_hdr_proc_ctx_tbl *htbl = &ipa3_ctx->hdr_proc_ctx_tbl;
|
||||
int id;
|
||||
int needed_len;
|
||||
int mem_size;
|
||||
|
||||
IPADBG_LOW("processing type %d hdr_hdl %d\n",
|
||||
proc_ctx->type, proc_ctx->hdr_hdl);
|
||||
|
@ -366,6 +367,14 @@ static int __ipa_add_hdr_proc_ctx(struct ipa_hdr_proc_ctx_add *proc_ctx,
|
|||
goto bad_len;
|
||||
}
|
||||
|
||||
mem_size = (ipa3_ctx->hdr_proc_ctx_tbl_lcl) ?
|
||||
IPA_MEM_PART(apps_hdr_proc_ctx_size) :
|
||||
IPA_MEM_PART(apps_hdr_proc_ctx_size_ddr);
|
||||
if (htbl->end + ipa_hdr_proc_ctx_bin_sz[bin] > mem_size) {
|
||||
IPAERR("hdr proc ctx table overflow\n");
|
||||
goto bad_len;
|
||||
}
|
||||
|
||||
if (list_empty(&htbl->head_free_offset_list[bin])) {
|
||||
offset = kmem_cache_zalloc(ipa3_ctx->hdr_proc_ctx_offset_cache,
|
||||
GFP_KERNEL);
|
||||
|
|
Loading…
Add table
Reference in a new issue