From 6ed2288ca93479f801f49daf9b6d674701f4c28e Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 30 Jan 2017 22:28:31 -0500 Subject: vchiq_2835_arm: switch to get_user_pages_fast() Signed-off-by: Al Viro --- .../interface/vchiq_arm/vchiq_2835_arm.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'drivers/staging') diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c index 0159ca4407d8..cd2b19f335d8 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c @@ -92,8 +92,7 @@ static irqreturn_t vchiq_doorbell_irq(int irq, void *dev_id); static struct vchiq_pagelist_info * -create_pagelist(char __user *buf, size_t count, unsigned short type, - struct task_struct *task); +create_pagelist(char __user *buf, size_t count, unsigned short type); static void free_pagelist(struct vchiq_pagelist_info *pagelistinfo, @@ -251,8 +250,7 @@ vchiq_prepare_bulk_data(VCHIQ_BULK_T *bulk, VCHI_MEM_HANDLE_T memhandle, pagelistinfo = create_pagelist((char __user *)offset, size, (dir == VCHIQ_BULK_RECEIVE) ? PAGELIST_READ - : PAGELIST_WRITE, - current); + : PAGELIST_WRITE); if (!pagelistinfo) return VCHIQ_ERROR; @@ -391,8 +389,7 @@ cleanup_pagelistinfo(struct vchiq_pagelist_info *pagelistinfo) */ static struct vchiq_pagelist_info * -create_pagelist(char __user *buf, size_t count, unsigned short type, - struct task_struct *task) +create_pagelist(char __user *buf, size_t count, unsigned short type) { PAGELIST_T *pagelist; struct vchiq_pagelist_info *pagelistinfo; @@ -472,14 +469,11 @@ create_pagelist(char __user *buf, size_t count, unsigned short type, } /* do not try and release vmalloc pages */ } else { - down_read(&task->mm->mmap_sem); - actual_pages = get_user_pages( - (unsigned long)buf & PAGE_MASK, + actual_pages = get_user_pages_fast( + (unsigned long)buf & PAGE_MASK, num_pages, - (type == PAGELIST_READ) ? FOLL_WRITE : 0, - pages, - NULL /*vmas */); - up_read(&task->mm->mmap_sem); + type == PAGELIST_READ, + pages); if (actual_pages != num_pages) { vchiq_log_info(vchiq_arm_log_level, -- cgit v1.2.3 From e1a58a5421c6a9f4ab74810d6ecbbdb6b1b2e2c7 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 22 Sep 2017 18:21:11 -0400 Subject: atomisp: use get_user_pages_fast() Signed-off-by: Al Viro --- drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/staging') diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c index 11162f595fc7..2052f8d2f137 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c @@ -1029,10 +1029,8 @@ static int alloc_user_pages(struct hmm_buffer_object *bo, } else { /*Handle frame buffer allocated in user space*/ mutex_unlock(&bo->mutex); - down_read(¤t->mm->mmap_sem); - page_nr = get_user_pages((unsigned long)userptr, - (int)(bo->pgnr), 1, pages, NULL); - up_read(¤t->mm->mmap_sem); + page_nr = get_user_pages_fast((unsigned long)userptr, + (int)(bo->pgnr), 1, pages); mutex_lock(&bo->mutex); bo->mem_type = HMM_BO_MEM_TYPE_USER; } -- cgit v1.2.3