Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4638809ybg; Mon, 8 Jun 2020 13:01:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9vmJooglATwTxyiEskrlhsQPhhu5Uri7YL8W6/Wm0cDxpfmhWxTg2fJnmHbnwWEfMAy68 X-Received: by 2002:a17:907:369:: with SMTP id rs9mr14833159ejb.187.1591646476340; Mon, 08 Jun 2020 13:01:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591646476; cv=none; d=google.com; s=arc-20160816; b=RAx27mOvbD5GvIBeTug63KYwRT5mZOyXHyTMqkYzS7cEm8P+/KW0N3//8UB0JTGmYG OLk+Rm/i3o2FHJ1oRMWjFpg4AYoIjOgFAh+M9yf3nsBRH4evbRXEhXwe6s3Xkz28nxlj ny36AAWdLrgUMBe9nR98d3e+sXruZtmT8VCnSR91LqSwkkZklGqosS6qPOsCTt6ZHAwJ m/D9ANIMn66zY5AhJ73l6AHdZcQXk+OgjA3V/CyW6WNBKTDsbJReImFra0B0xTuWn5UZ BC1H5bxgY1AMJsgXbfwsLbVRXJGHLr51SIrbCn8sfsKsngUuF/Ml/3UhZew5ufUdU/M+ HZtg== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=KDFjcWm9j7Q4j8SV51GuXqHkSHKfdCAlDd8oZwlZJUU=; b=KbaHROfCrcsYcHbQTUC/q/mzSiPLAWfg8W/Guv6JPe9a2+mJIzM3QFhRBhSPOS0/Rg 3oFU+76gBXSiiFGug7x7acp0beLz/tJNWnmdA27hcg3G54sIN4lJBuEWhOeIsjXMfmFJ qfcrOiUHVpvEmxEIIjM3kcv+0ZwjDIHjcpq50fxPkea5k4LCQH2cjvHWYMO2VeF+cMVw 9ITClzSb//zheDctSIUft3seCXf6p159RrEu2PBOksGz60DgFg/dOvUlJn6m4wKspttX tMSFu5V9x2d7OFcVWcmZFg3gf8ouDN0/Y4BGkp+rohsFJd3zC1Uu5xjknsx50PK2nEc4 zE4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=gZsTvqRs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds17si11583233ejc.619.2020.06.08.13.00.51; Mon, 08 Jun 2020 13:01:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=gZsTvqRs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726558AbgFHT5i (ORCPT + 99 others); Mon, 8 Jun 2020 15:57:38 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:57986 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726212AbgFHT5h (ORCPT ); Mon, 8 Jun 2020 15:57:37 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 058JqQeF116937; Mon, 8 Jun 2020 19:57:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=KDFjcWm9j7Q4j8SV51GuXqHkSHKfdCAlDd8oZwlZJUU=; b=gZsTvqRsizIQv9Mzkcr+RseyRpK3il3RRv9/9k8lzK42626sp7VrkybGtYtNxvzIccLq vipb0Wtj7op1BhCJjlIp9qFscdQlJE1EOU5jlis2mlbLzdN9r3LAY16jtlvhGlSF+qz7 Vym2RtTw7hjIPKiauZMVc2hvuFPojcAsqfgHjHdau5LbihbjtnTNiuXAlSlUE28WDdX0 Y+PMcNNSjD2qA2PJpL0FXqWOCDAq2tNmBKDJihAALw9zheMBlgbfl65iBpkIL0IWO1hM Xxq2HXeBZ11ImUTaCnEi3hcGvLtPhvV+Yw6ZEWbY/cClkQ+1MzusFDbCnuvMOkk2hST7 Bw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 31g3smrp1w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 08 Jun 2020 19:57:30 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 058JsJHo017653; Mon, 8 Jun 2020 19:55:29 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 31gn23sput-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Jun 2020 19:55:29 +0000 Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 058JtSb7014764; Mon, 8 Jun 2020 19:55:28 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Jun 2020 12:55:28 -0700 Date: Mon, 8 Jun 2020 22:55:21 +0300 From: Dan Carpenter To: Souptick Joarder Cc: "open list:ANDROID DRIVERS" , Bharath Vedartham , harshjain32@gmail.com, John Hubbard , Simon =?iso-8859-1?Q?Sandstr=F6m?= , linux-kernel@vger.kernel.org, Greg KH , jane.pnx9@gmail.com Subject: Re: [PATCH] staging: kpc2000: kpc_dma: Convert get_user_pages() --> pin_user_pages() Message-ID: <20200608195520.GB30374@kadam> References: <1590947491-11194-1-git-send-email-jrdr.linux@gmail.com> <7e725dd0-7423-b85b-ff56-9705419d13b9@nvidia.com> <20200608191459.GZ30374@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9646 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=2 mlxscore=0 phishscore=0 adultscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006080138 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9646 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 impostorscore=0 cotscore=-2147483648 suspectscore=2 spamscore=0 bulkscore=0 malwarescore=0 phishscore=0 mlxscore=0 mlxlogscore=999 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006080138 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 09, 2020 at 01:03:51AM +0530, Souptick Joarder wrote: > On Tue, Jun 9, 2020 at 12:47 AM Dan Carpenter wrote: > > > > On Tue, Jun 09, 2020 at 12:31:42AM +0530, Souptick Joarder wrote: > > > > > @@ -189,10 +192,9 @@ static int kpc_dma_transfer(struct dev_private_data *priv, > > > > > sg_free_table(&acd->sgt); > > > > > err_dma_map_sg: > > > > > err_alloc_sg_table: > > > > > > > > So now we end up with two unnecessary labels. Probably best to delete two of these > > > > three and name the remaining one appropriately: > > > > > > Hmm, I thought about it. But later decided to wait for review comments > > > on the same in v1. > > > I will remove it now. > > > > These are all unrelated to pin_user_pages(). Please don't do it in the > > same patch. Staging code is there because it's ugly... If you don't > > want to do unrelated changes to label names then you don't have to. > > What I am planning is to put this changes in a series. One patch will take care > of pin_user_pages() related changes, 2nd patch will take care of minor bug > fix in error path + level correction and 3rd patch > will take care of set_page_dirty() -> set_page_dirty_lock(). Always do bug fixes first. Always do the easiest least controversial after first. Do the error handling bug first. Change "rv" to int. That's closely related to the error handling. Then set_page_dirty_lock(). Then the conversion to pin_user_pages(). Then if you want you can do any unrelated clean ups and error label renames as patch 4. regards, dan carpenter