From patchwork Wed Mar 14 18:15:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 131698 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp152471ljb; Wed, 14 Mar 2018 11:17:59 -0700 (PDT) X-Google-Smtp-Source: AG47ELsRZCde4Z+3T2IZqiceptXwx1pB9oIdbn2Ar0Ba3v9qYy7iZOHmSt0+sig8lpFsUi2etS8D X-Received: by 10.99.109.142 with SMTP id i136mr3339980pgc.306.1521051479237; Wed, 14 Mar 2018 11:17:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521051479; cv=none; d=google.com; s=arc-20160816; b=we9BybUOzrIxDML5qo6YpBLaqLhkmGALYGFZGuC7fglezT0OIvPvmrzoojKfGvHuW6 LsIxjs3cZSWMBsLACZkzSi2D675JsWXfsPCSUyhbmhNVpLDKw9s0YDQ8ohy9ap6JWojT 0xl7Bz8CK7vNGhNDAksRY/2vHoxCrSGMJ9SNMJjK3t2+pErLmCFrw42NTeUUv48di+UA o6XN3XkQ8mPEXaFaNaYtZ+tpjyJiLppGYFKSgUKCENO8yOHkvpUX66bTGvw9V90LIecn 4Vr5el9kC3IafxAcYKMdUhZdj8YTqbdoL9Ir5xk7r0ytB40frNQFj1KawK6PXPvwWnvk QPLw== 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=OA7cjhpliCNDOhxGQb5JT1Tyzni2iDNL/x3EBcw9IO4=; b=mdqg5alBJBpd/pn+WRmZz2KuZAk111w+sTe7zqX+XZLFOdbYc5IBjJe+CPCEonEkmV 8Kw9gQnYaRB52EGkmq6BiY55BTury1pBDGIZWbuYmm1dKYSg5SNla4BC8+9O7uvuzt31 nXIaM24vN0qHFoPXbXLVSUyozCY2XPITf/AejKmD09n0N+/7GXIdD7JIQgBVhTpkJ+B3 ps3PVwUTp+wbg3grlWE///jgmX1/0bcuaT159rzDm0Hm77n9BP+wUQgp1jNyxEIguBtG slpESYmh+Jugl/LckguEASQND0bN81nQJmBjmFTcoK45MeUqC+dB7CzEC+jcBNrjmDcB UfJQ== 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 ay2-v6si2297773plb.749.2018.03.14.11.17.58; Wed, 14 Mar 2018 11:17:59 -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 S1752250AbeCNSRL (ORCPT + 28 others); Wed, 14 Mar 2018 14:17:11 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6200 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750998AbeCNSRF (ORCPT ); Wed, 14 Mar 2018 14:17:05 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 00F64CDB6EC21; Thu, 15 Mar 2018 02:16:51 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.361.1; Thu, 15 Mar 2018 02:16:45 +0800 From: John Garry To: , , , , , , , , , , , , , CC: , , , , , , , , , , , , , Subject: [PATCH v17 03/10] PCI: Add fwnode handler as input param of pci_register_io_range() Date: Thu, 15 Mar 2018 02:15:52 +0800 Message-ID: <1521051359-34473-4-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1521051359-34473-1-git-send-email-john.garry@huawei.com> References: <1521051359-34473-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected 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(logical 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 Acked-by: Rob Herring Reviewed-by: Andy Shevchenko Tested-by: dann frazier --- 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(-) -- 1.9.1 diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 6fc204a..1213479 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 ce4d3d8..cdf047b 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 @@ -333,7 +334,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 ff41a64..3f30b7d 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -3451,7 +3451,8 @@ struct io_range { * 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 25b7a35..17cc998 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1221,7 +1221,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);