Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp18918581rwd; Wed, 28 Jun 2023 02:28:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6SzWWXd89nRueuuWCjNDocq1KoTG8oJA7vNnrw+4dLgIWkudF8vYXaS3Ukqkaw930hFEvu X-Received: by 2002:a05:6402:12d0:b0:51d:a94b:f8e9 with SMTP id k16-20020a05640212d000b0051da94bf8e9mr3335633edx.2.1687944504499; Wed, 28 Jun 2023 02:28:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687944504; cv=none; d=google.com; s=arc-20160816; b=TX2NEOGcsIRFj9nF4p9yJh23z+D5mvc3AAEHBEZhtlSOQVrPEdlhWTSsaSecu1tUvo aFNZcYy6d/7XFN9p7JTVwdzbczBDiMo33fAMMB67c6Oz8+x0q7TpD7nkGXt1Qq/XcItd UwEkN8GMDjjAf6Q0otwZQEeSrpsRuV8gUB9SvEAV5+/vqgdeOKIuB5YLVHN/NA4EO7YF Cjyp7JNPYE8J8ohuK/xIuSE2VvPXIDTA4I4Em2Wvn6OlK+Rvb5ysodS7MNCb34zVZaRQ 6bgePR2Kqkc5Lc+nqCfKilU1P6Bpxr5xpw5u0NV/t6xPKLz49gpeRh38UEtl4vZyWfBz DuKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=z9vuMjQcNWETrkval/Z6lSG/n630Y93NAOk0eNPpCFE=; fh=yce7ZTzfn2U6FBOs+7uIfewmLyefNB6Bw2Pq74bUDRg=; b=oupuV9Hg5+3rQj+IHe+WjzbXzQZay2gmQ6U99L82CwuthI7BseMeT/sQLxIwymUSi2 8ZaOjRvBTakB+f2BNBonyJ4TG66AasYZeseiOt4bXzNetYdtUaBlurV4dsRaxPaUfqcQ odDVTSrYu2fwOiCaY7WzRvXnNxIylsIk16y2xWnT58ctsq3gM5gwk9rrBetLAvrlgWvD Np3fOVlL8n/itJtxMQMbOi3aE0v4zacIjqFSSPCpJ2twGrAg72mgMPzbAwiqLo2ekOWX e3I8YdmeNyUL0L6ipEW0BIX8IeB1zrEapbUbnDW7c4n+USLt0y30c9BvgL7jlraQtYaU aQCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hr80XAf1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w25-20020aa7cb59000000b005184305b356si4993890edt.14.2023.06.28.02.27.59; Wed, 28 Jun 2023 02:28:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hr80XAf1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234722AbjF1Ijd (ORCPT + 99 others); Wed, 28 Jun 2023 04:39:33 -0400 Received: from mga07.intel.com ([134.134.136.100]:40497 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235249AbjF1Ifw (ORCPT ); Wed, 28 Jun 2023 04:35:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687941352; x=1719477352; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=30tbHYBVKtiwmy4ek/9rLdJHPLikMjah+QEc5qOEVZI=; b=hr80XAf1IRnE1zjPP5AM4Eg4rutqBtvksrnw4AXj8Vng1zsAS6+NGJbJ parkS5wbpx1D2csilrKSFOHTiB5sBL0RM8ma2BUAZnf47s20rIVE3vdZc 6AZ8fP8vLmCrtS6EMjupKPoW0fA1wKOgF5UZnn6ezwgJfoEjEA+SZJVDn gmL/fiKqaXo/hSqDr8ku5YrTonYlu2NmO9ThDGC5YO54j2UhXadN19wxD 8+Jd2GEITtPMw2IivBVcVV9Y43usYX3QMRC9Xy+Mgbz8ddLw7gjtJS7Dp Io3Nfej5Rn+e6N2j8n7WvjJhE+uTjTJPsfwrhHY1hF4x6y9LCORQ9n7Cw w==; X-IronPort-AV: E=McAfee;i="6600,9927,10754"; a="427765542" X-IronPort-AV: E=Sophos;i="6.01,164,1684825200"; d="scan'208";a="427765542" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2023 22:57:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10754"; a="806768023" X-IronPort-AV: E=Sophos;i="6.01,164,1684825200"; d="scan'208";a="806768023" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.165]) by FMSMGA003.fm.intel.com with ESMTP; 27 Jun 2023 22:57:46 -0700 Date: Wed, 28 Jun 2023 13:56:36 +0800 From: Xu Yilun To: Andy Shevchenko Cc: Peter Colberg , hao.wu@intel.com, gregkh@linuxfoundation.org, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, aaron.j.grier@intel.com, tianfei.zhang@intel.com, russell.h.weight@intel.com, matthew.gerlach@linux.intel.com, marpagan@redhat.com, lgoncalv@redhat.com Subject: Re: [PATCH v2] fpga: dfl: afu: use PFN_DOWN() and PFN_PHYS() helper macros Message-ID: References: <2023061908-subscribe-persuader-9b9f@gregkh> <20230619195634.11366-1-peter.colberg@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-06-27 at 21:23:03 +0300, Andy Shevchenko wrote: > On Tue, Jun 27, 2023 at 02:26:27PM +0800, Xu Yilun wrote: > > On 2023-06-19 at 15:56:34 -0400, Peter Colberg wrote: > > ... > > > > - int npages = region->length >> PAGE_SHIFT; > > > + int npages = PFN_DOWN(region->length); > > > > I don't much prefer this change, it is not doing the phy addr to pfn > > convertion. The macro name doesn't match what is doing here. > > This macro converts length to pages. And it's not about phy addr. You are right. > > > - offset = vma->vm_pgoff << PAGE_SHIFT; > > > + offset = PFN_PHYS(vma->vm_pgoff); > > > > ditto. The variables are offsets within file, not phys addr & pfn. > > Here I probably can agree. OK. Remove this one, and others LGTM. Thanks, Yilun > > -- > With Best Regards, > Andy Shevchenko > >