From patchwork Fri Oct 27 16:11:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriele Paoloni X-Patchwork-Id: 117370 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp949019qgn; Fri, 27 Oct 2017 09:15:48 -0700 (PDT) X-Google-Smtp-Source: ABhQp+T67Qc3n63kUBy/A8ECFU1JUtnOAm3MKEH3NP0XW1380LOvHHxHf9pKh+nhyAGnWdbBP3iR X-Received: by 10.84.240.203 with SMTP id l11mr765544plt.280.1509120948412; Fri, 27 Oct 2017 09:15:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509120948; cv=none; d=google.com; s=arc-20160816; b=C+oHcngfITMNeDHhwNzAD8dlwaM/eKRHSaJpeuJC4vzj3IQe71WgpH2sbgn11W0sB+ Ke5eWDf2zERjcWoyl17DdGlwH5ZZR7MKn1IHFC4HpjzCuJmiFZmSJZJ9OQgYcGpdzqbN LpgBafYa2o3nRJUUxSVIjyEjzJeM+ybGFW9eRHoCZcfqig6CF+LlvHy0Ge9fZ7spCAh8 j5VizOWIQm3em12rFQM7+mAzXqZ+NChqO3YcjG4Kx/AnjNlIop5a7/xhoJXjjyNf8NVn My65vG6bO116HagAZUpBdjEMZQkcsnIuBEYcijwBs7nLgvqg9L/+Gb9hyazEd2qgNyzb 8uSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=GpBjmijKVxeiKFXeOezcYBuXhtA8aNm5tpYQATMrUiY=; b=Dei5d1SK9qPcHRkIVeH1IjjrDth67J61qxOvDpIyXYAbIt6poztt1o/VfNUXpasvqb I4uhtypNMU5I2V0wNZE9C18mPP0KpKx3AZFsjKcAFRpHSts0VQRm4a0oBExeG8zlNl/G tzHlABIJA14YgUKxIpvI/AfkwxNS5kD3R2Rjrk0ma+q98pZ96ta/YKhQ8/lIsMcaaQLi 64E/+hjmPrkqcAFVTh3AnHqbI9iKwHy6bljBDG9y47/hQYIWT4C8SEsF6NH7InZML+tN ulJPUHvF331oVQRRtvevh8vBZPQjDOkjoJTPwTnNt8wyO3r2O8zzqh7BRZoPshalHm/j TrXw== ARC-Authentication-Results: i=1; mx.google.com; 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 p12si4543755pli.745.2017.10.27.09.15.48; Fri, 27 Oct 2017 09:15:48 -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; 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 S1752761AbdJ0QPq (ORCPT + 27 others); Fri, 27 Oct 2017 12:15:46 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9454 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752033AbdJ0QOz (ORCPT ); Fri, 27 Oct 2017 12:14:55 -0400 Received: from 172.30.72.58 (EHLO DGGEMS414-HUB.china.huawei.com) ([172.30.72.58]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DJX16563; Sat, 28 Oct 2017 00:14:38 +0800 (CST) Received: from G00308965-DELL1.china.huawei.com (10.202.226.113) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.361.1; Sat, 28 Oct 2017 00:12:37 +0800 From: Gabriele Paoloni To: , , , , , , , , CC: , , , , , , , , , , , Subject: [PATCH v10 3/9] PCI: add fwnode handler as input param of pci_register_io_range() Date: Fri, 27 Oct 2017 17:11:21 +0100 Message-ID: <1509120687-7352-4-git-send-email-gabriele.paoloni@huawei.com> X-Mailer: git-send-email 2.7.1.windows.1 In-Reply-To: <1509120687-7352-1-git-send-email-gabriele.paoloni@huawei.com> References: <1509120687-7352-1-git-send-email-gabriele.paoloni@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.226.113] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.59F35B6F.0023, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: f637e8d5eefb5ceb520003383bc07b0d Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: gabriele paoloni In preparation for having the PCI MMIO helpers to use the new generic I/O space management(LOGIC_PIO) we need to add the fwnode handler as extra input parameter. This patch changes the signature of pci_register_io_range() and of its callers as needed. Signed-off-by: Gabriele Paoloni Acked-by: Bjorn Helgaas --- drivers/acpi/pci_root.c | 8 +++++--- drivers/of/address.c | 4 +++- drivers/pci/pci.c | 3 ++- include/linux/pci.h | 3 ++- 4 files changed, 12 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 9eec309..40164e3 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -729,7 +729,8 @@ static void acpi_pci_root_validate_resources(struct device *dev, } } -static void acpi_pci_root_remap_iospace(struct resource_entry *entry) +static void acpi_pci_root_remap_iospace(struct fwnode_handle *fwnode, + struct resource_entry *entry) { #ifdef PCI_IOBASE struct resource *res = entry->res; @@ -738,7 +739,7 @@ static void acpi_pci_root_remap_iospace(struct resource_entry *entry) resource_size_t length = resource_size(res); unsigned long port; - if (pci_register_io_range(cpu_addr, length)) + if (pci_register_io_range(fwnode, cpu_addr, length)) goto err; port = pci_address_to_pio(cpu_addr); @@ -780,7 +781,8 @@ int acpi_pci_probe_root_resources(struct acpi_pci_root_info *info) else { resource_list_for_each_entry_safe(entry, tmp, list) { if (entry->res->flags & IORESOURCE_IO) - acpi_pci_root_remap_iospace(entry); + acpi_pci_root_remap_iospace(&device->fwnode, + entry); if (entry->res->flags & IORESOURCE_DISABLED) resource_list_destroy_entry(entry); diff --git a/drivers/of/address.c b/drivers/of/address.c index 580bbf6..9d3ba07 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -2,6 +2,7 @@ #define pr_fmt(fmt) "OF: " fmt #include +#include #include #include #include @@ -323,7 +324,8 @@ int of_pci_range_to_resource(struct of_pci_range *range, if (res->flags & IORESOURCE_IO) { unsigned long port; - err = pci_register_io_range(range->cpu_addr, range->size); + err = pci_register_io_range(&np->fwnode, range->cpu_addr, + range->size); if (err) goto invalid_range; port = pci_address_to_pio(range->cpu_addr); diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index eee967c..bcecb47 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -3270,7 +3270,8 @@ static DEFINE_SPINLOCK(io_range_lock); * Record the PCI IO range (expressed as CPU physical address + size). * Return a negative value if an error has occured, zero otherwise */ -int pci_register_io_range(phys_addr_t addr, resource_size_t size) +int pci_register_io_range(struct fwnode_handle *fwnode, phys_addr_t addr, + resource_size_t size) { int err = 0; diff --git a/include/linux/pci.h b/include/linux/pci.h index 4869e66..1d958d7 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1205,7 +1205,8 @@ int __must_check pci_bus_alloc_resource(struct pci_bus *bus, void *alignf_data); -int pci_register_io_range(phys_addr_t addr, resource_size_t size); +int pci_register_io_range(struct fwnode_handle *fwnode, phys_addr_t addr, + resource_size_t size); unsigned long pci_address_to_pio(phys_addr_t addr); phys_addr_t pci_pio_to_address(unsigned long pio); int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr);