From patchwork Sun Nov 3 21:18:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 11224573 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 090B21599 for ; Sun, 3 Nov 2019 21:19:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DC0B921A4A for ; Sun, 3 Nov 2019 21:19:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="LbzQnOLk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728590AbfKCVS0 (ORCPT ); Sun, 3 Nov 2019 16:18:26 -0500 Received: from hqemgate16.nvidia.com ([216.228.121.65]:10680 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728475AbfKCVSX (ORCPT ); Sun, 3 Nov 2019 16:18:23 -0500 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Sun, 03 Nov 2019 13:18:23 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Sun, 03 Nov 2019 13:18:17 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Sun, 03 Nov 2019 13:18:17 -0800 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sun, 3 Nov 2019 21:18:17 +0000 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Sun, 3 Nov 2019 21:18:17 +0000 Received: from blueforge.nvidia.com (Not Verified[10.110.48.28]) by hqnvemgw01.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Sun, 03 Nov 2019 13:18:16 -0800 From: John Hubbard To: Andrew Morton CC: Al Viro , Alex Williamson , Benjamin Herrenschmidt , =?utf-8?b?QmrDtnJuIFQ=?= =?utf-8?b?w7ZwZWw=?= , Christoph Hellwig , Dan Williams , Daniel Vetter , Dave Chinner , David Airlie , "David S . Miller" , Ira Weiny , Jan Kara , Jason Gunthorpe , Jens Axboe , Jonathan Corbet , =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , Magnus Karlsson , Mauro Carvalho Chehab , Michael Ellerman , Michal Hocko , Mike Kravetz , Paul Mackerras , Shuah Khan , Vlastimil Babka , , , , , , , , , , , , , LKML , John Hubbard Subject: [PATCH v2 09/18] drm/via: set FOLL_PIN via pin_user_pages_fast() Date: Sun, 3 Nov 2019 13:18:04 -0800 Message-ID: <20191103211813.213227-10-jhubbard@nvidia.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191103211813.213227-1-jhubbard@nvidia.com> References: <20191103211813.213227-1-jhubbard@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1572815903; bh=i/Wb1Kr/GtFKW09o1CGyXJmESv8xkTdGlSb36eVf1P4=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:X-NVConfidentiality: Content-Transfer-Encoding:Content-Type; b=LbzQnOLkIxia6sqVJMWzLNzDLLAWy3uOBnWEAj5cqYHXGYMFHj7B2tA5HckZN4dXW 7FXbfV4NDWR+s6foLfmhClf7v0HbM49yvf7v4/KgWWIOvgUIfnkyrUxr1TMadIPJiR xFai7IsGtCck2KyDc+A/P4K8ahcxjCRTUblLnHP2yVtANl0Vbu0C/+1PiApaw/MIfv Of7FD5mkCzH8F5d2ZKuZjcqhCMxXm/FBxu0u+J5hW8neyBAftHVRq7ezTBopcjaVjW u2o2sNUU2nXDt77cZ4Fe/chV/1TYSfqgoMJkxQZ9MKm7w5bOWD8m1H6a3DSerxeCCR uFe8ttMgWeAnA== Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Convert drm/via to use the new pin_user_pages_fast() call, which sets FOLL_PIN. Setting FOLL_PIN is now required for code that requires tracking of pinned pages, and therefore for any code that calls put_user_page(). Reviewed-by: Ira Weiny Signed-off-by: John Hubbard Reviewed-by: Jérôme Glisse --- drivers/gpu/drm/via/via_dmablit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/via/via_dmablit.c b/drivers/gpu/drm/via/via_dmablit.c index 3db000aacd26..37c5e572993a 100644 --- a/drivers/gpu/drm/via/via_dmablit.c +++ b/drivers/gpu/drm/via/via_dmablit.c @@ -239,7 +239,7 @@ via_lock_all_dma_pages(drm_via_sg_info_t *vsg, drm_via_dmablit_t *xfer) vsg->pages = vzalloc(array_size(sizeof(struct page *), vsg->num_pages)); if (NULL == vsg->pages) return -ENOMEM; - ret = get_user_pages_fast((unsigned long)xfer->mem_addr, + ret = pin_user_pages_fast((unsigned long)xfer->mem_addr, vsg->num_pages, vsg->direction == DMA_FROM_DEVICE ? FOLL_WRITE : 0, vsg->pages);