From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yijing Wang Subject: Re: [PATCH v3 05/27] PCI: tegra: Save msi chip in pci_sys_data Date: Thu, 23 Oct 2014 14:23:26 +0800 Message-ID: <54489EDE.5070109@huawei.com> References: <1413342435-7876-1-git-send-email-wangyijing@huawei.com> <1413342435-7876-6-git-send-email-wangyijing@huawei.com> <20141023051831.GB11770@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20141023051831.GB11770@google.com> Sender: linux-ia64-owner@vger.kernel.org To: Bjorn Helgaas 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 List-Id: linux-arch.vger.kernel.org On 2014/10/23 13:18, Bjorn Helgaas wrote: > 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? Just personal habit. :) > > 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 Hi Bjorn, thanks for your guidance. I will use IS_ENABLED() instead of #ifdef for simplification in a separate patch. > >> 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/ > > . > -- Thanks! Yijing From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga02-in.huawei.com ([119.145.14.65]:23417 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750827AbaJWGYH (ORCPT ); Thu, 23 Oct 2014 02:24:07 -0400 Message-ID: <54489EDE.5070109@huawei.com> Date: Thu, 23 Oct 2014 14:23:26 +0800 From: Yijing Wang MIME-Version: 1.0 Subject: Re: [PATCH v3 05/27] PCI: tegra: Save msi chip in pci_sys_data References: <1413342435-7876-1-git-send-email-wangyijing@huawei.com> <1413342435-7876-6-git-send-email-wangyijing@huawei.com> <20141023051831.GB11770@google.com> In-Reply-To: <20141023051831.GB11770@google.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Bjorn Helgaas 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: <20141023062326.E7VG5v2DqEj-u_eYMFb90xRuPK5nqHF0hcQqF3q7FM0@z> On 2014/10/23 13:18, Bjorn Helgaas wrote: > 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? Just personal habit. :) > > 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 Hi Bjorn, thanks for your guidance. I will use IS_ENABLED() instead of #ifdef for simplification in a separate patch. > >> 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/ > > . > -- Thanks! Yijing From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yijing Wang Date: Thu, 23 Oct 2014 06:23:26 +0000 Subject: Re: [PATCH v3 05/27] PCI: tegra: Save msi chip in pci_sys_data Message-Id: <54489EDE.5070109@huawei.com> List-Id: References: <1413342435-7876-1-git-send-email-wangyijing@huawei.com> <1413342435-7876-6-git-send-email-wangyijing@huawei.com> <20141023051831.GB11770@google.com> In-Reply-To: <20141023051831.GB11770@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Bjorn Helgaas 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 On 2014/10/23 13:18, Bjorn Helgaas wrote: > 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? Just personal habit. :) > > 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 Hi Bjorn, thanks for your guidance. I will use IS_ENABLED() instead of #ifdef for simplification in a separate patch. > >> 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/ > > . > -- Thanks! Yijing From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 23 Oct 2014 08:24:22 +0200 (CEST) Received: from szxga02-in.huawei.com ([119.145.14.65]:64490 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S27011437AbaJWGYTJV7gA (ORCPT ); Thu, 23 Oct 2014 08:24:19 +0200 Received: from 172.24.2.119 (EHLO szxeml418-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CBD39855; Thu, 23 Oct 2014 14:23:47 +0800 (CST) Received: from [127.0.0.1] (10.177.27.212) by szxeml418-hub.china.huawei.com (10.82.67.157) with Microsoft SMTP Server id 14.3.158.1; Thu, 23 Oct 2014 14:23:29 +0800 Message-ID: <54489EDE.5070109@huawei.com> Date: Thu, 23 Oct 2014 14:23:26 +0800 From: Yijing Wang User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Bjorn Helgaas CC: , , Xinwei Hu , Wuyun , , Russell King , , , , , Arnd Bergmann , Thomas Gleixner , "Konrad Rzeszutek Wilk" , , Joerg Roedel , , , Benjamin Herrenschmidt , , , Sebastian Ott , "Tony Luck" , , "David S. Miller" , , Chris Metcalf , Ralf Baechle , Lucas Stach , David Vrabel , "Sergei Shtylyov" , Michael Ellerman , Thierry Reding , "Thomas Petazzoni" , Liviu Dudau Subject: Re: [PATCH v3 05/27] PCI: tegra: Save msi chip in pci_sys_data References: <1413342435-7876-1-git-send-email-wangyijing@huawei.com> <1413342435-7876-6-git-send-email-wangyijing@huawei.com> <20141023051831.GB11770@google.com> In-Reply-To: <20141023051831.GB11770@google.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.27.212] X-CFilter-Loop: Reflected Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 43526 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: wangyijing@huawei.com Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips On 2014/10/23 13:18, Bjorn Helgaas wrote: > 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? Just personal habit. :) > > 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 Hi Bjorn, thanks for your guidance. I will use IS_ENABLED() instead of #ifdef for simplification in a separate patch. > >> 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/ > > . > -- Thanks! Yijing From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [119.145.14.65]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 363991A0054 for ; Thu, 23 Oct 2014 17:24:28 +1100 (AEDT) Message-ID: <54489EDE.5070109@huawei.com> Date: Thu, 23 Oct 2014 14:23:26 +0800 From: Yijing Wang MIME-Version: 1.0 To: Bjorn Helgaas Subject: Re: [PATCH v3 05/27] PCI: tegra: Save msi chip in pci_sys_data References: <1413342435-7876-1-git-send-email-wangyijing@huawei.com> <1413342435-7876-6-git-send-email-wangyijing@huawei.com> <20141023051831.GB11770@google.com> In-Reply-To: <20141023051831.GB11770@google.com> Content-Type: text/plain; charset="ISO-8859-1" Cc: linux-mips@linux-mips.org, linux-ia64@vger.kernel.org, linux-pci@vger.kernel.org, Bharat.Bhushan@freescale.com, Thierry Reding , sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Russell King , Joerg Roedel , x86@kernel.org, Sebastian Ott , xen-devel@lists.xenproject.org, arnab.basu@freescale.com, Liviu Dudau , Arnd Bergmann , Konrad Rzeszutek Wilk , Chris Metcalf , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , Xinwei Hu , Tony Luck , Sergei Shtylyov , linux-kernel@vger.kernel.org, Ralf Baechle , iommu@lists.linux-foundation.org, David Vrabel , Wuyun , linuxppc-dev@lists.ozlabs.org, "David S. Miller" , Lucas Stach List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 2014/10/23 13:18, Bjorn Helgaas wrote: > 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? Just personal habit. :) > > 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 Hi Bjorn, thanks for your guidance. I will use IS_ENABLED() instead of #ifdef for simplification in a separate patch. > >> 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/ > > . > -- Thanks! Yijing From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yijing Wang Date: Thu, 23 Oct 2014 06:23:26 +0000 Subject: Re: [PATCH v3 05/27] PCI: tegra: Save msi chip in pci_sys_data Message-Id: <54489EDE.5070109@huawei.com> List-Id: References: <1413342435-7876-1-git-send-email-wangyijing@huawei.com> <1413342435-7876-6-git-send-email-wangyijing@huawei.com> <20141023051831.GB11770@google.com> In-Reply-To: <20141023051831.GB11770@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Bjorn Helgaas 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 On 2014/10/23 13:18, Bjorn Helgaas wrote: > 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? Just personal habit. :) > > 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 Hi Bjorn, thanks for your guidance. I will use IS_ENABLED() instead of #ifdef for simplification in a separate patch. > >> 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/ > > . > -- Thanks! Yijing From mboxrd@z Thu Jan 1 00:00:00 1970 From: wangyijing@huawei.com (Yijing Wang) Date: Thu, 23 Oct 2014 14:23:26 +0800 Subject: [PATCH v3 05/27] PCI: tegra: Save msi chip in pci_sys_data In-Reply-To: <20141023051831.GB11770@google.com> References: <1413342435-7876-1-git-send-email-wangyijing@huawei.com> <1413342435-7876-6-git-send-email-wangyijing@huawei.com> <20141023051831.GB11770@google.com> Message-ID: <54489EDE.5070109@huawei.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 2014/10/23 13:18, Bjorn Helgaas wrote: > 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? Just personal habit. :) > > 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 Hi Bjorn, thanks for your guidance. I will use IS_ENABLED() instead of #ifdef for simplification in a separate patch. > >> 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 at vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> Please read the FAQ at http://www.tux.org/lkml/ > > . > -- Thanks! Yijing