From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bjorn Helgaas Subject: Re: [PATCH v3 05/27] PCI: tegra: Save msi chip in pci_sys_data Date: Wed, 22 Oct 2014 23:18:31 -0600 Message-ID: <20141023051831.GB11770@google.com> References: <1413342435-7876-1-git-send-email-wangyijing@huawei.com> <1413342435-7876-6-git-send-email-wangyijing@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1413342435-7876-6-git-send-email-wangyijing-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Yijing Wang Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org, linux-ia64-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Thierry Reding , sparclinux-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-s390-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Russell King , Michael Ellerman , x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, Sebastian Ott , Benjamin Herrenschmidt , xen-devel-GuqFBffKawtpuQazS67q72D2FQJk+8+b@public.gmane.org, arnab.basu-KZfg59tc24xl57MIdRCFDg@public.gmane.org, Liviu Dudau , Arnd Bergmann , Chris Metcalf , Thomas Gleixner , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Thomas Petazzoni , Xinwei Hu , Tony Luck , Sergei Shtylyov , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Ralf Baechle , iommu@l List-Id: linux-arch.vger.kernel.org On Wed, Oct 15, 2014 at 11:06:53AM +0800, Yijing Wang wrote: > Save msi chip in pci_sys_data instead of assign > msi chip to every pci bus in .add_bus(). > > Signed-off-by: Yijing Wang > --- > drivers/pci/host/pci-tegra.c | 13 +++---------- > 1 files changed, 3 insertions(+), 10 deletions(-) > > diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c > index 3d43874..5af0525 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); > @@ -1881,11 +1872,13 @@ static int tegra_pcie_enable(struct tegra_pcie *pcie) > > memset(&hw, 0, sizeof(hw)); > > +#ifdef CONFIG_PCI_MSI > + hw.msi_chip = &pcie->msi.chip; > +#endif Why did you use "#ifdef CONFIG_PCI_MSI" instead of the "IS_ENABLED(CONFIG_PCI_MSI)" used previously? It's true that CONFIG_PCI_MSI will never be a tristate symbol, so we don't really *need* the extra smarts of IS_ENABLED(), but I'm fairly sympathetic to James' argument [1] that we should just use IS_ENABLED() all the time because it's simpler overall. If you want to change the #ifdef to IS_ENABLED(), that should be a separate patch from your msi_chip change, and we can debate the merits of that by itself. [1] http://lkml.iu.edu//hypermail/linux/kernel/1204.3/00081.html > hw.nr_controllers = 1; > 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; > > -- > 1.7.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ie0-f170.google.com ([209.85.223.170]:45899 "EHLO mail-ie0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751178AbaJWFSf (ORCPT ); Thu, 23 Oct 2014 01:18:35 -0400 Received: by mail-ie0-f170.google.com with SMTP id tp5so305686ieb.15 for ; Wed, 22 Oct 2014 22:18:34 -0700 (PDT) Date: Wed, 22 Oct 2014 23:18:31 -0600 From: Bjorn Helgaas Subject: Re: [PATCH v3 05/27] PCI: tegra: Save msi chip in pci_sys_data Message-ID: <20141023051831.GB11770@google.com> References: <1413342435-7876-1-git-send-email-wangyijing@huawei.com> <1413342435-7876-6-git-send-email-wangyijing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1413342435-7876-6-git-send-email-wangyijing@huawei.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Yijing Wang Cc: 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 , Thierry Reding , Thomas Petazzoni , Liviu Dudau Message-ID: <20141023051831.ns2a6H8BVg0cS5FdXi3VnFIZZjpzfzESRcYS3S6dJWw@z> On Wed, Oct 15, 2014 at 11:06:53AM +0800, Yijing Wang wrote: > Save msi chip in pci_sys_data instead of assign > msi chip to every pci bus in .add_bus(). > > Signed-off-by: Yijing Wang > --- > drivers/pci/host/pci-tegra.c | 13 +++---------- > 1 files changed, 3 insertions(+), 10 deletions(-) > > diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c > index 3d43874..5af0525 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); > @@ -1881,11 +1872,13 @@ static int tegra_pcie_enable(struct tegra_pcie *pcie) > > memset(&hw, 0, sizeof(hw)); > > +#ifdef CONFIG_PCI_MSI > + hw.msi_chip = &pcie->msi.chip; > +#endif Why did you use "#ifdef CONFIG_PCI_MSI" instead of the "IS_ENABLED(CONFIG_PCI_MSI)" used previously? It's true that CONFIG_PCI_MSI will never be a tristate symbol, so we don't really *need* the extra smarts of IS_ENABLED(), but I'm fairly sympathetic to James' argument [1] that we should just use IS_ENABLED() all the time because it's simpler overall. If you want to change the #ifdef to IS_ENABLED(), that should be a separate patch from your msi_chip change, and we can debate the merits of that by itself. [1] http://lkml.iu.edu//hypermail/linux/kernel/1204.3/00081.html > hw.nr_controllers = 1; > 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; > > -- > 1.7.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/