Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11040687ybi; Thu, 25 Jul 2019 09:00:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1Kj8AJsg39/tPs/rTHYg/9LH5ygONwpUR3T2TW9aDcF8Mm0wzEIx2vbB96bYbwD7CP4SX X-Received: by 2002:a62:fc0a:: with SMTP id e10mr17379328pfh.114.1564070403724; Thu, 25 Jul 2019 09:00:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564070403; cv=none; d=google.com; s=arc-20160816; b=WV9kqcEENJaSgpLBa/PFvc/hQh10bYufjKS5K5F7qsJIqexGHox3CP9XVZ8y22lXC2 YFqxCDBre2qFFQhomEEd91Wb+TN7mpw0DNS4SA0P7yEwNsvSr3CTXqxgTb7f91HICy++ 3EPF/OHoQMO98V9tQoOLQVyjhY4pwmmP+5oxIIHk4Eff35ylVjHBnJcrAviy2fEKMVEw A4l3500dmuC9o6xUHRyYE/6yNqFwDlide4zwDwQ5+aOX32x7OWfNctxjYkwdDjeVJNIB rrbGAuUsxSW6RkfX7QZNA+Ga6S8W9yapUonawPw9sNn5STODe0HJuf75LAxlXXAoX/ov QtWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=klRhFLpte1KchUs1v6ORtOt2UGfuuoLAokCZh07v6dk=; b=ppsqoC1NeQpsqbCanUZXtZ15aAFn4OFMFOBj0yzgXbsGfC1Hp6rfa0MQmT0A+82Tth q0va4mqHRK+f1i31BXGeXtPyjssK9VYTvTMWBxqjjt/Tu0h6jnQ+sADcrHvDza0n6Dbx YhhNmsPwB1VhtM8/njk8k+R6tCpEkJsxvIpfT4qPhA9e87N9jqh3/blWKbzVq3AERNgc 8gpi1Qp7l2OOtDFo/QLgXUtHdyTGNZZoukfUXFUxlrO9jj66aZtpxHGsXbUnaj2HWd85 7WnOLHN9lqhXWKnt1k8W7wCFyGdmFQszU6T4P+GdI2waWBfDNHbCqmid71rIc0710Q98 nHCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=velcbiV1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s17si16584715pfc.237.2019.07.25.08.59.45; Thu, 25 Jul 2019 09:00:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=velcbiV1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388433AbfGYHqk (ORCPT + 99 others); Thu, 25 Jul 2019 03:46:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:52248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388187AbfGYHqj (ORCPT ); Thu, 25 Jul 2019 03:46:39 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 727952081B; Thu, 25 Jul 2019 07:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564040797; bh=4UcEQNmlJvi9gGhfQJufu+mVSE9Yfv6XMx4Zl1E3xJc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=velcbiV1Wy/WrI//kr6s+Z4iop+NiwHmNkPl/NPAOSBXjfLXcnUF03lIE5FQ+nGOl Zm1qmFvGNR0CqIiByLLBJjaGlw86qt4T/3foSXAIO80HGhsLDLYxragd68iJeRVWg0 e/VP1qAQVs9nypLg06ZnCBFTK5hbGnoJo/MMwtS8= Date: Thu, 25 Jul 2019 09:46:34 +0200 From: Greg KH To: Bharath Vedartham Cc: ira.weiny@intel.com, jglisse@redhat.com, Matt.Sickler@daktronics.com, jhubbard@nvidia.com, devel@driverdev.osuosl.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] staging: kpc2000: Convert put_page to put_user_page*() Message-ID: <20190725074634.GB15090@kroah.com> References: <20190720173214.GA4250@bharath12345-Inspiron-5559> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190720173214.GA4250@bharath12345-Inspiron-5559> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 20, 2019 at 11:02:14PM +0530, Bharath Vedartham wrote: > For pages that were retained via get_user_pages*(), release those pages > via the new put_user_page*() routines, instead of via put_page(). > > This is part a tree-wide conversion, as described in commit fc1d8e7cca2d ("mm: introduce put_user_page*(), placeholder versions"). Please line-wrap this line. > > Cc: Ira Weiny > Cc: John Hubbard > Cc: J?r?me Glisse > Cc: Greg Kroah-Hartman > Cc: Matt Sickler > Cc: devel@driverdev.osuosl.org > Cc: linux-kernel@vger.kernel.org > Cc: linux-mm@kvack.org > Reviewed-by: John Hubbard > Signed-off-by: Bharath Vedartham > --- > Changes since v1 > - Improved changelog by John's suggestion. > - Moved logic to dirty pages below sg_dma_unmap > and removed PageReserved check. > Changes since v2 > - Added back PageResevered check as suggested by John Hubbard. > Changes since v3 > - Changed the commit log as suggested by John. > - Added John's Reviewed-By tag > > --- > drivers/staging/kpc2000/kpc_dma/fileops.c | 17 ++++++----------- > 1 file changed, 6 insertions(+), 11 deletions(-) > > diff --git a/drivers/staging/kpc2000/kpc_dma/fileops.c b/drivers/staging/kpc2000/kpc_dma/fileops.c > index 6166587..75ad263 100644 > --- a/drivers/staging/kpc2000/kpc_dma/fileops.c > +++ b/drivers/staging/kpc2000/kpc_dma/fileops.c > @@ -198,9 +198,7 @@ int kpc_dma_transfer(struct dev_private_data *priv, struct kiocb *kcb, unsigned > sg_free_table(&acd->sgt); > err_dma_map_sg: > err_alloc_sg_table: > - for (i = 0 ; i < acd->page_count ; i++){ > - put_page(acd->user_pages[i]); > - } > + put_user_pages(acd->user_pages, acd->page_count); > err_get_user_pages: > kfree(acd->user_pages); > err_alloc_userpages: > @@ -221,16 +219,13 @@ void transfer_complete_cb(struct aio_cb_data *acd, size_t xfr_count, u32 flags) > > dev_dbg(&acd->ldev->pldev->dev, "transfer_complete_cb(acd = [%p])\n", acd); > > - for (i = 0 ; i < acd->page_count ; i++){ > - if (!PageReserved(acd->user_pages[i])){ > - set_page_dirty(acd->user_pages[i]); > - } > - } > - > dma_unmap_sg(&acd->ldev->pldev->dev, acd->sgt.sgl, acd->sgt.nents, acd->ldev->dir); > > - for (i = 0 ; i < acd->page_count ; i++){ > - put_page(acd->user_pages[i]); > + for (i = 0; i < acd->page_count; i++) { > + if (!PageReserved(acd->user_pages[i])) > + put_user_pages_dirty(&acd->user_pages[i], 1); > + else > + put_user_page(acd->user_pages[i]); > } > > sg_free_table(&acd->sgt); > -- > 2.7.4 This patch can not be applied at all :( Can you redo it against the latest staging-next branch and resend? thanks, greg k-h