From patchwork Sun Jan 21 12:27:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 125273 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp654892ljf; Sun, 21 Jan 2018 03:36:23 -0800 (PST) X-Google-Smtp-Source: AH8x227/VPWu3IUDeoIV//H6fr289Exb3rrUbMe0ZZlD5UmqnUndVqT2c0OTNVCNPXzEVkPaGhPX X-Received: by 10.98.195.2 with SMTP id v2mr4940335pfg.141.1516534583488; Sun, 21 Jan 2018 03:36:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516534583; cv=none; d=google.com; s=arc-20160816; b=ZrkCoTczbZq61QUmcaNl4DEdXp8/24rSCNhJYq8bcP9KbPaufwJEm6aBw4Dmm4wtvq 6eZ9xkOqddXSx36F1wM/IViSuiubrC1+Lq0Ktb2s4CB1/ANC2aYCfmD3BR7xdDrehhVZ yMD4NTAQpbElLv4NH6TxSW2zRMHTq5vQbOd+LuQGzz9xZvAhWoRfbK5eJA8xqsIRFG6T kRxDYDl22E3fJvUY5FRONW/QvUeD9uzvWHd+Yt0EneIpR2wlsGG2G+gHng2dJsReRb6h NZ9BG3YBflHRT4elCGGfCxjBHukzXmtN+310/LRHWjqHQHPHqPmEnsDGmeot2EAqP7kw v6Dg== 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=En8JSeoTuYYa+PcKJBwoPfqwXMzBatcT9a0NoYHTHpo=; b=F76QZZN+NsSwYGA+AnLtidxcC/vM/WUdXGyW01/bgNawaEpSu4u5vM4KLzxzkcJume VjAy7R4LcwiCFO8yNeL4D20bdUBzzVi3ZEz5lGl4HOTd98Ci7++iDQICZZnkgYU6yz3I oLOjMd1cqiTRyyxzbk1n8wmOEvLgsbxxl95UkqGghu+u4cm8oMrXGkxkCDNptWd0RbGV eS7KJjvJgYM6JKWkrcafxlfBsbinfvzVgqJdC/D6Va4RLBNbtjfTYbel5hI3CzMSjY0d CiCWW5I7qy/99uiTtW+dKPg+sizAwhuthQMofKYJVzWw95pAViG9G1luWbnTKkPct5yH KUAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 e11si11873982pgn.374.2018.01.21.03.36.21; Sun, 21 Jan 2018 03:36:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751161AbeAULgS (ORCPT + 6 others); Sun, 21 Jan 2018 06:36:18 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:50536 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751144AbeAULgQ (ORCPT ); Sun, 21 Jan 2018 06:36:16 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 2AF822233507; Sun, 21 Jan 2018 19:36:11 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.361.1; Sun, 21 Jan 2018 19:36:06 +0800 From: John Garry To: , , , , , , , , , , CC: , , , , , , , , Gabriele Paoloni Subject: [PATCH v11 3/9] PCI: Add fwnode handler as input param of pci_register_io_range() Date: Sun, 21 Jan 2018 20:27:21 +0800 Message-ID: <1516537647-50553-4-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516537647-50553-1-git-send-email-john.garry@huawei.com> References: <1516537647-50553-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 c6c410b..85975fe 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 @@ -335,7 +336,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 d8357ff..d60f0a3 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -3383,7 +3383,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 8329983..1b70732 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1225,7 +1225,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);