From patchwork Fri May 22 23:48:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1296535 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49TNVF44N0z9sRY for ; Sat, 23 May 2020 09:48:37 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726546AbgEVXsg (ORCPT ); Fri, 22 May 2020 19:48:36 -0400 Received: from mail-il1-f196.google.com ([209.85.166.196]:32777 "EHLO mail-il1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731183AbgEVXsg (ORCPT ); Fri, 22 May 2020 19:48:36 -0400 Received: by mail-il1-f196.google.com with SMTP id y17so10294108ilg.0 for ; Fri, 22 May 2020 16:48:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oGPS1/9t2DbdpX0irS4os0tkteUYvgsNTUcQ44RgQLA=; b=MAzGQPXpcPqfb1n9keVTxhWxPFSYJQZshRMjVv9QFUvYSDG50LceLrG6u9fVbenVLX V5fOydE53btfFa4LvSR8+6lPaUbZSzSvX/Hl6n+tEWrPRGKIa1jG71min6okzSG1ZCRL Gs4g0wlZOH06koJXh/fa+15ZHdBHLjZ4W7yLGhuobZQ2nwtH4UlnwzZWInqsjAa6D/ja fm9KOr6TdEL1839Brdz0o4tvNMYgmpsD/ocINRQd2FoMeIxEKQHZyGrJwhku/Em0h9sM RVQcS6KblTWlZ+5ZEBUmTDPyCpT7t0IXC7ZjYd6JvI3pNRsb2wlIaNpR0o4p7E6m4jrY llsw== X-Gm-Message-State: AOAM533nUcttxtOoRSm6OtTYuwbIdOW4nonkQ33lmUfyRZfRSwxGgpKs +ILTqzU5r9ipqrz3Wp927g== X-Google-Smtp-Source: ABdhPJyuqDfEj9pKyUgEYZRO+cysIrAtCQrOxTDCZeXzJp8d1Psmue13wAQH//FdOBy3lTptmkGmxw== X-Received: by 2002:a92:d6c5:: with SMTP id z5mr15613014ilp.194.1590191315033; Fri, 22 May 2020 16:48:35 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.252]) by smtp.googlemail.com with ESMTPSA id w23sm4390877iod.9.2020.05.22.16.48.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 16:48:34 -0700 (PDT) From: Rob Herring To: Lorenzo Pieralisi Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tom Joseph Subject: [PATCH 01/15] PCI: cadence: Use struct pci_host_bridge.windows list directly Date: Fri, 22 May 2020 17:48:18 -0600 Message-Id: <20200522234832.954484-2-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200522234832.954484-1-robh@kernel.org> References: <20200522234832.954484-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org There's no need to create a temporary resource list and then splice it to struct pci_host_bridge.windows list. Just use pci_host_bridge.windows directly. The necessary clean-up is already handled by the PCI core. Cc: Tom Joseph Signed-off-by: Rob Herring --- .../controller/cadence/pcie-cadence-host.c | 26 +++++-------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/drivers/pci/controller/cadence/pcie-cadence-host.c b/drivers/pci/controller/cadence/pcie-cadence-host.c index 8c2543f28ba0..9f77e47983c3 100644 --- a/drivers/pci/controller/cadence/pcie-cadence-host.c +++ b/drivers/pci/controller/cadence/pcie-cadence-host.c @@ -169,14 +169,15 @@ static int cdns_pcie_host_init_address_translation(struct cdns_pcie_rc *rc) } static int cdns_pcie_host_init(struct device *dev, - struct list_head *resources, struct cdns_pcie_rc *rc) { + struct pci_host_bridge *bridge = pci_host_bridge_from_priv(rc); struct resource *bus_range = NULL; int err; /* Parse our PCI ranges and request their resources */ - err = pci_parse_request_of_pci_ranges(dev, resources, NULL, &bus_range); + err = pci_parse_request_of_pci_ranges(dev, &bridge->windows, NULL, + &bus_range); if (err) return err; @@ -185,17 +186,9 @@ static int cdns_pcie_host_init(struct device *dev, err = cdns_pcie_host_init_root_port(rc); if (err) - goto err_out; - - err = cdns_pcie_host_init_address_translation(rc); - if (err) - goto err_out; - - return 0; + return err; - err_out: - pci_free_resource_list(resources); - return err; + return cdns_pcie_host_init_address_translation(rc); } int cdns_pcie_host_setup(struct cdns_pcie_rc *rc) @@ -204,7 +197,6 @@ int cdns_pcie_host_setup(struct cdns_pcie_rc *rc) struct platform_device *pdev = to_platform_device(dev); struct device_node *np = dev->of_node; struct pci_host_bridge *bridge; - struct list_head resources; struct cdns_pcie *pcie; struct resource *res; int ret; @@ -248,11 +240,10 @@ int cdns_pcie_host_setup(struct cdns_pcie_rc *rc) pcie->mem_res = res; - ret = cdns_pcie_host_init(dev, &resources, rc); + ret = cdns_pcie_host_init(dev, rc); if (ret) goto err_init; - list_splice_init(&resources, &bridge->windows); bridge->dev.parent = dev; bridge->busnr = pcie->bus; bridge->ops = &cdns_pcie_host_ops; @@ -261,13 +252,10 @@ int cdns_pcie_host_setup(struct cdns_pcie_rc *rc) ret = pci_host_probe(bridge); if (ret < 0) - goto err_host_probe; + goto err_init; return 0; - err_host_probe: - pci_free_resource_list(&resources); - err_init: pm_runtime_put_sync(dev); From patchwork Fri May 22 23:48:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1296536 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49TNVF72x4z9sRf for ; Sat, 23 May 2020 09:48:37 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731238AbgEVXsh (ORCPT ); Fri, 22 May 2020 19:48:37 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:46654 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731183AbgEVXsh (ORCPT ); Fri, 22 May 2020 19:48:37 -0400 Received: by mail-io1-f67.google.com with SMTP id j8so13282482iog.13 for ; Fri, 22 May 2020 16:48:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W4+faHiQpbiKoNArdRYrYzpj6r3I7BpUrWFS3s8f/VI=; b=Y7dAEsH8KoK2WqBd756PciJPvnhcCKAjKPaTDqxkJaMmm4p7cFqXmll1jVZbmhbGeD 4YGxhvVFXn9dW7LB6o1ix3k0onSZE/CgT5Jh7fL4nQTnDHUIUa72zMWAd6xSpR7vQ88R u3tgSrRENpaLAiJcXyp5I7sU9WJc+ZEkzrnL7H5tJZ96kn7qG8fdn0mz/efYH1D59x54 zTNt3t/ACjyZALU+Mb2RocyIC+8ems6stZTgNiyyjGp5cCVnZOrTfPn2kqQFMhTs14vv uyA9tnlDXlgsrjEDXV3qxGDl+6cQSUgf6ZaGdr4C7x21SbLAa3vZXZIxhLTiH959wqQI YMjw== X-Gm-Message-State: AOAM531FQGWptoCwa0UzmSd34HqnQl1p7xS82owrelkf20w4iBf8IDq+ 3SAVDRdD7/ZZzFhq2b7JOw== X-Google-Smtp-Source: ABdhPJzN5mP6wcYyIO0prwZR7WJYYh7QphTWx1pZw96CB3uHi1bA3huv1VVkQoA0SVgvDeTWo4nM+g== X-Received: by 2002:a6b:5813:: with SMTP id m19mr5015868iob.88.1590191316081; Fri, 22 May 2020 16:48:36 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.252]) by smtp.googlemail.com with ESMTPSA id w23sm4390877iod.9.2020.05.22.16.48.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 16:48:35 -0700 (PDT) From: Rob Herring To: Lorenzo Pieralisi Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , Jason Cooper Subject: [PATCH 02/15] PCI: mvebu: Use struct pci_host_bridge.windows list directly Date: Fri, 22 May 2020 17:48:19 -0600 Message-Id: <20200522234832.954484-3-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200522234832.954484-1-robh@kernel.org> References: <20200522234832.954484-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org There's no need to create a temporary resource list and then splice it to struct pci_host_bridge.windows list. Just use pci_host_bridge.windows directly. The necessary clean-up is already handled by the PCI core. Cc: Thomas Petazzoni Cc: Jason Cooper Signed-off-by: Rob Herring --- drivers/pci/controller/pci-mvebu.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/pci/controller/pci-mvebu.c b/drivers/pci/controller/pci-mvebu.c index 153a64676bc9..801044523a3d 100644 --- a/drivers/pci/controller/pci-mvebu.c +++ b/drivers/pci/controller/pci-mvebu.c @@ -71,7 +71,6 @@ struct mvebu_pcie { struct platform_device *pdev; struct mvebu_pcie_port *ports; struct msi_controller *msi; - struct list_head resources; struct resource io; struct resource realio; struct resource mem; @@ -961,17 +960,16 @@ static int mvebu_pcie_parse_request_resources(struct mvebu_pcie *pcie) { struct device *dev = &pcie->pdev->dev; struct device_node *np = dev->of_node; + struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie); int ret; - INIT_LIST_HEAD(&pcie->resources); - /* Get the bus range */ ret = of_pci_parse_bus_range(np, &pcie->busn); if (ret) { dev_err(dev, "failed to parse bus-range property: %d\n", ret); return ret; } - pci_add_resource(&pcie->resources, &pcie->busn); + pci_add_resource(&bridge->windows, &pcie->busn); /* Get the PCIe memory aperture */ mvebu_mbus_get_pcie_mem_aperture(&pcie->mem); @@ -981,7 +979,7 @@ static int mvebu_pcie_parse_request_resources(struct mvebu_pcie *pcie) } pcie->mem.name = "PCI MEM"; - pci_add_resource(&pcie->resources, &pcie->mem); + pci_add_resource(&bridge->windows, &pcie->mem); /* Get the PCIe IO aperture */ mvebu_mbus_get_pcie_io_aperture(&pcie->io); @@ -994,10 +992,10 @@ static int mvebu_pcie_parse_request_resources(struct mvebu_pcie *pcie) resource_size(&pcie->io) - 1); pcie->realio.name = "PCI I/O"; - pci_add_resource(&pcie->resources, &pcie->realio); + pci_add_resource(&bridge->windows, &pcie->realio); } - return devm_request_pci_bus_resources(dev, &pcie->resources); + return devm_request_pci_bus_resources(dev, &bridge->windows); } /* @@ -1118,7 +1116,6 @@ static int mvebu_pcie_probe(struct platform_device *pdev) pcie->nports = i; - list_splice_init(&pcie->resources, &bridge->windows); bridge->dev.parent = dev; bridge->sysdata = pcie; bridge->busnr = 0; From patchwork Fri May 22 23:48:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1296538 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49TNVJ29vTz9sRY for ; Sat, 23 May 2020 09:48:40 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387409AbgEVXsj (ORCPT ); Fri, 22 May 2020 19:48:39 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:39988 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387404AbgEVXsj (ORCPT ); Fri, 22 May 2020 19:48:39 -0400 Received: by mail-io1-f65.google.com with SMTP id q8so11951847iow.7 for ; Fri, 22 May 2020 16:48:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ThmdbRMtyh+goPlCsRsJutoUCzX5VD3oRn0IWK/oqQw=; b=p77dnAHzCiaXAmwrXE7PDlTvEbAzT8efu4tyqM//L10wDacIt+vqT1Q5sYhYM/nGhT FFoqVZA2szHKIhXewc2KKZiy9ILC2Y8A4JBJUrS5ESD4xTC7g5/GfFLa8yLE1KiUdzmL QWLUqY/cYfSB56WDlJ5z1dm+rPiYr3n7hMuZf6avhFngAHaj8FqL6O22ThemIUo79F80 LfuVERyOw5qfnHbKZf/rWa7uwzqvP3F+cxf5i3bNa5SQvQGXFxMohJWalejn/3BqfM/J nFFOg6SoRL1y77h/rf46LpZ9svCZbJr2eCms+ZqDhTpgp9r9BtCU5V/Y6w9r0YjNbjLj n9Ig== X-Gm-Message-State: AOAM530VToEh4F8VafMNWbjMEhZuKZhB7pqeeUsqyv02pRi0m+ClX3Sz Ni9Ojhmv0p8z9LSIQJEEVg== X-Google-Smtp-Source: ABdhPJyDe0JoDXoIsQG/kMCc3sQ6ItzXn8qXN6+PN/9wYAzSRpPJ6IwR3EmqfjWPoiHq9avExGm3NA== X-Received: by 2002:a6b:ee15:: with SMTP id i21mr5318999ioh.179.1590191317148; Fri, 22 May 2020 16:48:37 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.252]) by smtp.googlemail.com with ESMTPSA id w23sm4390877iod.9.2020.05.22.16.48.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 16:48:36 -0700 (PDT) From: Rob Herring To: Lorenzo Pieralisi Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Will Deacon Subject: [PATCH 03/15] PCI: host-common: Use struct pci_host_bridge.windows list directly Date: Fri, 22 May 2020 17:48:20 -0600 Message-Id: <20200522234832.954484-4-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200522234832.954484-1-robh@kernel.org> References: <20200522234832.954484-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org There's no need to create a temporary resource list and then splice it to struct pci_host_bridge.windows list. Just use pci_host_bridge.windows directly. The necessary clean-up is already handled by the PCI core. Cc: Will Deacon Signed-off-by: Rob Herring --- drivers/pci/controller/pci-host-common.c | 36 ++++++++---------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/drivers/pci/controller/pci-host-common.c b/drivers/pci/controller/pci-host-common.c index 953de57f6c57..f8f71d99e427 100644 --- a/drivers/pci/controller/pci-host-common.c +++ b/drivers/pci/controller/pci-host-common.c @@ -21,7 +21,7 @@ static void gen_pci_unmap_cfg(void *ptr) } static struct pci_config_window *gen_pci_init(struct device *dev, - struct list_head *resources, const struct pci_ecam_ops *ops) + struct pci_host_bridge *bridge, const struct pci_ecam_ops *ops) { int err; struct resource cfgres; @@ -29,31 +29,25 @@ static struct pci_config_window *gen_pci_init(struct device *dev, struct pci_config_window *cfg; /* Parse our PCI ranges and request their resources */ - err = pci_parse_request_of_pci_ranges(dev, resources, NULL, &bus_range); + err = pci_parse_request_of_pci_ranges(dev, &bridge->windows, NULL, &bus_range); if (err) return ERR_PTR(err); err = of_address_to_resource(dev->of_node, 0, &cfgres); if (err) { dev_err(dev, "missing \"reg\" property\n"); - goto err_out; + return ERR_PTR(err); } cfg = pci_ecam_create(dev, &cfgres, bus_range, ops); - if (IS_ERR(cfg)) { - err = PTR_ERR(cfg); - goto err_out; - } + if (IS_ERR(cfg)) + return cfg; err = devm_add_action_or_reset(dev, gen_pci_unmap_cfg, cfg); - if (err) { - goto err_out; - } - return cfg; + if (err) + return ERR_PTR(err); -err_out: - pci_free_resource_list(resources); - return ERR_PTR(err); + return cfg; } int pci_host_common_probe(struct platform_device *pdev) @@ -61,9 +55,7 @@ int pci_host_common_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct pci_host_bridge *bridge; struct pci_config_window *cfg; - struct list_head resources; const struct pci_ecam_ops *ops; - int ret; ops = of_device_get_match_data(&pdev->dev); if (!ops) @@ -76,7 +68,7 @@ int pci_host_common_probe(struct platform_device *pdev) of_pci_check_probe_only(); /* Parse and map our Configuration Space windows */ - cfg = gen_pci_init(dev, &resources, ops); + cfg = gen_pci_init(dev, bridge, ops); if (IS_ERR(cfg)) return PTR_ERR(cfg); @@ -84,7 +76,6 @@ int pci_host_common_probe(struct platform_device *pdev) if (!pci_has_flag(PCI_PROBE_ONLY)) pci_add_flags(PCI_REASSIGN_ALL_BUS); - list_splice_init(&resources, &bridge->windows); bridge->dev.parent = dev; bridge->sysdata = cfg; bridge->busnr = cfg->busr.start; @@ -92,14 +83,9 @@ int pci_host_common_probe(struct platform_device *pdev) bridge->map_irq = of_irq_parse_and_map_pci; bridge->swizzle_irq = pci_common_swizzle; - ret = pci_host_probe(bridge); - if (ret < 0) { - pci_free_resource_list(&resources); - return ret; - } - platform_set_drvdata(pdev, bridge->bus); - return 0; + + return pci_host_probe(bridge); } EXPORT_SYMBOL_GPL(pci_host_common_probe); From patchwork Fri May 22 23:48:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1296539 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49TNVJ5KXSz9sRK for ; Sat, 23 May 2020 09:48:40 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387404AbgEVXsk (ORCPT ); Fri, 22 May 2020 19:48:40 -0400 Received: from mail-il1-f195.google.com ([209.85.166.195]:36860 "EHLO mail-il1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387406AbgEVXsj (ORCPT ); Fri, 22 May 2020 19:48:39 -0400 Received: by mail-il1-f195.google.com with SMTP id 17so12516373ilj.3 for ; Fri, 22 May 2020 16:48:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fcOH9Yyg8RTS1uDyK4ju1tKTwPN2SKJdo9WLhc7R054=; b=Yq+ddVcIbStFD/JTpAlILE88uQ3Rrr1tAyij3rR/8w+maTObDdWZrfn8lFExMHl/G1 4ZQgAQ3IJry6YxnQbGlaTKD9sf3eysJbBvGVeFx2X42JwisKDdYJIFgN9P+oErsQTK67 85OeAT5bfNQfERZS3yyG42V9+yD6n2DIiLt4S2upzO8PbJwsJ4kY79ZAwj9NUrkZMDN7 KU4x/zcaRp74TAOj+4AYGn6bE0NCEjazt3UGFv1VozVwZw3a7/Lx6r7lsfAgV7tblaso H97CZXb2OkSrTlSqiWFvMTe/DVJQnWPGh6z/kYxDqMl7fcXWABtbd7Hgf6vaMIUR0NrB 0W0g== X-Gm-Message-State: AOAM533J01JF/gloToXaGI+1rZbjE6ZkbtXcC553HAamQshDq0FE/MBe zQYKE6QPXFLjo85q98WXPQ== X-Google-Smtp-Source: ABdhPJxSQMk+Xgx5mMu8Qr8nZIuiuOwT56dTl3b5bTFmMoPFk+wCyTSsmV14SJYYFxh7j5CDBkgX/w== X-Received: by 2002:a92:cf46:: with SMTP id c6mr16172424ilr.4.1590191318280; Fri, 22 May 2020 16:48:38 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.252]) by smtp.googlemail.com with ESMTPSA id w23sm4390877iod.9.2020.05.22.16.48.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 16:48:37 -0700 (PDT) From: Rob Herring To: Lorenzo Pieralisi Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Nicolas Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org Subject: [PATCH 04/15] PCI: brcmstb: Use pci_host_probe() to register host Date: Fri, 22 May 2020 17:48:21 -0600 Message-Id: <20200522234832.954484-5-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200522234832.954484-1-robh@kernel.org> References: <20200522234832.954484-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The brcmstb host driver does the same host registration and bus scanning calls as pci_host_probe, so let's use it instead. Cc: Nicolas Saenz Julienne Cc: bcm-kernel-feedback-list@broadcom.com Cc: linux-rpi-kernel@lists.infradead.org Signed-off-by: Rob Herring Tested-by: Nicolas Saenz Julienne Acked-by: Nicolas Saenz Julienne --- drivers/pci/controller/pcie-brcmstb.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index 7730ea845ff2..15c747c1390a 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -172,7 +172,6 @@ struct brcm_pcie { struct device *dev; void __iomem *base; struct clk *clk; - struct pci_bus *root_bus; struct device_node *np; bool ssc; int gen; @@ -919,9 +918,10 @@ static void __brcm_pcie_remove(struct brcm_pcie *pcie) static int brcm_pcie_remove(struct platform_device *pdev) { struct brcm_pcie *pcie = platform_get_drvdata(pdev); + struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie); - pci_stop_root_bus(pcie->root_bus); - pci_remove_root_bus(pcie->root_bus); + pci_stop_root_bus(bridge->bus); + pci_remove_root_bus(bridge->bus); __brcm_pcie_remove(pcie); return 0; @@ -933,7 +933,6 @@ static int brcm_pcie_probe(struct platform_device *pdev) struct pci_host_bridge *bridge; struct device_node *fw_np; struct brcm_pcie *pcie; - struct pci_bus *child; struct resource *res; int ret; @@ -1004,20 +1003,9 @@ static int brcm_pcie_probe(struct platform_device *pdev) bridge->map_irq = of_irq_parse_and_map_pci; bridge->swizzle_irq = pci_common_swizzle; - ret = pci_scan_root_bus_bridge(bridge); - if (ret < 0) { - dev_err(pcie->dev, "Scanning root bridge failed\n"); - goto fail; - } - - pci_assign_unassigned_bus_resources(bridge->bus); - list_for_each_entry(child, &bridge->bus->children, node) - pcie_bus_configure_settings(child); - pci_bus_add_devices(bridge->bus); platform_set_drvdata(pdev, pcie); - pcie->root_bus = bridge->bus; - return 0; + return pci_host_probe(bridge); fail: __brcm_pcie_remove(pcie); return ret; From patchwork Fri May 22 23:48:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1296540 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49TNVK52C9z9sRK for ; Sat, 23 May 2020 09:48:41 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387406AbgEVXsl (ORCPT ); Fri, 22 May 2020 19:48:41 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:42509 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387412AbgEVXsk (ORCPT ); Fri, 22 May 2020 19:48:40 -0400 Received: by mail-io1-f68.google.com with SMTP id d5so3835108ios.9 for ; Fri, 22 May 2020 16:48:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RDGTHJtHoujJlH0xuipOO/+33SMsAgY/ZHK2re0dJMA=; b=pOYL+cVma5GK+8zc8ssnTtw+zaw7UXDjGEhmK3NMEAlunh1uyBdrAgfSPWwfYrbCp+ xDf7vdSsEkwASOxE6M7VAAUH1gficeWC2MSWD+5F0EaA5AuxZrKYbB8Pe5t3V6TLEjzi lHalcEQShUxbkPrOpakmS/7B7o9iHtzYFf6dl77l8VrHhjWXE94OhGiYy7LjLxDAS1Tb a1nyXtumGxbHLyTnsJXo+Xz90EZRPemO1H80D1iE9bvTjCKkH1Fs547R+pzQa9R7nmXw 8j8yPUI3qze18zow0HPlaRuf7/6ZBE5+ac04AEc4sQga/I9FTg15zgRRIK32GK2Ixbdr B8JA== X-Gm-Message-State: AOAM532gtAbZi+g4jNAMQqVzSl7jVf7dranPQUDkvJKQlI0tt+hQcIUU ZDjM76+bBPy+9e45ZGsYNg== X-Google-Smtp-Source: ABdhPJyqxau5tXcv4nxZOzDxI5Uzfaw3Xu8Y/R/qSeDfpABcMfVTrSAct3cO36GKdKu07xo63/tr1g== X-Received: by 2002:a5d:8a01:: with SMTP id w1mr5106567iod.71.1590191319312; Fri, 22 May 2020 16:48:39 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.252]) by smtp.googlemail.com with ESMTPSA id w23sm4390877iod.9.2020.05.22.16.48.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 16:48:38 -0700 (PDT) From: Rob Herring To: Lorenzo Pieralisi Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Karthikeyan Mitran , Hou Zhiqiang Subject: [PATCH 05/15] PCI: mobiveil: Use pci_host_probe() to register host Date: Fri, 22 May 2020 17:48:22 -0600 Message-Id: <20200522234832.954484-6-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200522234832.954484-1-robh@kernel.org> References: <20200522234832.954484-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The mobiveil host driver does the same host registration and bus scanning calls as pci_host_probe, so let's use it instead. Cc: Karthikeyan Mitran Cc: Hou Zhiqiang Signed-off-by: Rob Herring --- .../pci/controller/mobiveil/pcie-mobiveil-host.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c index 5907baa9b1f2..5974619811ec 100644 --- a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c @@ -569,8 +569,6 @@ int mobiveil_pcie_host_probe(struct mobiveil_pcie *pcie) struct mobiveil_root_port *rp = &pcie->rp; struct pci_host_bridge *bridge = rp->bridge; struct device *dev = &pcie->pdev->dev; - struct pci_bus *bus; - struct pci_bus *child; int ret; ret = mobiveil_pcie_parse_dt(pcie); @@ -620,17 +618,5 @@ int mobiveil_pcie_host_probe(struct mobiveil_pcie *pcie) return ret; } - /* setup the kernel resources for the newly added PCIe root bus */ - ret = pci_scan_root_bus_bridge(bridge); - if (ret) - return ret; - - bus = bridge->bus; - - pci_assign_unassigned_bus_resources(bus); - list_for_each_entry(child, &bus->children, node) - pcie_bus_configure_settings(child); - pci_bus_add_devices(bus); - - return 0; + return pci_host_probe(bridge); } From patchwork Fri May 22 23:48:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1296544 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49TNVP0thBz9sRK for ; Sat, 23 May 2020 09:48:45 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387425AbgEVXsn (ORCPT ); Fri, 22 May 2020 19:48:43 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:39239 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387413AbgEVXsm (ORCPT ); Fri, 22 May 2020 19:48:42 -0400 Received: by mail-io1-f67.google.com with SMTP id q129so4206165iod.6; Fri, 22 May 2020 16:48:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UVLALo+Rw4G28pn8E/Fr1iTDsfsUKpN35tQ7eb98FMg=; b=kBYJ75pXlKxk7Kg2+8PUlP8ezH4TADIErDx/Y+jy1z8XVqs4nB3fQe//hdheAznJZx bppRgxaqLnzLM9RpJdmzaizyQb0jxRNXD0Ov5zFVnHxCi5Zoi13BPOSP17OJhOg4EIvR +IE5hRGqBGbqNQaSo4Hi1fBaxTrGUQqSYEX6H4c0em4iGovTRXQ7cPqQWUi38lrst4tA PD0l0+0JKRc4uMeUoSUrdC+EWU6y538uCFoeqdXZSHIhZqETqSxC5o2l3zAe7SYpLl2Z dagabO0mVYG+rEn2u7NfIauv3tezA/zzwHgfJVJVsXIQ3Z/K9YI2yTahsbQZRN8Pr9jp FB3w== X-Gm-Message-State: AOAM530+Zqw7qBEEYLtd1AhaPfbNLeNVipMD3EiXmJmMQXyHXeAK8QDz LHgTTjb0Efe7DQTF+B7d7dcZmhU= X-Google-Smtp-Source: ABdhPJzSme6sM1qHBaImIWc5kpH40B37+rjqfkGC+CAaVZMzhxyay108QnlcxCdxriE8AeY4K14g7w== X-Received: by 2002:a5d:8613:: with SMTP id f19mr5238435iol.173.1590191320399; Fri, 22 May 2020 16:48:40 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.252]) by smtp.googlemail.com with ESMTPSA id w23sm4390877iod.9.2020.05.22.16.48.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 16:48:39 -0700 (PDT) From: Rob Herring To: Lorenzo Pieralisi Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thierry Reding , Jonathan Hunter , linux-tegra@vger.kernel.org Subject: [PATCH 06/15] PCI: tegra: Use pci_host_probe() to register host Date: Fri, 22 May 2020 17:48:23 -0600 Message-Id: <20200522234832.954484-7-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200522234832.954484-1-robh@kernel.org> References: <20200522234832.954484-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The tegra host driver does the same host registration and bus scanning calls as pci_host_probe, so let's use it instead. Cc: Thierry Reding Cc: Jonathan Hunter Cc: linux-tegra@vger.kernel.org Signed-off-by: Rob Herring --- drivers/pci/controller/pci-tegra.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c index e3e917243e10..3cae96dfe75d 100644 --- a/drivers/pci/controller/pci-tegra.c +++ b/drivers/pci/controller/pci-tegra.c @@ -2670,7 +2670,6 @@ static int tegra_pcie_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct pci_host_bridge *host; struct tegra_pcie *pcie; - struct pci_bus *child; struct resource *bus; int err; @@ -2721,20 +2720,12 @@ static int tegra_pcie_probe(struct platform_device *pdev) host->map_irq = tegra_pcie_map_irq; host->swizzle_irq = pci_common_swizzle; - err = pci_scan_root_bus_bridge(host); + err = pci_host_probe(host); if (err < 0) { dev_err(dev, "failed to register host: %d\n", err); goto pm_runtime_put; } - pci_bus_size_bridges(host->bus); - pci_bus_assign_resources(host->bus); - - list_for_each_entry(child, &host->bus->children, node) - pcie_bus_configure_settings(child); - - pci_bus_add_devices(host->bus); - if (IS_ENABLED(CONFIG_DEBUG_FS)) { err = tegra_pcie_debugfs_init(pcie); if (err < 0) From patchwork Fri May 22 23:48:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1296543 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49TNVN5Mjpz9sRf for ; Sat, 23 May 2020 09:48:44 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387417AbgEVXsn (ORCPT ); Fri, 22 May 2020 19:48:43 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:39998 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387412AbgEVXsm (ORCPT ); Fri, 22 May 2020 19:48:42 -0400 Received: by mail-io1-f67.google.com with SMTP id q8so11951983iow.7 for ; Fri, 22 May 2020 16:48:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J45nDshYNcYrGRYkIpqQuCHqEq06Xr5wTtd6CkH1TKQ=; b=Px6KCRkXqteLcDbFVtgCfHUK/6jarc22FmaA1LCHeTChauwPqO3TTx/tBSGMpDvtGn nq+WeRDTzJyPXQWg6+cQ9gyPkbc0RwdREDo6osB50S6Q9kW64/or4Qx9ni3MFMhrWqgE MRe/nxtFc4zkzyh1+9Fauy6UmdFkltsVWshEw8Qcl/X1/O1gE+1U2C/GYcst8VbHa1wv zLNdFtOvpcBIHwBPWooJl51zC7OsdW/1sHMqEjSi02qWDwCZOBEneb5NZ4OKBtemEuMc zUgPtnrnif+JqIMoiSEByPDcQQlBzde2QjgAF7/jlSzdEnCBqguCrY/Sqsi5psVQ5Bij 7L9A== X-Gm-Message-State: AOAM531h4j67vgHAXkNJqvKCt+MfTHuNYly97ne2uEotaFsqGbRQKsCo hbQiahnMbMLT0raVoAqIyg== X-Google-Smtp-Source: ABdhPJwvpizplNylsZ+mOBoLddCdqOsvUiQzZKpGEl+BV1UIE2Xf70za28p9484+5NSevVTlVtJ7jw== X-Received: by 2002:a5e:cb4d:: with SMTP id h13mr5172992iok.141.1590191321380; Fri, 22 May 2020 16:48:41 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.252]) by smtp.googlemail.com with ESMTPSA id w23sm4390877iod.9.2020.05.22.16.48.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 16:48:40 -0700 (PDT) From: Rob Herring To: Lorenzo Pieralisi Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linus Walleij Subject: [PATCH 07/15] PCI: v3: Use pci_host_probe() to register host Date: Fri, 22 May 2020 17:48:24 -0600 Message-Id: <20200522234832.954484-8-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200522234832.954484-1-robh@kernel.org> References: <20200522234832.954484-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The v3 host driver does the same host registration and bus scanning calls as pci_host_probe, so let's use it instead. Cc: Linus Walleij Signed-off-by: Rob Herring Reviewed-by: Linus Walleij --- drivers/pci/controller/pci-v3-semi.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/pci/controller/pci-v3-semi.c b/drivers/pci/controller/pci-v3-semi.c index 3681e5af3878..198cf2c6ed92 100644 --- a/drivers/pci/controller/pci-v3-semi.c +++ b/drivers/pci/controller/pci-v3-semi.c @@ -239,7 +239,6 @@ struct v3_pci { struct device *dev; void __iomem *base; void __iomem *config_base; - struct pci_bus *bus; u32 config_mem; u32 non_pre_mem; u32 pre_mem; @@ -904,17 +903,7 @@ static int v3_pci_probe(struct platform_device *pdev) val |= V3_SYSTEM_M_LOCK; writew(val, v3->base + V3_SYSTEM); - ret = pci_scan_root_bus_bridge(host); - if (ret) { - dev_err(dev, "failed to register host: %d\n", ret); - return ret; - } - v3->bus = host->bus; - - pci_bus_assign_resources(v3->bus); - pci_bus_add_devices(v3->bus); - - return 0; + return pci_host_probe(host); } static const struct of_device_id v3_pci_of_match[] = { From patchwork Fri May 22 23:48:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1296542 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49TNVN2lNLz9sRY for ; Sat, 23 May 2020 09:48:44 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387418AbgEVXsn (ORCPT ); Fri, 22 May 2020 19:48:43 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:46669 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387417AbgEVXsn (ORCPT ); Fri, 22 May 2020 19:48:43 -0400 Received: by mail-io1-f66.google.com with SMTP id j8so13282662iog.13 for ; Fri, 22 May 2020 16:48:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Hu+r9D87KcoWa189MTy6Edmp4pidtqObZuiMTiz4cgc=; b=L4gL4OhXYE7nUbH8ZJhp2KcFZegEglt3DHqsRDYKeBj1PlCqZutN5y60NhBJL3mDEt GoU23aTdnWGL9Yt3cHTbbh85rNMlxpvFPMRlzsKrU8Ks/7mZdv0qKogLcqoGHbjmJ2LB k2wEy4yS9hFrouhju9KP13zg2xf68ztNExU0iTp3lI8p8G9ciqxJ54Mh+aJJ9lpkb52q mKY8ENX+SA+RVXaVes3AU+cgOJRLZSYcEKR3oEwB4LpCSiipgmQYqvkNGEWkCNr9HokL IPtbrf049HRMA3cuKxmUXyrGvZg07pE5yBnu4KRfoaQYnqiA/LkTLPpB3VIX0mb361Uh RAYA== X-Gm-Message-State: AOAM530G1sEv/JpxoP9vJFjGRNtyn33qbFOP1xaxGDhD8Kf1KCr6J5Dw 9VsWg2JSbaWIlP5ATeFENQ== X-Google-Smtp-Source: ABdhPJzvS3aCPPD+k4N9FAiNd4VPWGqJzq7xAINIEBc8KXR6heifVNZNNeQbLmVhFEJExzb4WHJESg== X-Received: by 2002:a6b:bc85:: with SMTP id m127mr5019308iof.89.1590191322407; Fri, 22 May 2020 16:48:42 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.252]) by smtp.googlemail.com with ESMTPSA id w23sm4390877iod.9.2020.05.22.16.48.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 16:48:41 -0700 (PDT) From: Rob Herring To: Lorenzo Pieralisi Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 08/15] PCI: versatile: Use pci_host_probe() to register host Date: Fri, 22 May 2020 17:48:25 -0600 Message-Id: <20200522234832.954484-9-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200522234832.954484-1-robh@kernel.org> References: <20200522234832.954484-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The versatile host driver does the same host registration and bus scanning calls as pci_host_probe, so let's use it instead. Cc: Lorenzo Pieralisi Signed-off-by: Rob Herring --- drivers/pci/controller/pci-versatile.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/pci/controller/pci-versatile.c b/drivers/pci/controller/pci-versatile.c index b911359b6d81..e90f0cc65c73 100644 --- a/drivers/pci/controller/pci-versatile.c +++ b/drivers/pci/controller/pci-versatile.c @@ -70,7 +70,6 @@ static int versatile_pci_probe(struct platform_device *pdev) int ret, i, myslot = -1, mem = 1; u32 val; void __iomem *local_pci_cfg_base; - struct pci_bus *bus, *child; struct pci_host_bridge *bridge; bridge = devm_pci_alloc_host_bridge(dev, 0); @@ -164,18 +163,7 @@ static int versatile_pci_probe(struct platform_device *pdev) bridge->map_irq = of_irq_parse_and_map_pci; bridge->swizzle_irq = pci_common_swizzle; - ret = pci_scan_root_bus_bridge(bridge); - if (ret < 0) - return ret; - - bus = bridge->bus; - - pci_assign_unassigned_bus_resources(bus); - list_for_each_entry(child, &bus->children, node) - pcie_bus_configure_settings(child); - pci_bus_add_devices(bus); - - return 0; + return pci_host_probe(bridge); } static const struct of_device_id versatile_pci_of_match[] = { From patchwork Fri May 22 23:48:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1296545 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49TNVP4y3Fz9sRY for ; Sat, 23 May 2020 09:48:45 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387427AbgEVXsp (ORCPT ); Fri, 22 May 2020 19:48:45 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:46669 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387412AbgEVXso (ORCPT ); Fri, 22 May 2020 19:48:44 -0400 Received: by mail-io1-f65.google.com with SMTP id j8so13282692iog.13 for ; Fri, 22 May 2020 16:48:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=esB6b61apNwpYj2Ii2qJBKmfmJ2cKVbjKA7d7D0yxhA=; b=KMAXyptnOOV365s46hLTHSJ/N4D0wcAkoPvpeBpl3O75WqWvmLSyLfyGwVC0wDf0Xm OWODfjyGLTck76RMFi0f/vAbMGV+AKXW8EC9c5SDBvjVKuo++hrCQYJwOSm0YKcu7JJX vs3IF3tCPrqq4luhrl6tQ33YVsn9ypfTHW0LiNS1l88rKKmnwDugwh36LCtIdoCXUem4 9WMbARaUZKN+Ui2Ms/Ge9dPFENLPf9OVGfzViw5eWfW9qJqxB9Ll79f95JsNDKCS1sGE zA80h5k4QuKUR4FRcE9uTC2SF5+8m7oSoeES3PzY0kIzJzWr3DcKtmAXKxe6OP+lEgQI uQyQ== X-Gm-Message-State: AOAM530kUuI8gmf9VqbcWa/8X4nyTIWY3D3f54VVg2bd8EVveAN50ybZ riAocRyHCDaGCcfKvNg+8w== X-Google-Smtp-Source: ABdhPJyNYc9vzogrqFrsqVMURFj3X5uQdcgBg6RgjMS5Fz1B6QbL79L43BEqeIa+lFhIECyX99pQFw== X-Received: by 2002:a6b:5008:: with SMTP id e8mr5162852iob.161.1590191323471; Fri, 22 May 2020 16:48:43 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.252]) by smtp.googlemail.com with ESMTPSA id w23sm4390877iod.9.2020.05.22.16.48.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 16:48:42 -0700 (PDT) From: Rob Herring To: Lorenzo Pieralisi Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Toan Le Subject: [PATCH 09/15] PCI: xgene: Use pci_host_probe() to register host Date: Fri, 22 May 2020 17:48:26 -0600 Message-Id: <20200522234832.954484-10-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200522234832.954484-1-robh@kernel.org> References: <20200522234832.954484-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The xgene host driver does the same host registration and bus scanning calls as pci_host_probe, so let's use it instead. Cc: Toan Le Signed-off-by: Rob Herring --- drivers/pci/controller/pci-xgene.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/pci/controller/pci-xgene.c b/drivers/pci/controller/pci-xgene.c index d1efa8ffbae1..5aee802946cb 100644 --- a/drivers/pci/controller/pci-xgene.c +++ b/drivers/pci/controller/pci-xgene.c @@ -591,7 +591,6 @@ static int xgene_pcie_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device_node *dn = dev->of_node; struct xgene_pcie_port *port; - struct pci_bus *bus, *child; struct pci_host_bridge *bridge; int ret; @@ -632,17 +631,7 @@ static int xgene_pcie_probe(struct platform_device *pdev) bridge->map_irq = of_irq_parse_and_map_pci; bridge->swizzle_irq = pci_common_swizzle; - ret = pci_scan_root_bus_bridge(bridge); - if (ret < 0) - return ret; - - bus = bridge->bus; - - pci_assign_unassigned_bus_resources(bus); - list_for_each_entry(child, &bus->children, node) - pcie_bus_configure_settings(child); - pci_bus_add_devices(bus); - return 0; + return pci_host_probe(bridge); } static const struct of_device_id xgene_pcie_match_table[] = { From patchwork Fri May 22 23:48:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1296546 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49TNVQ5S23z9sRK for ; Sat, 23 May 2020 09:48:46 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387412AbgEVXsq (ORCPT ); Fri, 22 May 2020 19:48:46 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:45027 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387413AbgEVXsp (ORCPT ); Fri, 22 May 2020 19:48:45 -0400 Received: by mail-io1-f68.google.com with SMTP id f4so13286573iov.11 for ; Fri, 22 May 2020 16:48:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=A2f+A+UJfY1PJTDNi0NFbPeTlvbbCc37QATxTjmUPVg=; b=Y9KupFWxtqpfaSRNOczCJuVf2El072vmF38hxAvllioQadtOmMC3SAKJ/yc5l2TI0t /ZhSl1kMWlFZAtKJHdXisEJZbUTg080VpoiorEiI3OOA0Mq+VGCBBKpjGJYU9w0X8wf7 0L7uKr1uP0Qx7g2pUeUWH6/hqA944x4kADVUEkdwElvL9qCmFo6dCxTpUy2LKpKL0/rn nLTrO/tHGSEQdhKh0/UJWsEZTd6Bxfy0XXG2khwlbkvua5ZEHZWEe+6VGw8R5w0D/GWM AhJ15k++7HHw/X/ReuSIl5JC43HOQJQ5Eb0H8M4+dIPOVDnhyFpi56XcnMAY/89vRror x/2A== X-Gm-Message-State: AOAM533ZZo0qa5F+z6EtgFxcKNky52Srr6y8c8SL2LkC+dp4R5ionJCd 8ZcQz9pqczDZSYa0Hdunzw== X-Google-Smtp-Source: ABdhPJz0drAdXL8tOrdvka5OuWYdrXyPsukcMKwJDfVFN/ZlnqO01gwrcMTn1syXCMOnmaFNfmE11w== X-Received: by 2002:a5d:9e55:: with SMTP id i21mr3535285ioi.130.1590191324652; Fri, 22 May 2020 16:48:44 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.252]) by smtp.googlemail.com with ESMTPSA id w23sm4390877iod.9.2020.05.22.16.48.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 16:48:43 -0700 (PDT) From: Rob Herring To: Lorenzo Pieralisi Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ley Foon Tan , rfi@lists.rocketboards.org Subject: [PATCH 10/15] PCI: altera: Use pci_host_probe() to register host Date: Fri, 22 May 2020 17:48:27 -0600 Message-Id: <20200522234832.954484-11-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200522234832.954484-1-robh@kernel.org> References: <20200522234832.954484-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The altera host driver does the same host registration and bus scanning calls as pci_host_probe, so let's use it instead. The only difference is pci_assign_unassigned_bus_resources() was called instead of pci_bus_size_bridges() and pci_bus_assign_resources(). This should be the same. Cc: Ley Foon Tan Cc: rfi@lists.rocketboards.org Signed-off-by: Rob Herring Reviewed-by: Ley Foon Tan --- drivers/pci/controller/pcie-altera.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/drivers/pci/controller/pcie-altera.c b/drivers/pci/controller/pcie-altera.c index 24cb1c331058..26ac3ad81de0 100644 --- a/drivers/pci/controller/pcie-altera.c +++ b/drivers/pci/controller/pcie-altera.c @@ -773,8 +773,6 @@ static int altera_pcie_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct altera_pcie *pcie; - struct pci_bus *bus; - struct pci_bus *child; struct pci_host_bridge *bridge; int ret; const struct of_device_id *match; @@ -825,20 +823,7 @@ static int altera_pcie_probe(struct platform_device *pdev) bridge->map_irq = of_irq_parse_and_map_pci; bridge->swizzle_irq = pci_common_swizzle; - ret = pci_scan_root_bus_bridge(bridge); - if (ret < 0) - return ret; - - bus = bridge->bus; - - pci_assign_unassigned_bus_resources(bus); - - /* Configure PCI Express setting. */ - list_for_each_entry(child, &bus->children, node) - pcie_bus_configure_settings(child); - - pci_bus_add_devices(bus); - return ret; + return pci_host_probe(bridge); } static int altera_pcie_remove(struct platform_device *pdev) From patchwork Fri May 22 23:48:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1296547 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49TNVR5sVYz9sRK for ; Sat, 23 May 2020 09:48:47 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387433AbgEVXsr (ORCPT ); Fri, 22 May 2020 19:48:47 -0400 Received: from mail-il1-f195.google.com ([209.85.166.195]:40029 "EHLO mail-il1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387413AbgEVXsq (ORCPT ); Fri, 22 May 2020 19:48:46 -0400 Received: by mail-il1-f195.google.com with SMTP id m6so12482789ilq.7 for ; Fri, 22 May 2020 16:48:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=I6AdS/TZXzVwZhaj3XeZ8pHwXrcTg21qPzTXuwbZXTY=; b=N/AvX3Ocm6Lk+CwzFRSPwCMUOreBCus+qc+CBAjqbDC2D5XMHciTmd6vVl7xImp7qM EWUEwLVycln6xDL7fWdwKR8eIJmYLFTv6j/CUU67IgTcG3dGc7it8A4MBhH1VlkcITTm BzsYOkeX0kejJBBPsIneaVCC9X4bV5oSjjDjcq5Hd1nO0h+kQIKZGF54oqnjt58E8mk0 CDacpUiT5Ihfbw1OTSdl+vXCGKNLeekqF/VXmnmPaodCIzXkrA0uw4n7A3vyxs/eCg9c utMf3TeoHvpvs8WhZ+RHNbMOmQZAXM3WQuRm7VgIRUcUpHRX/7j95zIyWc07Z52q82Zh QJYA== X-Gm-Message-State: AOAM531ItKvgbu+m2lfs0cP/m/NOeHmS5G+Tqgb7F9D9Rq4uu94SXmx/ 5tXC5aoH8i7n1QPdHWk8Yw== X-Google-Smtp-Source: ABdhPJx+ueXcTjl20AOza8BrHvDbmua+rc9aHmFgQKv5RD1ZcW5dKvkYfx+vLS94kC3TUkSvYVHV9w== X-Received: by 2002:a92:aa53:: with SMTP id j80mr15676503ili.299.1590191325856; Fri, 22 May 2020 16:48:45 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.252]) by smtp.googlemail.com with ESMTPSA id w23sm4390877iod.9.2020.05.22.16.48.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 16:48:45 -0700 (PDT) From: Rob Herring To: Lorenzo Pieralisi Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com Subject: [PATCH 11/15] PCI: iproc: Use pci_host_probe() to register host Date: Fri, 22 May 2020 17:48:28 -0600 Message-Id: <20200522234832.954484-12-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200522234832.954484-1-robh@kernel.org> References: <20200522234832.954484-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The iproc host driver does the same host registration and bus scanning calls as pci_host_probe, so let's use it instead. The only difference is pci_assign_unassigned_bus_resources() was called instead of pci_bus_size_bridges() and pci_bus_assign_resources(). This should be the same. Cc: Lorenzo Pieralisi Cc: Ray Jui Cc: Scott Branden Cc: bcm-kernel-feedback-list@broadcom.com Signed-off-by: Rob Herring Acked-by: Scott Branden --- drivers/pci/controller/pcie-iproc.c | 18 +++++------------- drivers/pci/controller/pcie-iproc.h | 2 -- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/pci/controller/pcie-iproc.c b/drivers/pci/controller/pcie-iproc.c index 8c7f875acf7f..232fca0754e1 100644 --- a/drivers/pci/controller/pcie-iproc.c +++ b/drivers/pci/controller/pcie-iproc.c @@ -1470,7 +1470,6 @@ int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res) { struct device *dev; int ret; - struct pci_bus *child; struct pci_host_bridge *host = pci_host_bridge_from_priv(pcie); dev = pcie->dev; @@ -1531,21 +1530,12 @@ int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res) host->map_irq = pcie->map_irq; host->swizzle_irq = pci_common_swizzle; - ret = pci_scan_root_bus_bridge(host); + ret = pci_host_probe(host); if (ret < 0) { dev_err(dev, "failed to scan host: %d\n", ret); goto err_power_off_phy; } - pci_assign_unassigned_bus_resources(host->bus); - - pcie->root_bus = host->bus; - - list_for_each_entry(child, &host->bus->children, node) - pcie_bus_configure_settings(child); - - pci_bus_add_devices(host->bus); - return 0; err_power_off_phy: @@ -1558,8 +1548,10 @@ EXPORT_SYMBOL(iproc_pcie_setup); int iproc_pcie_remove(struct iproc_pcie *pcie) { - pci_stop_root_bus(pcie->root_bus); - pci_remove_root_bus(pcie->root_bus); + struct pci_host_bridge *host = pci_host_bridge_from_priv(pcie); + + pci_stop_root_bus(host->bus); + pci_remove_root_bus(host->bus); iproc_pcie_msi_disable(pcie); diff --git a/drivers/pci/controller/pcie-iproc.h b/drivers/pci/controller/pcie-iproc.h index 4f03ea539805..c2676e442f55 100644 --- a/drivers/pci/controller/pcie-iproc.h +++ b/drivers/pci/controller/pcie-iproc.h @@ -54,7 +54,6 @@ struct iproc_msi; * @reg_offsets: register offsets * @base: PCIe host controller I/O register base * @base_addr: PCIe host controller register base physical address - * @root_bus: pointer to root bus * @phy: optional PHY device that controls the Serdes * @map_irq: function callback to map interrupts * @ep_is_internal: indicates an internal emulated endpoint device is connected @@ -85,7 +84,6 @@ struct iproc_pcie { void __iomem *base; phys_addr_t base_addr; struct resource mem; - struct pci_bus *root_bus; struct phy *phy; int (*map_irq)(const struct pci_dev *, u8, u8); bool ep_is_internal; From patchwork Fri May 22 23:48:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1296549 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49TNVV1YsZz9sRY for ; Sat, 23 May 2020 09:48:50 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387436AbgEVXst (ORCPT ); Fri, 22 May 2020 19:48:49 -0400 Received: from mail-il1-f194.google.com ([209.85.166.194]:44165 "EHLO mail-il1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387434AbgEVXst (ORCPT ); Fri, 22 May 2020 19:48:49 -0400 Received: by mail-il1-f194.google.com with SMTP id j3so12440152ilk.11; Fri, 22 May 2020 16:48:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l8MKWOkTFOUck/e3qV/n3PXjrwRqiBK3sTxqSf9d7+Q=; b=bLZniJ8WydzuYPzXs1VjZ+NHffjnZ0kZP+zvjKM0AaYIYG78Jzn1Q6Hs9zNZv+IekH WnHC3qxaMMCfrx3sDpeopJlbVx7Nstyq7J917nB34Hl0W/Qt3CJwAIpusMweoXPkGq+S kzE2ACnA/7H77xIuYiTh28VbJpb1nrDTUXxAFpiklAee541EE787VuS3nFPy5SZEt7V2 Z8Gk99I/YRBICGborp0XWHtzx11UY2LbILViCmdi97hCfc1gBrMbjbHVykwOXqrQRkdD 5Sc0StJxhru++GDu5c/Brt9S+WERlXXvNpndakIxrM4lW8Q1eQzmRr9tee0xb01zm8+W Rv0g== X-Gm-Message-State: AOAM532T40FfaLSX21Qt4J/nDviQUeaOi4lLkCZxjFHP0+UtfcHEB1si NSRbOr2uvKOEmx3ApNNCj/KuQBI= X-Google-Smtp-Source: ABdhPJxg5S2neYCB/6X3dzr3jwkcGSeZrpPJj0feTh/FWKaNYA2PpAUBHLVyiHOLA6yr38KykqSK5Q== X-Received: by 2002:a92:9e16:: with SMTP id q22mr15130162ili.17.1590191326864; Fri, 22 May 2020 16:48:46 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.252]) by smtp.googlemail.com with ESMTPSA id w23sm4390877iod.9.2020.05.22.16.48.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 16:48:46 -0700 (PDT) From: Rob Herring To: Lorenzo Pieralisi Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Marek Vasut , Yoshihiro Shimoda , linux-renesas-soc@vger.kernel.org Subject: [PATCH 12/15] PCI: rcar: Use pci_host_probe() to register host Date: Fri, 22 May 2020 17:48:29 -0600 Message-Id: <20200522234832.954484-13-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200522234832.954484-1-robh@kernel.org> References: <20200522234832.954484-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The rcar host driver does the same host registration and bus scanning calls as pci_host_probe, so let's use it instead. Cc: Marek Vasut Cc: Yoshihiro Shimoda Cc: linux-renesas-soc@vger.kernel.org Signed-off-by: Rob Herring Reviewed-by: Geert Uytterhoeven --- drivers/pci/controller/pcie-rcar-host.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/pci/controller/pcie-rcar-host.c b/drivers/pci/controller/pcie-rcar-host.c index d210a36561be..9069ad96fe95 100644 --- a/drivers/pci/controller/pcie-rcar-host.c +++ b/drivers/pci/controller/pcie-rcar-host.c @@ -330,8 +330,6 @@ static int rcar_pcie_enable(struct rcar_pcie_host *host) struct pci_host_bridge *bridge = pci_host_bridge_from_priv(host); struct rcar_pcie *pcie = &host->pcie; struct device *dev = pcie->dev; - struct pci_bus *bus, *child; - int ret; /* Try setting 5 GT/s link speed */ rcar_pcie_force_speedup(pcie); @@ -349,21 +347,7 @@ static int rcar_pcie_enable(struct rcar_pcie_host *host) if (IS_ENABLED(CONFIG_PCI_MSI)) bridge->msi = &host->msi.chip; - ret = pci_scan_root_bus_bridge(bridge); - if (ret < 0) - return ret; - - bus = bridge->bus; - - pci_bus_size_bridges(bus); - pci_bus_assign_resources(bus); - - list_for_each_entry(child, &bus->children, node) - pcie_bus_configure_settings(child); - - pci_bus_add_devices(bus); - - return 0; + return pci_host_probe(bridge); } static int phy_wait_for_ack(struct rcar_pcie *pcie) From patchwork Fri May 22 23:48:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1296548 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49TNVT4WVPz9sRK for ; Sat, 23 May 2020 09:48:49 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387435AbgEVXst (ORCPT ); Fri, 22 May 2020 19:48:49 -0400 Received: from mail-il1-f195.google.com ([209.85.166.195]:46922 "EHLO mail-il1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387413AbgEVXss (ORCPT ); Fri, 22 May 2020 19:48:48 -0400 Received: by mail-il1-f195.google.com with SMTP id w18so12437147ilm.13 for ; Fri, 22 May 2020 16:48:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zH2C4ImO8nBnvyYQO4O7Y0tt8wrJ36q82CPBc6+58Gs=; b=Kqg1cHr7p6LLh9wS6F5EjscfBMwhEmHKsEyyWZeS3mkMqB/AJCmAnaUCOUYCXwRaW1 u8hL8w9TtSEufsdtB8jxDAW/vUWxvQRD4uyworVVZKDDUHr5GWvTWGBx5Hun7UC/i3pU yWLLehIrzOj+DT3sXDruaqp42RBhpwipLP79w6niX89ZcWa/bg+nuP30O8TIVbYxMWJz GVvCMMTlMJgsZIFMZqi1HOUmOVMvn0lKFSEt5CpFunc+P0lDNubRFEli3q94Fxqgduyt p4eE80WTdxuDGSlxZFxnVOalkteVr4W/q1uC3YXUIriBgxEOaeZnrv5Z/Rr8cRvCuPPm Ds3A== X-Gm-Message-State: AOAM530IaFCKpcnJlCFauAyaKJXXQtKid3y8BmSk5/yEydHc06VnJTz5 gn310Rlzxoqr+cC6Uwe28g== X-Google-Smtp-Source: ABdhPJybuB2O9NZz3pehcS6OOH6aSsjmBYbiZ8trb6adP3sKcXHHx5eDTRdxXxjc/F2eV1Dz4MmC9g== X-Received: by 2002:a92:c94f:: with SMTP id i15mr14637382ilq.185.1590191327879; Fri, 22 May 2020 16:48:47 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.252]) by smtp.googlemail.com with ESMTPSA id w23sm4390877iod.9.2020.05.22.16.48.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 16:48:47 -0700 (PDT) From: Rob Herring To: Lorenzo Pieralisi Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Shawn Lin , Heiko Stuebner , linux-rockchip@lists.infradead.org Subject: [PATCH 13/15] PCI: rockchip: Use pci_host_probe() to register host Date: Fri, 22 May 2020 17:48:30 -0600 Message-Id: <20200522234832.954484-14-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200522234832.954484-1-robh@kernel.org> References: <20200522234832.954484-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The rockchip host driver does the same host registration and bus scanning calls as pci_host_probe, so let's use it instead. Cc: Shawn Lin Cc: Heiko Stuebner Cc: linux-rockchip@lists.infradead.org Signed-off-by: Rob Herring --- drivers/pci/controller/pcie-rockchip-host.c | 18 ++++-------------- drivers/pci/controller/pcie-rockchip.h | 1 - 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/pci/controller/pcie-rockchip-host.c b/drivers/pci/controller/pcie-rockchip-host.c index 94af6f5828a3..6a3c8442258b 100644 --- a/drivers/pci/controller/pcie-rockchip-host.c +++ b/drivers/pci/controller/pcie-rockchip-host.c @@ -949,7 +949,6 @@ static int rockchip_pcie_probe(struct platform_device *pdev) { struct rockchip_pcie *rockchip; struct device *dev = &pdev->dev; - struct pci_bus *bus, *child; struct pci_host_bridge *bridge; struct resource *bus_res; int err; @@ -1015,20 +1014,10 @@ static int rockchip_pcie_probe(struct platform_device *pdev) bridge->map_irq = of_irq_parse_and_map_pci; bridge->swizzle_irq = pci_common_swizzle; - err = pci_scan_root_bus_bridge(bridge); + err = pci_host_probe(bridge); if (err < 0) goto err_remove_irq_domain; - bus = bridge->bus; - - rockchip->root_bus = bus; - - pci_bus_size_bridges(bus); - pci_bus_assign_resources(bus); - list_for_each_entry(child, &bus->children, node) - pcie_bus_configure_settings(child); - - pci_bus_add_devices(bus); return 0; err_remove_irq_domain: @@ -1051,9 +1040,10 @@ static int rockchip_pcie_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct rockchip_pcie *rockchip = dev_get_drvdata(dev); + struct pci_host_bridge *bridge = pci_host_bridge_from_priv(rockchip); - pci_stop_root_bus(rockchip->root_bus); - pci_remove_root_bus(rockchip->root_bus); + pci_stop_root_bus(bridge->bus); + pci_remove_root_bus(bridge->bus); irq_domain_remove(rockchip->irq_domain); rockchip_pcie_deinit_phys(rockchip); diff --git a/drivers/pci/controller/pcie-rockchip.h b/drivers/pci/controller/pcie-rockchip.h index d90dfb354573..4012543bafbe 100644 --- a/drivers/pci/controller/pcie-rockchip.h +++ b/drivers/pci/controller/pcie-rockchip.h @@ -303,7 +303,6 @@ struct rockchip_pcie { struct device *dev; struct irq_domain *irq_domain; int offset; - struct pci_bus *root_bus; void __iomem *msg_region; phys_addr_t msg_bus_addr; bool is_rc; From patchwork Fri May 22 23:48:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1296550 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49TNVV6wMBz9sSJ for ; Sat, 23 May 2020 09:48:50 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387438AbgEVXsu (ORCPT ); Fri, 22 May 2020 19:48:50 -0400 Received: from mail-il1-f195.google.com ([209.85.166.195]:42427 "EHLO mail-il1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387413AbgEVXst (ORCPT ); Fri, 22 May 2020 19:48:49 -0400 Received: by mail-il1-f195.google.com with SMTP id 18so12526249iln.9 for ; Fri, 22 May 2020 16:48:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=t2p41fcnPOx/cmrCAPQSy3Fo8KrPmpfN6+RkySuTptI=; b=pU6pC7fpK+mexpvjTKHkGk0kcMmyiHXNZaTL8zwqPgTPOLzm9/Ub9aqGrz6CbpFKjP wM1SrTitSotL2gHIwGKah62m1BmnskGehJBPC8BY+CYKs5sfgzH+kiXLpTd87Lwktz80 94zfrLa6XJ/xeGYfBl941Uo5C10ykpBRLYt5AqWccIWk+xav3nbeCoU2p7DVCtQq/XOv mCChcoUy8mRhVOTFz+tESkItEgHzGqwWipuuXLDoEY8BAZ9nGw3OjfUU7sih9WBct245 RQASY82kK4N81KnzkKD2Iyurt3FOLWmTKvekLYUhA+zQgZPWDsRlsudaGahefwQVe/ty g97w== X-Gm-Message-State: AOAM5312WTzFBMFcN3rEJh7Lwxc4mR27Z+wPkoL6fhOwz1Mt6c7zTCv/ 0rgCD5BZCYndCAM/Pe46mg== X-Google-Smtp-Source: ABdhPJxJb8uMVFTBmE5EjVEFecM8hhfGGfXlSi7Mekr5euEb9ImK+hXgQFJSBd65bfpss/2gmn1F4A== X-Received: by 2002:a92:8d49:: with SMTP id s70mr15410384ild.54.1590191328942; Fri, 22 May 2020 16:48:48 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.252]) by smtp.googlemail.com with ESMTPSA id w23sm4390877iod.9.2020.05.22.16.48.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 16:48:48 -0700 (PDT) From: Rob Herring To: Lorenzo Pieralisi Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michal Simek Subject: [PATCH 14/15] PCI: xilinx-nwl: Use pci_host_probe() to register host Date: Fri, 22 May 2020 17:48:31 -0600 Message-Id: <20200522234832.954484-15-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200522234832.954484-1-robh@kernel.org> References: <20200522234832.954484-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The xilinx-nwl host driver does the same host registration and bus scanning calls as pci_host_probe, so let's use it instead. The only difference is pci_assign_unassigned_bus_resources() was called instead of pci_bus_size_bridges() and pci_bus_assign_resources(). This should be the same. Cc: Michal Simek Signed-off-by: Rob Herring --- drivers/pci/controller/pcie-xilinx-nwl.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/pci/controller/pcie-xilinx-nwl.c b/drivers/pci/controller/pcie-xilinx-nwl.c index 9bd1427f2fd6..32a0b08d6da5 100644 --- a/drivers/pci/controller/pcie-xilinx-nwl.c +++ b/drivers/pci/controller/pcie-xilinx-nwl.c @@ -817,8 +817,6 @@ static int nwl_pcie_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct nwl_pcie *pcie; - struct pci_bus *bus; - struct pci_bus *child; struct pci_host_bridge *bridge; int err; @@ -871,17 +869,7 @@ static int nwl_pcie_probe(struct platform_device *pdev) } } - err = pci_scan_root_bus_bridge(bridge); - if (err) - return err; - - bus = bridge->bus; - - pci_assign_unassigned_bus_resources(bus); - list_for_each_entry(child, &bus->children, node) - pcie_bus_configure_settings(child); - pci_bus_add_devices(bus); - return 0; + return pci_host_probe(bridge); } static struct platform_driver nwl_pcie_driver = { From patchwork Fri May 22 23:48:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1296551 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49TNVX0Qs0z9sRY for ; Sat, 23 May 2020 09:48:52 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387413AbgEVXsv (ORCPT ); Fri, 22 May 2020 19:48:51 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:34652 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387434AbgEVXsu (ORCPT ); Fri, 22 May 2020 19:48:50 -0400 Received: by mail-io1-f68.google.com with SMTP id f3so13379897ioj.1 for ; Fri, 22 May 2020 16:48:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9jGQ2qLaDHXWpsTIu58oRNqkVRMoBCOunQH7NWW7la4=; b=Qlvnfh922FtfUyuYgA3cwoh7HgVi1+PrBIo2BHst7Yzg4czpYDrmiDJ1dq1BgoYn5T mjes2aofIUDUGrPYhiMfbNSSNYQi3aEVYR0Zdn1Zywio2+TbFVkCIiKnqw2bgzpQQcGz tFXEdGRZ8/a3GNGDM2oQvVuS2L3Ge4tA7zL4Dx+VA69342XiC0M7FXmaW9geka7LmjOw q7b4yVVg3xyM3A+WNvAM7gWrw3HyieRbY8yfA2879tqLsMx06LcpLAEW/pCNT+QC09oa V6+idiUR9ttbxFHbQE8sCGr5+qpz6O+KsiqzDXfMewjv/bBSzK5LCbIINVmvuU83uR9p zpkg== X-Gm-Message-State: AOAM530ekscd+IMkB/Yz57DbKGXAX4WJt6wF5t2HxysuI4DDBQisxaRc O2N4If4XzcchXCgTU5w+eA== X-Google-Smtp-Source: ABdhPJwZp9OVv7GaJiib7zatMqtlUftLOWe6s4BgpqKdDy0qd/frFOVmsmEYghU2qvA8+UlgAn3+0g== X-Received: by 2002:a05:6602:44b:: with SMTP id e11mr5183523iov.62.1590191329933; Fri, 22 May 2020 16:48:49 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.252]) by smtp.googlemail.com with ESMTPSA id w23sm4390877iod.9.2020.05.22.16.48.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 16:48:49 -0700 (PDT) From: Rob Herring To: Lorenzo Pieralisi Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michal Simek Subject: [PATCH 15/15] PCI: xilinx: Use pci_host_probe() to register host Date: Fri, 22 May 2020 17:48:32 -0600 Message-Id: <20200522234832.954484-16-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200522234832.954484-1-robh@kernel.org> References: <20200522234832.954484-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The xilinx host driver does the same host registration and bus scanning calls as pci_host_probe, so let's use it instead. The only difference is pci_assign_unassigned_bus_resources() was called instead of pci_bus_size_bridges() and pci_bus_assign_resources(). This should be the same. Cc: Michal Simek Signed-off-by: Rob Herring --- drivers/pci/controller/pcie-xilinx.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/pci/controller/pcie-xilinx.c b/drivers/pci/controller/pcie-xilinx.c index 98e55297815b..05547497f391 100644 --- a/drivers/pci/controller/pcie-xilinx.c +++ b/drivers/pci/controller/pcie-xilinx.c @@ -616,7 +616,6 @@ static int xilinx_pcie_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct xilinx_pcie_port *port; - struct pci_bus *bus, *child; struct pci_host_bridge *bridge; int err; @@ -663,17 +662,7 @@ static int xilinx_pcie_probe(struct platform_device *pdev) xilinx_pcie_msi_chip.dev = dev; bridge->msi = &xilinx_pcie_msi_chip; #endif - err = pci_scan_root_bus_bridge(bridge); - if (err < 0) - return err; - - bus = bridge->bus; - - pci_assign_unassigned_bus_resources(bus); - list_for_each_entry(child, &bus->children, node) - pcie_bus_configure_settings(child); - pci_bus_add_devices(bus); - return 0; + return pci_host_probe(bridge); } static const struct of_device_id xilinx_pcie_of_match[] = {