mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-03 11:43:03 +09:00
vdin: add dolby mem release protection [1/1]
PD#SWPL-8797 Problem: sometime oops occurred for vdin_dolby mem release Solution: add vdin dolby mem alloc flag & release protection Verify: x301 Change-Id: Iee90b58a0624c32032e204adcd043c8e94d03f1f Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
This commit is contained in:
@@ -3677,6 +3677,7 @@ void vdin_dolby_addr_alloc(struct vdin_dev_s *devp, unsigned int size)
|
||||
devp->vfp->dv_buf_mem[index],
|
||||
devp->vfp->dv_buf_vmem[index]);
|
||||
}
|
||||
devp->dv.dv_mem_alloced = 1;
|
||||
pr_info("%s:dv_dma_vaddr=0x%p,dv_dma_paddr=0x%lx\n", __func__,
|
||||
devp->dv.dv_dma_vaddr, (ulong)devp->dv.dv_dma_paddr);
|
||||
}
|
||||
@@ -3686,6 +3687,9 @@ void vdin_dolby_addr_release(struct vdin_dev_s *devp, unsigned int size)
|
||||
int highmem_flag;
|
||||
int index;
|
||||
|
||||
if (devp->dv.dv_mem_alloced == 0)
|
||||
return;
|
||||
|
||||
alloc_size = dolby_size_byte*size;
|
||||
if (devp->dv.dv_dma_vaddr)
|
||||
dma_free_coherent(&devp->this_pdev->dev, alloc_size,
|
||||
@@ -3706,6 +3710,7 @@ void vdin_dolby_addr_release(struct vdin_dev_s *devp, unsigned int size)
|
||||
}
|
||||
}
|
||||
}
|
||||
devp->dv.dv_mem_alloced = 0;
|
||||
}
|
||||
|
||||
static void vdin_dolby_metadata_swap(struct vdin_dev_s *devp, char *buf)
|
||||
|
||||
@@ -195,6 +195,7 @@ struct vdin_dv_s {
|
||||
bool dv_flag;
|
||||
bool dv_config;
|
||||
bool dv_crc_check;/*0:fail;1:ok*/
|
||||
unsigned int dv_mem_alloced;
|
||||
};
|
||||
|
||||
struct vdin_afbce_s {
|
||||
|
||||
Reference in New Issue
Block a user