Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2835034lqt; Tue, 23 Apr 2024 03:08:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXKN39UWKHQIluOcyI5LbJZbJI4xnP1mS7M8QTVIsxetgSUezq/5eK9Kcg8NWeNbVfU/nfsOXmhqnomJ+VB9ecovqSdmz+QHYSfM1Ejew== X-Google-Smtp-Source: AGHT+IGjqAEBjAdwKC8hIUTiHrQpTc8sJD5e6PWBfIb9p/LIIZ6SsoBBT/YDlhSUKrrvzuX8+Tw6 X-Received: by 2002:aa7:8888:0:b0:6ed:6056:c7c8 with SMTP id z8-20020aa78888000000b006ed6056c7c8mr19515014pfe.16.1713866907236; Tue, 23 Apr 2024 03:08:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713866907; cv=pass; d=google.com; s=arc-20160816; b=c+laHC+BvGMCeTuPl7Qvsas4ZH8Y7kzktD0wEaDdiuhw42Xj/wsn3oPsQf5O2CXIoY /cKZ11MWHJPpA0M1/wlrNxZfsI5gsSTu2lCORBPn1RiyoibAZIttRMbnFksKwqrElHjY tGqJHJaDAHVJKVWq6LvG4KX8K2cgesvXAfaZr6/WS81OdlpMuoImifhgHODppzLzM+/u b58Xtj9FLAips8fIQM3sR8OJpzmWwH9YE5ZNr1at7Ddqz48ycYOXCgHWKScFqlWkn76S 5rrtuzp+Z5pfW8zByNmuleQVBXIQvdZi26hNMZ9l9/Qqa+fSZlouYi1H9IvZXUuUlRTj CEmw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6w7Lmw736oq4ZnbzBhiGLoNbNOWGV59EKcdLI+NBQyU=; fh=lZMCxXF5BxG3iZPEPnmgU8WttrRaUR6dHZBLinBPtY4=; b=NVP4IEKcuEcU/g2xkE5gcqUtYA4y0AP4pTOQNeEEDABwmu1iA1JeReA02fm9M57yfG JzJUBj/+7Kjq8EXEAVAUiutNC+eFWlBO8bTxvLOtNsrzWrJYd5THb2tpd3XvfamuTseE 0HMqpV2A5IeVgpYnyrfckss2z5Nc5vK0PI9W6HqHArm41udxxanPdZkzjWJ8lhg5WHwS XwKyCfGHruaViHgXqesKTCxrtHjzgIPvhGsBpvjuRDK1TwhtZ5M+bCtGUcgjKdmhsii7 yXpAqQ9iYC0+LpJHqDegrBHW1gO/KasnkX8MaCe2dJrltE9TaWTn+Psoo34qQbJZQsN7 fEKw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FmVwHJDI; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-154758-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154758-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 68-20020a630147000000b006003e65e311si3160609pgb.174.2024.04.23.03.08.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 03:08:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154758-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FmVwHJDI; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-154758-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154758-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id DDA76B25C77 for ; Tue, 23 Apr 2024 09:07:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B978E5647E; Tue, 23 Apr 2024 09:07:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="FmVwHJDI" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36FAC5647B; Tue, 23 Apr 2024 09:07:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713863233; cv=none; b=D1IgklT5CDEXFs1IAU5bb1YeSTq3YfQOQIwahT7HEd1Q14ooph11cojr2c9REMu42jL4Euwaj3P/R8NB+KWACriIKQeTKP5Cyzd3GOdIPw3nF6B0LX2MwKeP9dKiaFnu0BV6ZLF/MqaIDGz1Tma+yAbYm0GhQVJcubzINoNIa9Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713863233; c=relaxed/simple; bh=3sflhcA0hu5cpeDqgRxeLXG5DOKfuWBbLCsPck6cnnU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SsEDWyrTacOCSGidvIlcVKKWSktE6grmQxm3/n85dCqYMqSK8nmd0Y8Vre9pYZ3zkrYVK5QsKd2n+8SS/bj6jXgitWlNuSdKP10u93SJwpH2P72DLKjRsHYzggYbkeJnb6NvEyP0WIvViR+R0WMwBb1vLfWhhXQNK9D5m6sG4lc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=FmVwHJDI; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713863232; x=1745399232; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=3sflhcA0hu5cpeDqgRxeLXG5DOKfuWBbLCsPck6cnnU=; b=FmVwHJDIe+FfyG/p/IVRVuEYGYh4jv3LdJ7vBAi4BLc7jYQ8X26CikuM +qhz9of2amAkwNgJN7BkXS5zMhdgSOyjfa1yYyOa6R/RHq2McAT6Zfj8h TFrDabbtK08haEnPEpDM3so/Kt15qVviNXeiW29X0GWY1JXhwsnQrSGCX D50YWQj2oZw7h+pRcox5+IjQ85cSg8HDd9HLmphc9tZEzSW87sQXGkveb 1LjNp2NAZP22mNIQr98YCpshXzQ/nxVOn3Dw/WzuXUxMAu8vtwsXm65aZ SckKmBjna/i6ZlJMN6k28Rt3rz0YH19HM4brJYRtFEpFWn9gKU29ZJCwz w==; X-CSE-ConnectionGUID: jYvaClv6ShKUd2LqUux2xA== X-CSE-MsgGUID: 6aXRxPLkTiKVq9xDBTEguw== X-IronPort-AV: E=McAfee;i="6600,9927,11052"; a="9302210" X-IronPort-AV: E=Sophos;i="6.07,222,1708416000"; d="scan'208";a="9302210" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2024 02:07:12 -0700 X-CSE-ConnectionGUID: z/rQpEQZRQqgs+rjy2bg0g== X-CSE-MsgGUID: 6D40TMoGTsadoQQyHbX4/Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,222,1708416000"; d="scan'208";a="55247181" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.165]) by orviesa002.jf.intel.com with ESMTP; 23 Apr 2024 02:07:08 -0700 Date: Tue, 23 Apr 2024 17:01:48 +0800 From: Xu Yilun To: Peter Colberg Cc: Wu Hao , Tom Rix , Moritz Fischer , Xu Yilun , linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, Russ Weight , Marco Pagani , Matthew Gerlach Subject: Re: [RFC PATCH v2 2/9] fpga: dfl: migrate AFU DMA region management driver to dfl_feature_dev_data Message-ID: References: <20240409233942.828440-1-peter.colberg@intel.com> <20240409233942.828440-3-peter.colberg@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240409233942.828440-3-peter.colberg@intel.com> On Tue, Apr 09, 2024 at 07:39:35PM -0400, Peter Colberg wrote: > This change separates out most of the symbol name changes required by this > patch series for the file: drivers/fpga/dfl-afu-dma-region.c. > This is done > to split a single monolithic change into multiple, smaller patches at the > request of the maintainer. This sentence provides no useful info. > > Signed-off-by: Peter Colberg > --- > v2: > - Split monolithic patch into series at request of maintainer > - Reorder local variables in afu_dma_unpin_pages() to reverse Christmas > tree order. > --- > drivers/fpga/dfl-afu-dma-region.c | 119 +++++++++++++++--------------- > 1 file changed, 61 insertions(+), 58 deletions(-) > > diff --git a/drivers/fpga/dfl-afu-dma-region.c b/drivers/fpga/dfl-afu-dma-region.c > index 02b60fde0430..fb45e51b12af 100644 > --- a/drivers/fpga/dfl-afu-dma-region.c > +++ b/drivers/fpga/dfl-afu-dma-region.c > @@ -16,26 +16,26 @@ > > #include "dfl-afu.h" > > -void afu_dma_region_init(struct dfl_feature_platform_data *pdata) > +void afu_dma_region_init(struct dfl_feature_dev_data *fdata) > { > - struct dfl_afu *afu = dfl_fpga_pdata_get_private(pdata); > + struct dfl_afu *afu = dfl_fpga_fdata_get_private(fdata); > > afu->dma_regions = RB_ROOT; > } > > /** > * afu_dma_pin_pages - pin pages of given dma memory region > - * @pdata: feature device platform data > + * @fdata: feature dev data > * @region: dma memory region to be pinned > * > * Pin all the pages of given dfl_afu_dma_region. > * Return 0 for success or negative error code. > */ > -static int afu_dma_pin_pages(struct dfl_feature_platform_data *pdata, > +static int afu_dma_pin_pages(struct dfl_feature_dev_data *fdata, > struct dfl_afu_dma_region *region) > { > int npages = region->length >> PAGE_SHIFT; > - struct device *dev = &pdata->dev->dev; > + struct device *dev = &fdata->dev->dev; > int ret, pinned; > > ret = account_locked_vm(current->mm, npages, true); > @@ -73,17 +73,17 @@ static int afu_dma_pin_pages(struct dfl_feature_platform_data *pdata, > > /** > * afu_dma_unpin_pages - unpin pages of given dma memory region > - * @pdata: feature device platform data > + * @fdata: feature dev data > * @region: dma memory region to be unpinned > * > * Unpin all the pages of given dfl_afu_dma_region. > * Return 0 for success or negative error code. > */ > -static void afu_dma_unpin_pages(struct dfl_feature_platform_data *pdata, > +static void afu_dma_unpin_pages(struct dfl_feature_dev_data *fdata, > struct dfl_afu_dma_region *region) > { > long npages = region->length >> PAGE_SHIFT; > - struct device *dev = &pdata->dev->dev; > + struct device *dev = &fdata->dev->dev; > > unpin_user_pages(region->pages, npages); > kfree(region->pages); > @@ -133,20 +133,21 @@ static bool dma_region_check_iova(struct dfl_afu_dma_region *region, > > /** > * afu_dma_region_add - add given dma region to rbtree > - * @pdata: feature device platform data > + * @fdata: feature dev data > * @region: dma region to be added > * > * Return 0 for success, -EEXIST if dma region has already been added. > * > - * Needs to be called with pdata->lock heold. > + * Needs to be called with fdata->lock held. > */ > -static int afu_dma_region_add(struct dfl_feature_platform_data *pdata, > +static int afu_dma_region_add(struct dfl_feature_dev_data *fdata, > struct dfl_afu_dma_region *region) > { > - struct dfl_afu *afu = dfl_fpga_pdata_get_private(pdata); > + struct dfl_afu *afu = dfl_fpga_fdata_get_private(fdata); > + struct device *dev = &fdata->dev->dev; Don't introduce any other unnecessary changes in the big symbol replacement patch. People could read over all the same replacements quickly, even if they are massive. But if there are some other changes in between... > struct rb_node **new, *parent = NULL; > > - dev_dbg(&pdata->dev->dev, "add region (iova = %llx)\n", > + dev_dbg(dev, "add region (iova = %llx)\n", > (unsigned long long)region->iova);