From patchwork Fri Sep 26 09:05:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 4979431 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 39033BEEA6 for ; Fri, 26 Sep 2014 09:05:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8E7B6202E9 for ; Fri, 26 Sep 2014 09:05:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C8A66202B8 for ; Fri, 26 Sep 2014 09:05:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753294AbaIZJFr (ORCPT ); Fri, 26 Sep 2014 05:05:47 -0400 Received: from mail-we0-f175.google.com ([74.125.82.175]:49351 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752966AbaIZJFn (ORCPT ); Fri, 26 Sep 2014 05:05:43 -0400 Received: by mail-we0-f175.google.com with SMTP id u57so8335600wes.6 for ; Fri, 26 Sep 2014 02:05:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=EjwFrufIsLdc/u6fEqKWQjdvu/DByE9eZ6xKK2nuaEI=; b=J34Wn0yZ8FXl6oAaF2sZFWKau1siMEIhvFREeTE8Jh7QPD7GZ+CfiIKyvdfGEJAMry J7ga0LdLeFj9SLsAMvm7gQk/No5yjvEnrNEXJrXOccvvzsBjL5XplmMwa0agFuY/71jo 3QkqjggQukfNBKn0XFXfIl759ZBysDntkHFIRfcWUDDfqYDkQ7CNc2TK9kcoQ/RMVUU2 0Sr1wYUziDan4/fkCz6goE3sBI+w+kihI0XIImH7QViBwlWVgfmgb5OMQuu6lpkG4jHK iPJPPljhXeVQSRmsJpR/THeTqblOjADuiHlwC4ay5tMwyOU35CBTdfeLuYvidOdx2Iq+ tb8g== X-Received: by 10.194.189.115 with SMTP id gh19mr1827246wjc.119.1411722340693; Fri, 26 Sep 2014 02:05:40 -0700 (PDT) Received: from localhost (port-6838.pppoe.wtnet.de. [84.46.26.208]) by mx.google.com with ESMTPSA id i1sm3429085wjx.32.2014.09.26.02.05.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Sep 2014 02:05:39 -0700 (PDT) Date: Fri, 26 Sep 2014 11:05:38 +0200 From: Thierry Reding To: Yijing Wang Cc: Liviu Dudau , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Xinwei Hu , Wuyun , linux-arm-kernel@lists.infradead.org, Russell King , linux-arch@vger.kernel.org, arnab.basu@freescale.com, Bharat.Bhushan@freescale.com, x86@kernel.org, Arnd Bergmann , Thomas Gleixner , Konrad Rzeszutek Wilk , xen-devel@lists.xenproject.org, Joerg Roedel , iommu@lists.linux-foundation.org, linux-mips@linux-mips.org, Benjamin Herrenschmidt , linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, Sebastian Ott , Tony Luck , linux-ia64@vger.kernel.org, "David S. Miller" , sparclinux@vger.kernel.org, Chris Metcalf , Ralf Baechle , Lucas Stach , David Vrabel , Sergei Shtylyov , Michael Ellerman , Thomas Petazzoni Subject: Re: [PATCH v2 00/22] Use MSI chip framework to configure MSI/MSI-X in all platforms Message-ID: <20140926090537.GH31106@ulmo> References: <1411614872-4009-1-git-send-email-wangyijing@huawei.com> <20140925074235.GN12423@ulmo> <20140925144855.GB31157@bart.dudau.co.uk> <20140925164937.GB30382@ulmo> <20140925171612.GC31157@bart.dudau.co.uk> <542505B3.7040208@huawei.com> <20140926085430.GG31106@ulmo> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140926085430.GG31106@ulmo> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, T_TVD_MIME_EPI, 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 On Fri, Sep 26, 2014 at 10:54:32AM +0200, Thierry Reding wrote: [...] > At least for Tegra it's trivial to just hook it up in tegra_pcie_scan_bus() > directly (patch attached). Really attached this time. Thierry From 2cedfcf38cdfe21688d1363659f28e271ce43358 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 26 Sep 2014 10:35:47 +0200 Subject: [PATCH] PCI: tegra: Remove .add_bus() callback The .add_bus() callback is called for every bus and used to associate an MSI chip with each bus. However the PCI core code already propagates the root bus' MSI chip to child busses, so it is enough to associate the MSI chip with the root bus upon creation. Conveniently the Tegra PCIe host bridge driver creates the root bus directly, so the association can be done at the same time. Signed-off-by: Thierry Reding --- drivers/pci/host/pci-tegra.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c index 3d43874319be..d314e549ac0c 100644 --- a/drivers/pci/host/pci-tegra.c +++ b/drivers/pci/host/pci-tegra.c @@ -694,15 +694,6 @@ static int tegra_pcie_map_irq(const struct pci_dev *pdev, u8 slot, u8 pin) return irq; } -static void tegra_pcie_add_bus(struct pci_bus *bus) -{ - if (IS_ENABLED(CONFIG_PCI_MSI)) { - struct tegra_pcie *pcie = sys_to_pcie(bus->sysdata); - - bus->msi = &pcie->msi.chip; - } -} - static struct pci_bus *tegra_pcie_scan_bus(int nr, struct pci_sys_data *sys) { struct tegra_pcie *pcie = sys_to_pcie(sys); @@ -713,6 +704,9 @@ static struct pci_bus *tegra_pcie_scan_bus(int nr, struct pci_sys_data *sys) if (!bus) return NULL; + if (IS_ENABLED(CONFIG_PCI_MSI)) + bus->msi = &pcie->msi.chip; + pci_scan_child_bus(bus); return bus; @@ -1885,7 +1879,6 @@ static int tegra_pcie_enable(struct tegra_pcie *pcie) hw.private_data = (void **)&pcie; hw.setup = tegra_pcie_setup; hw.map_irq = tegra_pcie_map_irq; - hw.add_bus = tegra_pcie_add_bus; hw.scan = tegra_pcie_scan_bus; hw.ops = &tegra_pcie_ops; -- 2.1.0