From: Jan Kara <jack@suse.cz>
To: Andy Walls <awalls@md.metrocast.net>
Cc: Jan Kara <jack@suse.cz>, LKML <linux-kernel@vger.kernel.org>,
linux-mm@kvack.org, linux-media@vger.kernel.org
Subject: Re: [PATCH 19/26] ivtv: Convert driver to use get_user_pages_unlocked()
Date: Mon, 7 Oct 2013 19:22:24 +0200 [thread overview]
Message-ID: <20131007172224.GC30441@quack.suse.cz> (raw)
In-Reply-To: <1380974541.1905.12.camel@palomino.walls.org>
Hello,
On Sat 05-10-13 08:02:21, Andy Walls wrote:
> <rant>
> This patch alone does not have suffcient information for me to evaluate
> it. get_user_pages_unlocked() is added in another patch which I did not
> receive, and which I cannot find in any list archives.
>
> I wasted quite a bit of time looking for this additional patch:
>
> https://git.kernel.org/cgit/linux/kernel/git/jack/linux-fs.git/commit/?h=get_user_pages&id=624fc1bfb70fb65d32d31fbd16427ad9c234653e
>
> </rant>
Sorry, I should have CCed that patch to driver maintainers as well.
> If I found the correct patch for adding get_user_pages_unlocked(), then
> the patch below looks fine.
>
> Reviewed-by: Andy Walls <awalls@md.metrocast.net>
> Acked-by: Andy Walls <awalls@md.metrocast.net>
Thanks.
Honza
> On Wed, 2013-10-02 at 16:28 +0200, Jan Kara wrote:
> > CC: Andy Walls <awalls@md.metrocast.net>
> > CC: linux-media@vger.kernel.org
> > Signed-off-by: Jan Kara <jack@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/ivtv/ivtv-udma.c b/drivers/media/pci/ivtv/ivtv-udma.c
> > index 7338cb2d0a38..6012e5049076 100644
> > --- a/drivers/media/pci/ivtv/ivtv-udma.c
> > +++ b/drivers/media/pci/ivtv/ivtv-udma.c
> > @@ -124,10 +124,8 @@ int ivtv_udma_setup(struct ivtv *itv, unsigned long ivtv_dest_addr,
> > }
> >
> > /* Get user pages for DMA Xfer */
> > - down_read(¤t->mm->mmap_sem);
> > - err = get_user_pages(current, current->mm,
> > - user_dma.uaddr, user_dma.page_count, 0, 1, dma->map, NULL);
> > - up_read(¤t->mm->mmap_sem);
> > + err = get_user_pages_unlocked(current, current->mm, user_dma.uaddr,
> > + user_dma.page_count, 0, 1, dma->map);
> >
> > if (user_dma.page_count != err) {
> > IVTV_DEBUG_WARN("failed to map user pages, returned %d instead of %d\n",
> > diff --git a/drivers/media/pci/ivtv/ivtv-yuv.c b/drivers/media/pci/ivtv/ivtv-yuv.c
> > index 2ad65eb29832..9365995917d8 100644
> > --- a/drivers/media/pci/ivtv/ivtv-yuv.c
> > +++ b/drivers/media/pci/ivtv/ivtv-yuv.c
> > @@ -75,15 +75,15 @@ static int ivtv_yuv_prep_user_dma(struct ivtv *itv, struct ivtv_user_dma *dma,
> > ivtv_udma_get_page_info (&uv_dma, (unsigned long)args->uv_source, 360 * uv_decode_height);
> >
> > /* Get user pages for DMA Xfer */
> > - down_read(¤t->mm->mmap_sem);
> > - y_pages = get_user_pages(current, current->mm, y_dma.uaddr, y_dma.page_count, 0, 1, &dma->map[0], NULL);
> > + y_pages = get_user_pages_unlocked(current, current->mm, y_dma.uaddr,
> > + y_dma.page_count, 0, 1, &dma->map[0]);
> > uv_pages = 0; /* silence gcc. value is set and consumed only if: */
> > if (y_pages == y_dma.page_count) {
> > - uv_pages = get_user_pages(current, current->mm,
> > - uv_dma.uaddr, uv_dma.page_count, 0, 1,
> > - &dma->map[y_pages], NULL);
> > + uv_pages = get_user_pages_unlocked(current, current->mm,
> > + uv_dma.uaddr,
> > + uv_dma.page_count, 0, 1,
> > + &dma->map[y_pages]);
> > }
> > - up_read(¤t->mm->mmap_sem);
> >
> > if (y_pages != y_dma.page_count || uv_pages != uv_dma.page_count) {
> > int rc = -EFAULT;
>
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
prev parent reply other threads:[~2013-10-07 17:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1380724087-13927-1-git-send-email-jack@suse.cz>
2013-10-02 14:27 ` [PATCH 05/26] omap3isp: Make isp_video_buffer_prepare_user() use get_user_pages_fast() Jan Kara
2013-10-02 19:41 ` Laurent Pinchart
2013-10-02 20:18 ` Jan Kara
2013-10-02 14:28 ` [PATCH 19/26] ivtv: Convert driver to use get_user_pages_unlocked() Jan Kara
2013-10-05 12:02 ` Andy Walls
2013-10-07 17:22 ` Jan Kara [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131007172224.GC30441@quack.suse.cz \
--to=jack@suse.cz \
--cc=awalls@md.metrocast.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox