Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp321473pxb; Thu, 12 Aug 2021 17:37:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxj4LM210e+vus/WeLLwBC1ZvnGo6UJj4iH0kTKPu2Mxy354ZbK9GP18JG97hgpEE7/J9+U X-Received: by 2002:aa7:c64f:: with SMTP id z15mr2995888edr.54.1628815057021; Thu, 12 Aug 2021 17:37:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628815057; cv=none; d=google.com; s=arc-20160816; b=b9Mtd4OARFAhjsJArnRxjjfIINX/4uF/gtxiV/TpXmKND7SqlQZ0UqcI1LupA9KVZl 15DCJ1vta/rXSqqJ3WJAL9yAdPO/L7dOFkzweEAAnG5L8c5tkb7R3fVtLxeS0ZD1WGTP vVQqDaZXHLs57NpahVipR0L4/7Hr+17Cd7HIp7yx6IjiMUEqdyMGrbLQTwNFuVqHrWey yB1pKL2G4ynnEEBB+0tze3YYgmAKXowTrkblcIdV8Mgb3xiLSrkqXXzd95piG/oFlCG/ 8BVtL4nPgRoPa2e3S5mXxt9D4aM4or8RN9E0GL8BmcOZ5mMBIWsNIOhfjumZcv0HVa1m bNtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=no6Mxz50keFyzNKDjebAs9jBG5ifA3BHA5LLr97NDOA=; b=BA+V9fKxdKBXKBIk4/FQDeUPYLa6RS9QIIw81eriDWjpM+00k4YKMFooWrYiwknXC2 QUBh7R1G8X0b2kJnAasTLQeIAJEuRsiiXEmae6CbUT5jP9OPU1aqa3bbbp2bVXREwa7c DTaBDcL6kBjl0H6c5YsbIS9p2p/nYmvh+GERbLtPd41x/wW+X5PYQflp7L2+jJuo8rV0 91yp6sF1GvMTbmgiwP78jwOUWnZI4/dI4SMlzx2Y3DRTcgmTxoBpKyx1p6uN0S/xKwEe PSUC5pW0VjRe3YyCNINjbqwOjRKQgJim6mD0gikzM1Z73yS8wQHXqc593BXke+yLagJl W5jQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r24si4245293eds.133.2021.08.12.17.36.58; Thu, 12 Aug 2021 17:37:37 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238233AbhHLWaN (ORCPT + 99 others); Thu, 12 Aug 2021 18:30:13 -0400 Received: from mga14.intel.com ([192.55.52.115]:42422 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231392AbhHLWaM (ORCPT ); Thu, 12 Aug 2021 18:30:12 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10074"; a="215191292" X-IronPort-AV: E=Sophos;i="5.84,317,1620716400"; d="scan'208";a="215191292" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2021 15:29:46 -0700 X-IronPort-AV: E=Sophos;i="5.84,317,1620716400"; d="scan'208";a="517642404" Received: from smachee-mobl.amr.corp.intel.com (HELO skuppusw-mobl5.amr.corp.intel.com) ([10.213.169.15]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2021 15:29:45 -0700 Subject: Re: [PATCH v4 09/15] pci: Consolidate pci_iomap* and pci_iomap*wc To: Bjorn Helgaas Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Peter Zijlstra , Andy Lutomirski , Bjorn Helgaas , Richard Henderson , Thomas Bogendoerfer , James E J Bottomley , Helge Deller , "David S . Miller" , Arnd Bergmann , Jonathan Corbet , "Michael S . Tsirkin" , Peter H Anvin , Dave Hansen , Tony Luck , Dan Williams , Andi Kleen , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , x86@kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, virtualization@lists.linux-foundation.org References: <20210812194330.GA2500473@bjorn-Precision-5520> From: "Kuppuswamy, Sathyanarayanan" Message-ID: Date: Thu, 12 Aug 2021 15:29:42 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210812194330.GA2500473@bjorn-Precision-5520> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/12/21 12:43 PM, Bjorn Helgaas wrote: > Is there a branch with all of this applied? I was going to apply this Its is maintained in following tree. https://github.com/intel/tdx/commit/93fd5b655172ba9e3350487995102a8b2c41de27 > to help take a look at it, but it doesn't apply to v5.14-rc1. I know This patch can be applied independently. I have just applied it on top of v5.14-rc5, and it seems to apply clean. Can you try -rc5? > you listed some prereqs in the cover letter, but it's a fair amount of > work to sort all that out. > > On Wed, Aug 04, 2021 at 05:52:12PM -0700, Kuppuswamy Sathyanarayanan wrote: >> From: Andi Kleen > > If I were applying these, I would silently update the subject lines to > match previous commits. Since these will probably be merged via a > different tree, you can update if there's a v5: > > PCI: Consolidate pci_iomap_range(), pci_iomap_wc_range() Yes. I will fix this in next version. > > Also applies to 11/15 and 12/15. Will do the same. > >> pci_iomap* and pci_iomap*wc are currently duplicated code, except >> that the _wc variant does not support IO ports. Replace them >> with a common helper and a callback for the mapping. I used >> wrappers for the maps because some architectures implement ioremap >> and friends with macros. > > Maybe spell some of this out: > > pci_iomap_range() and pci_iomap_wc_range() are currently duplicated > code, ... Implement them using a common helper, > pci_iomap_range_map(), ... > > Using "pci_iomap*" obscures the name and doesn't save any space. > > Why is it safe to make pci_iomap_wc_range() support IO ports when it > didn't before? That might be desirable, but I think it *is* a > functional change here. Agree. Commit log had to be updated. I will include these details in next submission. > > IIUC, pci_iomap_wc_range() on an IO port range previously returned > NULL, and after this patch it will work the same as pci_iomap_range(), > i.e., it will return the result of __pci_ioport_map(). > >> This will allow to add more variants without excessive code >> duplications. This patch should have no behavior change. >> >> Signed-off-by: Andi Kleen >> Signed-off-by: Kuppuswamy Sathyanarayanan >> --- >> lib/pci_iomap.c | 81 +++++++++++++++++++++++++++---------------------- >> 1 file changed, 44 insertions(+), 37 deletions(-) >> -- Sathyanarayanan Kuppuswamy Linux Kernel Developer