From: Jian Wang Date: Tue, 24 Dec 2019 09:39:01 +0000 (+0800) Subject: codec_mm: fix fastplay can not alloc twice [2/3] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=145a7809ea67f78ccdc9714dcc687e7276745a38;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git codec_mm: fix fastplay can not alloc twice [2/3] PD#SWPL-18391 Problem: codec_mm_extpool_pool_release use mgt->tvp_pool.total_size, not it parm tvp_pool, when extpool is cma_pool not tvp pool will duo to total_size set error. Solution: use codec_mm_extpool_pool_release parm tvp_pool total_size to set Verify: verify on u212 Change-Id: I83a5d988d7701cf6291250bd739c1c5b43143764 Signed-off-by: Jian Wang --- diff --git a/drivers/amlogic/media/common/codec_mm/codec_mm.c b/drivers/amlogic/media/common/codec_mm/codec_mm.c index 1c8c8d810821..e9078bc89301 100644 --- a/drivers/amlogic/media/common/codec_mm/codec_mm.c +++ b/drivers/amlogic/media/common/codec_mm/codec_mm.c @@ -1236,7 +1236,6 @@ EXPORT_SYMBOL(codec_mm_extpool_pool_alloc); */ static int codec_mm_extpool_pool_release(struct extpool_mgt_s *tvp_pool) { - struct codec_mm_mgt_s *mgt = get_mem_mgt(); int i; int ignored = 0; mutex_lock(&tvp_pool->pool_lock); @@ -1246,7 +1245,7 @@ static int codec_mm_extpool_pool_release(struct extpool_mgt_s *tvp_pool) if (gpool) { if (gen_pool_avail(gpool) != gen_pool_size(gpool)) { - pr_err("ERROR: TVP pool is not free.\n"); + pr_err("ext pool is not free.\n"); ignored++; continue; /*ignore this free now, */ } @@ -1266,7 +1265,7 @@ static int codec_mm_extpool_pool_release(struct extpool_mgt_s *tvp_pool) TVP_POOL_NAME); } } - mgt->tvp_pool.total_size -= slot_mem_size; + tvp_pool->total_size -= slot_mem_size; tvp_pool->gen_pool[i] = NULL; tvp_pool->mm[i] = NULL; }