Re: Remaining BKL users, what to do

2010-09-16 Thread Jan Kara
/staging if there are no users left. I think some people still use this... fs/udf: Not completely trivial, but probably necessary to fix. Project web site is dead, I hope that Jan Kara can be motivated to fix it though. Yeah, I can have a look

Re: [PATCH 01/10] string: introduce memweight

2012-05-23 Thread Jan Kara
On Wed 23-05-12 21:12:18, Akinobu Mita wrote: 2012/5/23 Jan Kara j...@suse.cz: On Sun 20-05-12 22:23:14, Akinobu Mita wrote: memweight() is the function that counts the total number of bits set in memory area.  The memory area doesn't need to be aligned to long-word boundary unlike

Re: [PATCH v2 01/10] string: introduce memweight

2012-06-04 Thread Jan Kara
Cc: Joel Becker jl...@evilplan.org Cc: ocfs2-de...@oss.oracle.com Cc: Jan Kara j...@suse.cz Cc: linux-e...@vger.kernel.org Cc: Andrew Morton a...@linux-foundation.org Cc: Andreas Dilger adilger.ker...@dilger.ca Cc: Theodore Ts'o ty...@mit.edu Cc: Matthew Wilcox matt...@wil.cx --- v2

Re: [PATCH v2 01/10] string: introduce memweight

2012-06-04 Thread Jan Kara
On Mon 04-06-12 20:46:14, Akinobu Mita wrote: 2012/6/4 Jan Kara j...@suse.cz: On Sat 02-06-12 22:40:07, Akinobu Mita wrote: memweight() is the function that counts the total number of bits set in memory area.  Unlike bitmap_weight(), memweight() takes pointer and size in bytes to specify

[PATCH 05/26] omap3isp: Make isp_video_buffer_prepare_user() use get_user_pages_fast()

2013-10-02 Thread Jan Kara
CC: Laurent Pinchart laurent.pinch...@ideasonboard.com CC: linux-media@vger.kernel.org Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/platform/omap3isp/ispqueue.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/omap3isp/ispqueue.c b

[PATCH 19/26] ivtv: Convert driver to use get_user_pages_unlocked()

2013-10-02 Thread Jan Kara
CC: Andy Walls awa...@md.metrocast.net CC: linux-media@vger.kernel.org Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/pci/ivtv/ivtv-udma.c | 6 ++ drivers/media/pci/ivtv/ivtv-yuv.c | 12 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/media/pci

Re: [PATCH 05/26] omap3isp: Make isp_video_buffer_prepare_user() use get_user_pages_fast()

2013-10-02 Thread Jan Kara
On Wed 02-10-13 21:41:10, Laurent Pinchart wrote: Hi Jan, Thank you for the patch. On Wednesday 02 October 2013 16:27:46 Jan Kara wrote: CC: Laurent Pinchart laurent.pinch...@ideasonboard.com CC: linux-media@vger.kernel.org Signed-off-by: Jan Kara j...@suse.cz Acked-by: Laurent

Re: [PATCH 19/26] ivtv: Convert driver to use get_user_pages_unlocked()

2013-10-07 Thread Jan Kara
get_user_pages_unlocked(), then the patch below looks fine. Reviewed-by: Andy Walls awa...@md.metrocast.net Acked-by: Andy Walls awa...@md.metrocast.net Thanks. Honza On Wed, 2013-10-02 at 16:28 +0200, Jan Kara wrote: CC: Andy Walls awa

Handling of user address in vb2_dc_get_userptr()

2013-10-17 Thread Jan Kara
? Or for on which vmas this code is supposed to work? Thanks in advance for clarification. Honza -- Jan Kara j...@suse.cz SUSE Labs, CR -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord

Handling of VM_IO vma in omap_vout_uservirt_to_phys()

2013-10-17 Thread Jan Kara
this is a generally valid computation for arbitrary VM_IO vma. So do we expect vma to come from a particular source where this is true? If yes, where do we expect vma comes from? Thanks for clarification. Honza -- Jan Kara j...@suse.cz

Re: Handling of VM_IO vma in omap_vout_uservirt_to_phys()

2013-10-18 Thread Jan Kara
On Fri 18-10-13 14:59:17, Archit Taneja wrote: Hi, On Friday 18 October 2013 03:46 AM, Jan Kara wrote: Hello, I was auditing get_user_pages() users and I've noticed that omap_vout_uservirt_to_phys() is apparently called for arbitrary address passed from userspace. If this address

[PATCH 9/9] staging: tidspbridge: Convert to get_vaddr_pfns()

2014-03-17 Thread Jan Kara
Convert the driver to use get_vaddr_pfns() instead of get_user_pages() or a hand made page table walk. This removes knowledge about vmas and mmap_sem locking from the driver. Signed-off-by: Jan Kara j...@suse.cz --- drivers/staging/tidspbridge/core/tiomap3430.c | 261

[PATCH 5/9] media: vb2: Convert vb2_vmalloc_get_userptr() to use pfns vector

2014-03-17 Thread Jan Kara
Convert vb2_vmalloc_get_userptr() to use passed vector of pfns. When we are doing that there's no need to allocate page array and some code can be simplified. Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/v4l2-core/videobuf2-vmalloc.c | 86 +++-- 1 file changed

[PATCH 1/9] mm: Provide new get_vaddr_pfns() helper

2014-03-17 Thread Jan Kara
to VM_IO | VM_PFNMAP vma, we don't touch page structures. Caller should make sure pfns aren't reused for anything else while he is using them. This function is created for various drivers to simplify handling of their buffers. Signed-off-by: Jan Kara j...@suse.cz --- include/linux/mm.h | 46

[RFC] Helper to abstract vma handling in media layer

2014-03-17 Thread Jan Kara
Hello, The following patch series is my first stab at abstracting vma handling from the various media drivers. After this patch set drivers have to know much less details about vmas, their types, and locking. My motivation for the series is that I want to change get_user_pages() locking and I

[PATCH 7/9] media: vb2: Remove unused functions

2014-03-17 Thread Jan Kara
Conversion to the use of pinned pfns made some functions unused. Remove them. Also there's no need to lock mmap_sem in __buf_prepare() anymore. Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/v4l2-core/videobuf2-core.c | 8 +- drivers/media/v4l2-core/videobuf2-memops.c | 114

[PATCH 2/9] media: omap_vout: Convert omap_vout_uservirt_to_phys() to use get_vaddr_pfns()

2014-03-17 Thread Jan Kara
-by: Jan Kara j...@suse.cz --- drivers/media/platform/omap/omap_vout.c | 63 +++-- 1 file changed, 29 insertions(+), 34 deletions(-) diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c index dfd0a21a0658..8c5803e4ce15 100644

[PATCH 8/9] drm/exynos: Convert g2d_userptr_get_dma_addr() to use get_vaddr_pfn()

2014-03-17 Thread Jan Kara
Convert g2d_userptr_get_dma_addr() to pin pages using get_vaddr_pfn(). This removes the knowledge about vmas and mmap_sem locking from exynos driver. Also it fixes a problem that the function has been mapping user provided address without holding mmap_sem. Signed-off-by: Jan Kara j...@suse.cz

[PATCH 3/9] media: vb2: Teach vb2_queue_or_prepare_buf() to get pfns for user buffers

2014-03-17 Thread Jan Kara
Teach vb2_queue_or_prepare_buf() to get pfns underlying these buffers and propagate them down to get_userptr callback. Thus each buffer mapping method doesn't have to get pfns independently. Also this will remove the knowledge about mmap_sem locking from videobuf2 core. Signed-off-by: Jan Kara j

[PATCH 4/9] media: vb2: Convert vb2_dma_sg_get_userptr() to use pinned pfns

2014-03-17 Thread Jan Kara
Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/v4l2-core/videobuf2-dma-sg.c | 85 ++ 1 file changed, 15 insertions(+), 70 deletions(-) diff --git a/drivers/media/v4l2-core/videobuf2-dma-sg.c b/drivers/media/v4l2-core/videobuf2-dma-sg.c index ef0b3f765d8e

[PATCH 6/9] media: vb2: Convert vb2_dc_get_userptr() to use pfns vector

2014-03-17 Thread Jan Kara
Convert vb2_dc_get_userptr() to use passed vector of pfns. When we are doing that there's no need to allocate page array and some code can be simplified. Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/v4l2-core/videobuf2-dma-contig.c | 203 - 1 file changed, 30

Re: [PATCH 1/9] mm: Provide new get_vaddr_pfns() helper

2014-03-18 Thread Jan Kara
On Mon 17-03-14 13:53:35, Dave Hansen wrote: On 03/17/2014 12:49 PM, Jan Kara wrote: +int get_vaddr_pfns(unsigned long start, int nr_pfns, int write, int force, + struct pinned_pfns *pfns) +{ ... + if (!(vma-vm_flags (VM_IO | VM_PFNMAP))) { + pfns-got_ref = 1

Re: [RFC] Helper to abstract vma handling in media layer

2014-04-10 Thread Jan Kara
Hello, On Thu 10-04-14 12:02:50, Marek Szyprowski wrote: On 2014-03-17 20:49, Jan Kara wrote: The following patch series is my first stab at abstracting vma handling from the various media drivers. After this patch set drivers have to know much less details about vmas, their types

Re: [RFC] Helper to abstract vma handling in media layer

2014-04-10 Thread Jan Kara
On Thu 10-04-14 13:07:42, Hans Verkuil wrote: On 04/10/14 12:32, Jan Kara wrote: Hello, On Thu 10-04-14 12:02:50, Marek Szyprowski wrote: On 2014-03-17 20:49, Jan Kara wrote: The following patch series is my first stab at abstracting vma handling from the various media drivers

Re: [RFC] Helper to abstract vma handling in media layer

2014-04-10 Thread Jan Kara
On Thu 10-04-14 14:22:20, Hans Verkuil wrote: On 04/10/14 14:15, Jan Kara wrote: On Thu 10-04-14 13:07:42, Hans Verkuil wrote: On 04/10/14 12:32, Jan Kara wrote: Hello, On Thu 10-04-14 12:02:50, Marek Szyprowski wrote: On 2014-03-17 20:49, Jan Kara wrote: The following patch

Re: [RFC] Helper to abstract vma handling in media layer

2014-04-10 Thread Jan Kara
On Thu 10-04-14 23:57:38, Jan Kara wrote: On Thu 10-04-14 14:22:20, Hans Verkuil wrote: On 04/10/14 14:15, Jan Kara wrote: On Thu 10-04-14 13:07:42, Hans Verkuil wrote: On 04/10/14 12:32, Jan Kara wrote: Hello, On Thu 10-04-14 12:02:50, Marek Szyprowski wrote: On 2014-03-17

Re: [RFC] Helper to abstract vma handling in media layer

2014-04-14 Thread Jan Kara
On Fri 11-04-14 08:58:59, Hans Verkuil wrote: On 04/11/2014 12:18 AM, Jan Kara wrote: On Thu 10-04-14 23:57:38, Jan Kara wrote: On Thu 10-04-14 14:22:20, Hans Verkuil wrote: On 04/10/14 14:15, Jan Kara wrote: On Thu 10-04-14 13:07:42, Hans Verkuil wrote: On 04/10/14 12:32, Jan Kara

Re: [PATCH] videobuf2-core: take mmap_sem before calling __qbuf_userptr

2014-08-22 Thread Jan Kara
On Fri 22-08-14 18:01:09, Hans Verkuil wrote: Commit f035eb4e976ef5a059e30bc91cfd310ff030a7d3 (videobuf2: fix lockdep warning) unfortunately removed the mmap_sem lock that is needed around the call to __qbuf_userptr. Amazingly nobody noticed this until Jan Kara pointed this out to me

Re: [PATCHv2] videobuf2-core: take mmap_sem before calling __qbuf_userptr

2014-08-26 Thread Jan Kara
to __qbuf_userptr. Amazingly nobody noticed this (especially me as the author) until Jan Kara pointed this out to me. Signed-off-by: Hans Verkuil hans.verk...@cisco.com Reported-by: Jan Kara j...@suse.cz The patch looks good to me. You can add: Reviewed-by: Jan Kara j...@suse.cz

[PATCH 2/9] mm: Provide new get_vaddr_pfns() helper

2015-03-17 Thread Jan Kara
to VM_IO | VM_PFNMAP vma, we don't touch page structures. Caller should make sure pfns aren't reused for anything else while he is using them. This function is created for various drivers to simplify handling of their buffers. Signed-off-by: Jan Kara j...@suse.cz --- include/linux/mm.h | 38

[PATCH 0/9 v2] Helper to abstract vma handling in media layer

2015-03-17 Thread Jan Kara
Hello, After a long pause I'm sending second version of my patch series to abstract vma handling from the various media drivers. After this patch set drivers have to know much less details about vmas, their types, and locking. My motivation for the series is that I want to change

[PATCH 8/9] media: vb2: Remove unused functions

2015-03-17 Thread Jan Kara
Conversion to the use of pinned pfns made some functions unused. Remove them. Also there's no need to lock mmap_sem in __buf_prepare() anymore. Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/v4l2-core/videobuf2-memops.c | 114 - include/media/videobuf2

[PATCH 7/9] media: vb2: Convert vb2_dc_get_userptr() to use pfns vector

2015-03-17 Thread Jan Kara
Convert vb2_dc_get_userptr() to use passed vector of pfns. When we are doing that there's no need to allocate page array and some code can be simplified. Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/v4l2-core/videobuf2-dma-contig.c | 213 - 1 file changed, 32

[PATCH 3/9] media: omap_vout: Convert omap_vout_uservirt_to_phys() to use get_vaddr_pfns()

2015-03-17 Thread Jan Kara
-by: Jan Kara j...@suse.cz --- drivers/media/platform/omap/omap_vout.c | 67 +++-- 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c index ba2d8f973d58..e7d342bb71dd 100644

[PATCH 6/9] media: vb2: Convert vb2_vmalloc_get_userptr() to use pfns vector

2015-03-17 Thread Jan Kara
Convert vb2_vmalloc_get_userptr() to use passed vector of pfns. When we are doing that there's no need to allocate page array and some code can be simplified. Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/v4l2-core/videobuf2-vmalloc.c | 94 +++-- 1 file changed

[PATCH 4/9] vb2: Provide helpers for mapping virtual addresses

2015-03-17 Thread Jan Kara
Provide simple helper functions to map virtual address range into an array of pfns. Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/v4l2-core/videobuf2-memops.c | 57 ++ include/media/videobuf2-memops.h | 4 +++ 2 files changed, 61 insertions

Use of mmap_sem in __qbuf_userptr()

2015-03-05 Thread Jan Kara
can prepare patches to do that (and then on top of those rebase patches which will make v4l2 core use some mm helper functions so they don't have to care about details of mm locking, vmas, etc.). Honza -- Jan Kara j...@suse.cz SUSE

Re: [PATCH 0/9 v2] Helper to abstract vma handling in media layer

2015-04-24 Thread Jan Kara
On Fri 24-04-15 13:07:37, Hans Verkuil wrote: Hi Marek, On 04/24/2015 12:59 PM, Marek Szyprowski wrote: Dear All, On 2015-04-02 17:25, Hans Verkuil wrote: On 04/02/2015 05:02 PM, Jan Kara wrote: Hello, On Tue 17-03-15 12:56:30, Jan Kara wrote: After a long pause I'm

Re: [PATCH 1/9] mm: Provide new get_vaddr_pfns() helper

2015-04-24 Thread Jan Kara
On Mon 17-03-14 20:49:28, Jan Kara wrote: Provide new function get_vaddr_pfns(). This function maps virtual addresses from given start and fills given array with page frame numbers of the corresponding pages. If given start belongs to a normal vma, the function grabs reference to each

Re: [PATCH 2/9] mm: Provide new get_vaddr_pfns() helper

2015-05-04 Thread Jan Kara
On Thu 30-04-15 16:55:31, Mel Gorman wrote: On Tue, Mar 17, 2015 at 12:56:32PM +0100, Jan Kara wrote: Provide new function get_vaddr_pfns(). This function maps virtual addresses from given start and fills given array with page frame numbers of the corresponding pages. If given start

[PATCH 5/9] media: vb2: Convert vb2_dma_sg_get_userptr() to use frame vector

2015-05-06 Thread Jan Kara
Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/v4l2-core/videobuf2-dma-sg.c | 97 +- 1 file changed, 15 insertions(+), 82 deletions(-) diff --git a/drivers

[PATCH 9/9] drm/exynos: Convert g2d_userptr_get_dma_addr() to use get_vaddr_frames()

2015-05-06 Thread Jan Kara
Convert g2d_userptr_get_dma_addr() to pin pages using get_vaddr_frames(). This removes the knowledge about vmas and mmap_sem locking from exynos driver. Also it fixes a problem that the function has been mapping user provided address without holding mmap_sem. Signed-off-by: Jan Kara j...@suse.cz

[PATCH 8/9] media: vb2: Remove unused functions

2015-05-06 Thread Jan Kara
Conversion to the use of pinned pfns made some functions unused. Remove them. Also there's no need to lock mmap_sem in __buf_prepare() anymore. Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan Kara j...@suse.cz

[PATCH 6/9] media: vb2: Convert vb2_vmalloc_get_userptr() to use frame vector

2015-05-06 Thread Jan Kara
Convert vb2_vmalloc_get_userptr() to use frame vector infrastructure. When we are doing that there's no need to allocate page array and some code can be simplified. Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan Kara j

[PATCH 1/9] [media] vb2: Push mmap_sem down to memops

2015-05-06 Thread Jan Kara
into .get_userptr and .put_userptr memops so that the semaphore is acquired for a shorter time and it is clearer what it is needed for. Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/v4l2-core/videobuf2-core.c | 2 -- drivers/media/v4l2-core/videobuf2-dma-contig.c | 7 +++ drivers/media

[PATCH 3/9] media: omap_vout: Convert omap_vout_uservirt_to_phys() to use get_vaddr_pfns()

2015-05-06 Thread Jan Kara
-by: Jan Kara j...@suse.cz --- drivers/media/platform/omap/omap_vout.c | 67 +++-- 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c index 17b189a81ec5..d3f6d82ccbc1 100644

[PATCH 4/9] vb2: Provide helpers for mapping virtual addresses

2015-05-06 Thread Jan Kara
Provide simple helper functions to map virtual address range into an array of pfns / pages. Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/v4l2-core/videobuf2-memops.c | 58

[PATCH 0/9 v4] Helper to abstract vma handling in media layer

2015-05-06 Thread Jan Kara
Hello, Sorry for a quick resend but the missing vmalloc include in mm/gup.c is annoying for archs that need it and I was also told to extend CC list a bit. I'm sending the fourth version of my patch series to abstract vma handling from the various media drivers. After this patch set drivers

[PATCH 7/9] media: vb2: Convert vb2_dc_get_userptr() to use frame vector

2015-05-06 Thread Jan Kara
Convert vb2_dc_get_userptr() to use frame vector infrastructure. When we are doing that there's no need to allocate page array and some code can be simplified. Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan Kara j

[PATCH 2/9] mm: Provide new get_vaddr_frames() helper

2015-05-06 Thread Jan Kara
belongs to VM_IO | VM_PFNMAP vma, we don't touch page structures. Caller must make sure pfns aren't reused for anything else while he is using them. This function is created for various drivers to simplify handling of their buffers. Signed-off-by: Jan Kara j...@suse.cz --- include/linux/mm.h | 44

Re: [PATCH 2/9] mm: Provide new get_vaddr_frames() helper

2015-05-11 Thread Jan Kara
On Fri 08-05-15 15:49:22, Mel Gorman wrote: On Wed, May 06, 2015 at 09:28:09AM +0200, Jan Kara wrote: Provide new function get_vaddr_frames(). This function maps virtual addresses from given start and fills given array with page frame numbers of the corresponding pages. If given start

[PATCH 9/9] drm/exynos: Convert g2d_userptr_get_dma_addr() to use get_vaddr_frames()

2015-05-05 Thread Jan Kara
Convert g2d_userptr_get_dma_addr() to pin pages using get_vaddr_frames(). This removes the knowledge about vmas and mmap_sem locking from exynos driver. Also it fixes a problem that the function has been mapping user provided address without holding mmap_sem. Signed-off-by: Jan Kara j...@suse.cz

[PATCH 8/9] media: vb2: Remove unused functions

2015-05-05 Thread Jan Kara
Conversion to the use of pinned pfns made some functions unused. Remove them. Also there's no need to lock mmap_sem in __buf_prepare() anymore. Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan Kara j...@suse.cz

[PATCH 2/9] mm: Provide new get_vaddr_frames() helper

2015-05-05 Thread Jan Kara
belongs to VM_IO | VM_PFNMAP vma, we don't touch page structures. Caller must make sure pfns aren't reused for anything else while he is using them. This function is created for various drivers to simplify handling of their buffers. Signed-off-by: Jan Kara j...@suse.cz --- include/linux/mm.h | 44

[PATCH 6/9] media: vb2: Convert vb2_vmalloc_get_userptr() to use frame vector

2015-05-05 Thread Jan Kara
Convert vb2_vmalloc_get_userptr() to use frame vector infrastructure. When we are doing that there's no need to allocate page array and some code can be simplified. Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan Kara j

[PATCH 1/9] [media] vb2: Push mmap_sem down to memops

2015-05-05 Thread Jan Kara
into .get_userptr and .put_userptr memops so that the semaphore is acquired for a shorter time and it is clearer what it is needed for. Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/v4l2-core/videobuf2-core.c | 2 -- drivers/media/v4l2-core/videobuf2-dma-contig.c | 7 +++ drivers/media

[PATCH 0/9 v3] Helper to abstract vma handling in media layer

2015-05-05 Thread Jan Kara
Hello, I'm sending the third version of my patch series to abstract vma handling from the various media drivers. After this patch set drivers have to know much less details about vmas, their types, and locking. Also quite some code is removed from them. As a bonus drivers get automatically

[PATCH 3/9] media: omap_vout: Convert omap_vout_uservirt_to_phys() to use get_vaddr_pfns()

2015-05-05 Thread Jan Kara
-by: Jan Kara j...@suse.cz --- drivers/media/platform/omap/omap_vout.c | 67 +++-- 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c index 17b189a81ec5..d3f6d82ccbc1 100644

[PATCH 4/9] vb2: Provide helpers for mapping virtual addresses

2015-05-05 Thread Jan Kara
Provide simple helper functions to map virtual address range into an array of pfns / pages. Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/v4l2-core/videobuf2-memops.c | 58

[PATCH 5/9] media: vb2: Convert vb2_dma_sg_get_userptr() to use frame vector

2015-05-05 Thread Jan Kara
Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/v4l2-core/videobuf2-dma-sg.c | 97 +- 1 file changed, 15 insertions(+), 82 deletions(-) diff --git a/drivers

[PATCH 7/9] media: vb2: Convert vb2_dc_get_userptr() to use frame vector

2015-05-05 Thread Jan Kara
Convert vb2_dc_get_userptr() to use frame vector infrastructure. When we are doing that there's no need to allocate page array and some code can be simplified. Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan Kara j

Re: [PATCH 9/9] drm/exynos: Convert g2d_userptr_get_dma_addr() to use get_vaddr_frames()

2015-05-06 Thread Jan Kara
On Wed 06-05-15 12:47:35, Vlastimil Babka wrote: On 05/06/2015 09:28 AM, Jan Kara wrote: Convert g2d_userptr_get_dma_addr() to pin pages using get_vaddr_frames(). This removes the knowledge about vmas and mmap_sem locking from exynos driver. Also it fixes a problem that the function has been

Re: [PATCH 2/9] mm: Provide new get_vaddr_frames() helper

2015-05-06 Thread Jan Kara
On Wed 06-05-15 12:45:51, Vlastimil Babka wrote: On 05/06/2015 09:28 AM, Jan Kara wrote: Provide new function get_vaddr_frames(). This function maps virtual addresses from given start and fills given array with page frame numbers of the corresponding pages. If given start belongs to a normal

Re: [PATCH 3/9] media: omap_vout: Convert omap_vout_uservirt_to_phys() to use get_vaddr_pfns()

2015-05-06 Thread Jan Kara
On Wed 06-05-15 12:46:42, Vlastimil Babka wrote: On 05/06/2015 09:28 AM, Jan Kara wrote: Convert omap_vout_uservirt_to_phys() to use get_vaddr_pfns() instead of hand made mapping of virtual address to physical address. Also the function leaked page reference from get_user_pages() so fix

[PATCH 0/9 v5] Helper to abstract vma handling in media layer

2015-05-13 Thread Jan Kara
Hello, I'm sending the fifth version of my patch series to abstract vma handling from the various media drivers. The patches got some review from mm people and testing from device driver guys so unless someone objects, patches will be queued in media tree for the next merge window. After this

[PATCH 6/9] media: vb2: Convert vb2_vmalloc_get_userptr() to use frame vector

2015-05-13 Thread Jan Kara
Convert vb2_vmalloc_get_userptr() to use frame vector infrastructure. When we are doing that there's no need to allocate page array and some code can be simplified. Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan Kara j

[PATCH 5/9] media: vb2: Convert vb2_dma_sg_get_userptr() to use frame vector

2015-05-13 Thread Jan Kara
Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/v4l2-core/videobuf2-dma-sg.c | 97 +- 1 file changed, 15 insertions(+), 82 deletions(-) diff --git a/drivers

[PATCH 7/9] media: vb2: Convert vb2_dc_get_userptr() to use frame vector

2015-05-13 Thread Jan Kara
Convert vb2_dc_get_userptr() to use frame vector infrastructure. When we are doing that there's no need to allocate page array and some code can be simplified. Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan Kara j

[PATCH 8/9] media: vb2: Remove unused functions

2015-05-13 Thread Jan Kara
Conversion to the use of pinned pfns made some functions unused. Remove them. Also there's no need to lock mmap_sem in __buf_prepare() anymore. Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan Kara j...@suse.cz

[PATCH 2/9] mm: Provide new get_vaddr_frames() helper

2015-05-13 Thread Jan Kara
...@suse.cz Signed-off-by: Jan Kara j...@suse.cz --- include/linux/mm.h | 44 +++ mm/gup.c | 226 + 2 files changed, 270 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 0755b9fd03a7..dcd1f02a78e9 100644

[PATCH 9/9] drm/exynos: Convert g2d_userptr_get_dma_addr() to use get_vaddr_frames()

2015-05-13 Thread Jan Kara
Convert g2d_userptr_get_dma_addr() to pin pages using get_vaddr_frames(). This removes the knowledge about vmas and mmap_sem locking from exynos driver. Also it fixes a problem that the function has been mapping user provided address without holding mmap_sem. Signed-off-by: Jan Kara j...@suse.cz

[PATCH 4/9] vb2: Provide helpers for mapping virtual addresses

2015-05-13 Thread Jan Kara
Provide simple helper functions to map virtual address range into an array of pfns / pages. Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/v4l2-core/videobuf2-memops.c | 58

[PATCH 3/9] media: omap_vout: Convert omap_vout_uservirt_to_phys() to use get_vaddr_pfns()

2015-05-13 Thread Jan Kara
-by: Jan Kara j...@suse.cz --- drivers/media/platform/omap/omap_vout.c | 67 +++-- 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c index 17b189a81ec5..0e4b3cfacc5d 100644

[PATCH 1/9] [media] vb2: Push mmap_sem down to memops

2015-05-13 Thread Jan Kara
into .get_userptr and .put_userptr memops so that the semaphore is acquired for a shorter time and it is clearer what it is needed for. Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/v4l2-core/videobuf2-core.c | 2 -- drivers/media/v4l2-core/videobuf2-dma-contig.c | 7 +++ drivers/media

Re: [PATCH 9/9] drm/exynos: Convert g2d_userptr_get_dma_addr() to use get_vaddr_frames()

2015-05-14 Thread Jan Kara
On Thu 14-05-15 19:51:23, Inki Dae wrote: Hi, On 2015년 05월 13일 22:08, Jan Kara wrote: Convert g2d_userptr_get_dma_addr() to pin pages using get_vaddr_frames(). This removes the knowledge about vmas and mmap_sem locking from exynos driver. Also it fixes a problem that the function has

Re: [PATCH 0/9 v2] Helper to abstract vma handling in media layer

2015-04-02 Thread Jan Kara
Hello, On Tue 17-03-15 12:56:30, Jan Kara wrote: After a long pause I'm sending second version of my patch series to abstract vma handling from the various media drivers. After this patch set drivers have to know much less details about vmas, their types, and locking. My motivation

Re: [PATCH 2/9] mm: Provide new get_vaddr_frames() helper

2015-06-03 Thread Jan Kara
On Tue 02-06-15 15:29:12, Andrew Morton wrote: On Tue, 2 Jun 2015 17:23:00 +0200 Jan Kara j...@suse.cz wrote: That's a lump of new code which many kernels won't be needing. Can we put all this in a new .c file and select it within drivers/media Kconfig? So the attached patch

Re: [PATCH 9/9] [media] mm: Move get_vaddr_frames() behind a config option

2015-06-18 Thread Jan Kara
On Wed 10-06-15 09:37:20, Josh Triplett wrote: On Wed, Jun 10, 2015 at 06:20:52AM -0300, Mauro Carvalho Chehab wrote: From: Jan Kara j...@suse.cz get_vaddr_frames() is used by relatively rare drivers so hide it and the related functions behind a config option that is selected only

Re: [PATCH] Revert [media] vb2: Push mmap_sem down to memops

2015-06-18 Thread Jan Kara
On Thu 18-06-15 12:45:26, Hans Verkuil wrote: On 06/18/2015 12:33 PM, Jan Kara wrote: On Mon 15-06-15 09:24:55, Hans Verkuil wrote: This reverts commit 48b25a3a713b90988b6882d318f7c0a6bed9aabc. That commit caused two regressions. The first is a BUG: BUG: unable to handle kernel NULL

[PATCH 8/10] media: vb2: Remove unused functions

2015-06-18 Thread Jan Kara
Conversion to the use of pinned pfns made some functions unused. Remove them. Also there's no need to lock mmap_sem in __buf_prepare() anymore. Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan Kara j...@suse.cz

[PATCH 5/10] media: vb2: Convert vb2_dma_sg_get_userptr() to use frame vector

2015-06-18 Thread Jan Kara
Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/v4l2-core/videobuf2-dma-sg.c | 95 +- 1 file changed, 15 insertions(+), 80 deletions(-) diff --git a/drivers

[PATCH 10/10] mm: Move get_vaddr_frames() behind a config option

2015-06-18 Thread Jan Kara
98 - -98 get_vaddr_frames 485 --485 Suggested-by: Andrew Morton a...@linux-foundation.org Signed-off-by: Jan Kara j...@suse.cz --- drivers/gpu/drm/exynos/Kconfig | 1 + drivers/media/platform/omap/Kconfig | 1

[PATCH 3/10] media: omap_vout: Convert omap_vout_uservirt_to_phys() to use get_vaddr_pfns()

2015-06-18 Thread Jan Kara
-by: Jan Kara j...@suse.cz --- drivers/media/platform/omap/omap_vout.c | 67 +++-- 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c index 17b189a81ec5..0e4b3cfacc5d 100644

[PATCH 6/10] media: vb2: Convert vb2_vmalloc_get_userptr() to use frame vector

2015-06-18 Thread Jan Kara
Convert vb2_vmalloc_get_userptr() to use frame vector infrastructure. When we are doing that there's no need to allocate page array and some code can be simplified. Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan Kara j

[PATCH 7/10] media: vb2: Convert vb2_dc_get_userptr() to use frame vector

2015-06-18 Thread Jan Kara
Convert vb2_dc_get_userptr() to use frame vector infrastructure. When we are doing that there's no need to allocate page array and some code can be simplified. Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan Kara j

[PATCH 1/10] [media] vb2: Push mmap_sem down to memops

2015-06-18 Thread Jan Kara
resolved once we convert videobuf2 core to the new mm helper which avoids the need for mmap_sem in .put_userptr memop altogether. Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/v4l2-core/videobuf2-core.c | 2 -- drivers/media/v4l2-core/videobuf2-dma-contig.c | 5 + drivers/media/v4l2

[PATCH 9/10] drm/exynos: Convert g2d_userptr_get_dma_addr() to use get_vaddr_frames()

2015-06-18 Thread Jan Kara
Convert g2d_userptr_get_dma_addr() to pin pages using get_vaddr_frames(). This removes the knowledge about vmas and mmap_sem locking from exynos driver. Also it fixes a problem that the function has been mapping user provided address without holding mmap_sem. Signed-off-by: Jan Kara j...@suse.cz

[PATCH 0/10 v6] Helper to abstract vma handling in media layer

2015-06-18 Thread Jan Kara
Hello, I'm sending the sixth version of my patch series to abstract vma handling from the various media drivers. Since the previous version I have added a patch to move mm helpers into a separate file and behind a config option. I also changed patch pushing mmap_sem down in videobuf2 core to

[PATCH 4/10] vb2: Provide helpers for mapping virtual addresses

2015-06-18 Thread Jan Kara
Provide simple helper functions to map virtual address range into an array of pfns / pages. Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan Kara j...@suse.cz --- drivers/media/v4l2-core/videobuf2-memops.c | 58

[PATCH 2/10] mm: Provide new get_vaddr_frames() helper

2015-06-18 Thread Jan Kara
...@suse.cz Signed-off-by: Jan Kara j...@suse.cz --- include/linux/mm.h | 44 +++ mm/gup.c | 223 + 2 files changed, 267 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 0755b9fd03a7..dcd1f02a78e9 100644

Re: [git:media_tree/master] [media] vb2: Push mmap_sem down to memops

2015-06-18 Thread Jan Kara
, Mauro Carvalho Chehab wrote: This is an automatic generated email to let you know that the following patch were queued at the http://git.linuxtv.org/cgit.cgi/media_tree.git tree: Subject: [media] vb2: Push mmap_sem down to memops Author: Jan Kara j...@suse.cz Date:Tue Mar 17

Re: [PATCH] Revert [media] vb2: Push mmap_sem down to memops

2015-06-18 Thread Jan Kara
. Without this patch I cannot reproduce these two issues. So reverting is the best solution for now. Signed-off-by: Hans Verkuil hans.verk...@cisco.com Cc: Jan Kara j...@suse.cz Cc: Andrew Morton a...@linux-foundation.org --- drivers/media/v4l2-core/videobuf2-core.c | 2

Re: [PATCH 2/9] mm: Provide new get_vaddr_frames() helper

2015-06-01 Thread Jan Kara
On Thu 28-05-15 16:24:02, Andrew Morton wrote: On Wed, 13 May 2015 15:08:08 +0200 Jan Kara j...@suse.cz wrote: Provide new function get_vaddr_frames(). This function maps virtual addresses from given start and fills given array with page frame numbers of the corresponding pages. If given

Re: [PATCH 2/9] mm: Provide new get_vaddr_frames() helper

2015-06-02 Thread Jan Kara
On Thu 28-05-15 16:24:02, Andrew Morton wrote: On Wed, 13 May 2015 15:08:08 +0200 Jan Kara j...@suse.cz wrote: Provide new function get_vaddr_frames(). This function maps virtual addresses from given start and fills given array with page frame numbers of the corresponding pages. If given

Re: [PATCH 0/9 v5] Helper to abstract vma handling in media layer

2015-05-25 Thread Jan Kara
On Mon 25-05-15 13:37:56, Hans Verkuil wrote: Hi Jan, On 05/13/2015 03:08 PM, Jan Kara wrote: Hello, I'm sending the fifth version of my patch series to abstract vma handling from the various media drivers. The patches got some review from mm people and testing from device

Re: [PATCH 9/9] drm/exynos: Convert g2d_userptr_get_dma_addr() to use get_vaddr_frames()

2015-07-21 Thread Jan Kara
On Sat 18-07-15 12:14:12, Inki Dae wrote: On 2015년 07월 17일 19:31, Hans Verkuil wrote: On 07/17/2015 12:29 PM, Inki Dae wrote: On 2015년 07월 17일 19:20, Hans Verkuil wrote: On 07/13/2015 04:55 PM, Jan Kara wrote: From: Jan Kara j...@suse.cz Convert g2d_userptr_get_dma_addr() to pin pages

[PATCH 3/9] media: omap_vout: Convert omap_vout_uservirt_to_phys() to use get_vaddr_pfns()

2015-07-13 Thread Jan Kara
From: Jan Kara j...@suse.cz Convert omap_vout_uservirt_to_phys() to use get_vaddr_pfns() instead of hand made mapping of virtual address to physical address. Also the function leaked page reference from get_user_pages() so fix that by properly release the reference when omap_vout_buffer_release

Re: [PATCH 0/10 v6] Helper to abstract vma handling in media layer

2015-07-13 Thread Jan Kara
On Mon 13-07-15 10:45:25, Hans Verkuil wrote: On 07/09/2015 02:12 PM, Hans Verkuil wrote: On 07/09/2015 01:48 PM, Jan Kara wrote: Hello, Hans, did you have a chance to look at these patches? I have tested them with the vivid driver but it would be good if you could run them through

[PATCH 7/9] media: vb2: Convert vb2_dc_get_userptr() to use frame vector

2015-07-13 Thread Jan Kara
From: Jan Kara j...@suse.cz Convert vb2_dc_get_userptr() to use frame vector infrastructure. When we are doing that there's no need to allocate page array and some code can be simplified. Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com

[PATCH 8/9] media: vb2: Remove unused functions

2015-07-13 Thread Jan Kara
From: Jan Kara j...@suse.cz Conversion to the use of pinned pfns made some functions unused. Remove them. Also there's no need to lock mmap_sem in __buf_prepare() anymore. Acked-by: Marek Szyprowski m.szyprow...@samsung.com Tested-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Jan

  1   2   >