From patchwork Tue Aug 4 21:54:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 6944801 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 495269F38B for ; Tue, 4 Aug 2015 22:07:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4434320553 for ; Tue, 4 Aug 2015 22:07:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 52C9420414 for ; Tue, 4 Aug 2015 22:07:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZMkKI-00070A-ON; Tue, 04 Aug 2015 22:04:50 +0000 Received: from mail-ig0-x233.google.com ([2607:f8b0:4001:c05::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZMkAO-0000Zp-5m for linux-arm-kernel@lists.infradead.org; Tue, 04 Aug 2015 21:54:38 +0000 Received: by igbpg9 with SMTP id pg9so20830429igb.0 for ; Tue, 04 Aug 2015 14:54:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=7EDNGvroTleayF0/WqiK+dNcoHFL0dY6Bx3hUr4FCII=; b=o7dqYzfn1lvRM96keXNkPgc+0W2h9iqFFipRLk8xtJsI8/ZbWauR8eM8cCtgGcfn3I 2+lPPX71l11sGwPwb1KoRQ8fBWu8PUkf27gPqKh+LN6uTKKeE+P0Fk4OvP0kdskRdFPy cUrfh6+1v4TnM04ng31OOJgcP4dQ9yU9AifM/LI76beeAsFgmzo3J7xhEIpoMg7ZZ7nj bH9ez6zmCG3gUuz8rZNWXSdqXKWRM4G97YPjhYnkEM1uWG32r2IUKjsBcZZkP0y2rcLp m0eLaqmA0oVljAbrJreS0bfeaZb/iGeBMLjCdhAGiJAeuHJmt0OU3VASknk/9iAtsjOc w16Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=7EDNGvroTleayF0/WqiK+dNcoHFL0dY6Bx3hUr4FCII=; b=hWPQBtlt8FQl5nS7C/b4AhL7nLrc+fDB1FqbmoQ6p0o7TrbzorPyf4QrMnevdQ+yga a6Q6YE/KMOebGXkpaX0rj/NS2slUgLFn0/oBn49vhykQsvnifRlbhDh2CHYqATK+UxV3 vV6SwmDYwHmIINYyVquw4ToL1Z/SN8UV3xO+UW3FuEgQTFprKWaCHIrFs30DxPijGq7k o0DB6S6CK4rgPhi3Z9pkLHkzlUucFIq2taVeAbC7jw5DZiyv4jfR2eSBdNaGuQzxx92p oEZFC0uM3Z8tNGdpYugKKpV3W93NdywHNsUGCmU8h7Py3v07iO80OVfFf6ELSwIzRlSQ 71QA== X-Gm-Message-State: ALoCoQkttpWuaoQb/VSEKrnCKDrhB2e6D6+pwmdjcenzHRAmE6Xw6At9BP5nBM0Whi1bAiAE75Po X-Received: by 10.50.56.104 with SMTP id z8mr6674248igp.45.1438725255049; Tue, 04 Aug 2015 14:54:15 -0700 (PDT) Received: from localhost ([69.71.1.1]) by smtp.gmail.com with ESMTPSA id x3sm2088381igl.2.2015.08.04.14.54.12 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 04 Aug 2015 14:54:13 -0700 (PDT) Subject: [PATCH v5 3/9] ARM/PCI, designware, xilinx: Use pci_scan_root_bus_msi() To: Lorenzo Pieralisi From: Bjorn Helgaas Date: Tue, 04 Aug 2015 16:54:11 -0500 Message-ID: <20150804215411.9189.53901.stgit@bhelgaas-glaptop2.roam.corp.google.com> In-Reply-To: <20150804214234.9189.42548.stgit@bhelgaas-glaptop2.roam.corp.google.com> References: <20150804214234.9189.42548.stgit@bhelgaas-glaptop2.roam.corp.google.com> User-Agent: StGit/0.16 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150804_145436_395207_4F9DBB47 X-CRM114-Status: GOOD ( 16.49 ) X-Spam-Score: -2.9 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , Duc Dang , Russell King , Arnd Bergmann , Gabriele Paoloni , Marc Zyngier , linux-pci@vger.kernel.org, Pratyush Anand , Michal Simek , Simon Horman , James Morse , Tanmay Inamdar , Jingoo Han , Thierry Reding , Jayachandran C , linux-arm-kernel@lists.infradead.org, Jason Cooper Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Lorenzo Pieralisi ARM previously stored the msi_controller pointer in its sysdata, struct pci_sys_data, and implemented pcibios_msi_controller() to retrieve it. That made PCI host controller drivers specific to ARM because they had to put the msi_controller pointer in the ARM-specific pci_sys_data. There is now a generic mechanism, pci_scan_root_bus_msi(), for giving the msi_controller pointer to the PCI core. Use this for all ARM systems and for the DesignWare and Xilinx PCI host controller drivers. This removes an ARM dependency from the DesignWare, DRA7xx, EXYNOS, i.MX6, Keystone, Layerscape, SPEAr13xx, and Xilinx drivers. [bhelgaas: changelog, split into separate patch] Suggested-by: Russell King Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas CC: Pratyush Anand CC: Arnd Bergmann CC: Jingoo Han CC: Simon Horman CC: Russell King CC: Thomas Petazzoni CC: Thierry Reding CC: Michal Simek CC: Marc Zyngier Acked-by: Jingoo Han --- arch/arm/include/asm/mach/pci.h | 2 -- arch/arm/kernel/bios32.c | 5 +++-- drivers/pci/host/pcie-designware.c | 6 +++--- drivers/pci/host/pcie-xilinx.c | 5 ++--- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h index 28b9bb3..c074e7a 100644 --- a/arch/arm/include/asm/mach/pci.h +++ b/arch/arm/include/asm/mach/pci.h @@ -19,9 +19,7 @@ struct pci_bus; struct device; struct hw_pci { -#ifdef CONFIG_PCI_MSI struct msi_controller *msi_ctrl; -#endif struct pci_ops *ops; int nr_controllers; void **private_data; diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index 4e95260..283bc1c 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c @@ -486,8 +486,9 @@ static void pcibios_init_hw(struct device *parent, struct hw_pci *hw, if (hw->scan) sys->bus = hw->scan(nr, sys); else - sys->bus = pci_scan_root_bus(parent, sys->busnr, - hw->ops, sys, &sys->resources); + sys->bus = pci_scan_root_bus_msi(parent, + sys->busnr, hw->ops, sys, + &sys->resources, hw->msi_ctrl); if (WARN(!sys->bus, "PCI: unable to scan bus!")) { kfree(sys); diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c index 69486be..bd0aeec 100644 --- a/drivers/pci/host/pcie-designware.c +++ b/drivers/pci/host/pcie-designware.c @@ -526,7 +526,6 @@ int dw_pcie_host_init(struct pcie_port *pp) #ifdef CONFIG_PCI_MSI dw_pcie_msi_chip.dev = pp->dev; - dw_pci.msi_ctrl = &dw_pcie_msi_chip; #endif dw_pci.nr_controllers = 1; @@ -708,8 +707,9 @@ static struct pci_bus *dw_pcie_scan_bus(int nr, struct pci_sys_data *sys) struct pcie_port *pp = sys_to_pcie(sys); pp->root_bus_nr = sys->busnr; - bus = pci_scan_root_bus(pp->dev, sys->busnr, - &dw_pcie_ops, sys, &sys->resources); + bus = pci_scan_root_bus_msi(pp->dev, sys->busnr, &dw_pcie_ops, sys, + &sys->resources, &dw_pcie_msi_chip); + if (!bus) return NULL; diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c index f1a06a0..526807d 100644 --- a/drivers/pci/host/pcie-xilinx.c +++ b/drivers/pci/host/pcie-xilinx.c @@ -647,8 +647,8 @@ static struct pci_bus *xilinx_pcie_scan_bus(int nr, struct pci_sys_data *sys) struct pci_bus *bus; port->root_busno = sys->busnr; - bus = pci_scan_root_bus(port->dev, sys->busnr, &xilinx_pcie_ops, - sys, &sys->resources); + bus = pci_scan_root_bus_msi(port->dev, sys->busnr, &xilinx_pcie_ops, + sys, &sys->resources, &xilinx_pcie_msi_chip); return bus; } @@ -847,7 +847,6 @@ static int xilinx_pcie_probe(struct platform_device *pdev) #ifdef CONFIG_PCI_MSI xilinx_pcie_msi_chip.dev = port->dev; - hw.msi_ctrl = &xilinx_pcie_msi_chip; #endif pci_common_init_dev(dev, &hw);