From 602b5bf65b424a12a4400a9dd7f104cf282c4718 Mon Sep 17 00:00:00 2001 From: Cao Jian Date: Fri, 26 Jul 2019 17:46:04 +0800 Subject: [PATCH] osd: osd_mmap no more locks to release [1/1] PD#SWPL-11768 Problem: release one more mutex in osd_mmap Solution: remove mutex release in osd_mmap Verify: Verfied on p212 Change-Id: I139b80590740717ced321171ee665d0f6c0cd83f Signed-off-by: Cao Jian --- drivers/amlogic/media/osd/osd_fb.c | 2 -- drivers/amlogic/media/osd/osd_virtual.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/drivers/amlogic/media/osd/osd_fb.c b/drivers/amlogic/media/osd/osd_fb.c index 6d09a90..45f1ba6a 100644 --- a/drivers/amlogic/media/osd/osd_fb.c +++ b/drivers/amlogic/media/osd/osd_fb.c @@ -1543,7 +1543,6 @@ static int osd_mmap(struct fb_info *info, struct vm_area_struct *vma) mmio_pgoff = PAGE_ALIGN((start & ~PAGE_MASK) + len) >> PAGE_SHIFT; if (vma->vm_pgoff >= mmio_pgoff) { if (info->var.accel_flags) { - mutex_unlock(&info->mm_lock); return -EINVAL; } @@ -1551,7 +1550,6 @@ static int osd_mmap(struct fb_info *info, struct vm_area_struct *vma) start = info->fix.mmio_start; len = info->fix.mmio_len; } - mutex_unlock(&info->mm_lock); vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); diff --git a/drivers/amlogic/media/osd/osd_virtual.c b/drivers/amlogic/media/osd/osd_virtual.c index 0f7ab7b..cf08dd7 100644 --- a/drivers/amlogic/media/osd/osd_virtual.c +++ b/drivers/amlogic/media/osd/osd_virtual.c @@ -612,7 +612,6 @@ static int virt_osd_mmap(struct fb_info *info, struct vm_area_struct *vma) mmio_pgoff = PAGE_ALIGN((start & ~PAGE_MASK) + len) >> PAGE_SHIFT; if (vma->vm_pgoff >= mmio_pgoff) { if (info->var.accel_flags) { - mutex_unlock(&info->mm_lock); return -EINVAL; } @@ -620,7 +619,6 @@ static int virt_osd_mmap(struct fb_info *info, struct vm_area_struct *vma) start = info->fix.mmio_start; len = info->fix.mmio_len; } - mutex_unlock(&info->mm_lock); vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); -- 2.7.4