From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752259AbcFUMBz (ORCPT ); Tue, 21 Jun 2016 08:01:55 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:38389 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751638AbcFUMBe (ORCPT ); Tue, 21 Jun 2016 08:01:34 -0400 Subject: Re: [PATCH] irqchip: fix the config HISILICON_IRQ_MBIGEN dependency error. To: Marc Zyngier , , , References: <1466501188-3948-1-git-send-email-xuejiancheng@hisilicon.com> <57691892.70502@arm.com> <5769254A.4080609@hisilicon.com> CC: , From: Jiancheng Xue Message-ID: <57692C7C.1070703@hisilicon.com> Date: Tue, 21 Jun 2016 20:01:00 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <5769254A.4080609@hisilicon.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.217.211] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020201.57692C87.01ED,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: cca72efb397227638fd37fd8d28a2165 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/6/21 19:30, Jiancheng Xue wrote: > Hi Marc, > > On 2016/6/21 18:36, Marc Zyngier wrote: >> On 21/06/16 10:26, Jiancheng Xue wrote: >>> This patch fixes the compiling error caused when >>> config HISILICON_IRQ_MBIGEN is selected but >>> PCI_MSI is not seleted. >>> >>> Signed-off-by: Jiancheng Xue >>> --- >>> drivers/irqchip/Kconfig | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig >>> index fa33c50..23dcf3e 100644 >>> --- a/drivers/irqchip/Kconfig >>> +++ b/drivers/irqchip/Kconfig >>> @@ -110,7 +110,7 @@ config DW_APB_ICTL >>> config HISILICON_IRQ_MBIGEN >>> bool >>> select ARM_GIC_V3 >>> - select ARM_GIC_V3_ITS >>> + select ARM_GIC_V3_ITS if PCI_MSI >>> select GENERIC_MSI_IRQ_DOMAIN >> >> How can this be correct? The MBIGEN uses platform MSI (not PCI) and >> relies on the ITS (it doesn't work without it). It seems that you're >> papering over another issue. >> > Sorry. I am not familiar with this part. But I encountered errors when > I compiled. I think there may be some problems about dependency. > > In this Kconfig file > > config ARM_GIC_V3_ITS > bool > select PCI_MSI_IRQ_DOMAIN > > config HISILICON_IRQ_MBIGEN > bool > select ARM_GIC_V3 > select ARM_GIC_V3_ITS > select GENERIC_MSI_IRQ_DOMAIN > > In the file drivers/pci/Kconfig > > config PCI_MSI_IRQ_DOMAIN > bool > depends on PCI_MSI > select GENERIC_MSI_IRQ_DOMAIN > > We can see if the HISILICON_IRQ_MBIGEN is selected, the ARM_GIC_V3_ITS and > PCI_MSI_IRQ_DOMAIN will be selected. But PCI_MSI_IRQ_DOMAIN depends on > PCI_MSI. If PCI_MSI is not selected, it will cause a compiling error like this > "drivers/irqchip/irq-gic-v3-its-pci-msi.c:52:12: error: implicit declaration of function 'pci_msi_vec_count' [-Werror=implicit-function-declaration] > msi = max(pci_msi_vec_count(pdev), 0);" > > I found many other options which need ARM_GIC_V3_ITS or PCI_MSI_IRQ_DOMAIN > were configured like below: > select ARM_GIC_V3_ITS if PCI_MSI > or > select GENERIC_MSI_IRQ_DOMAIN if PCI_MSI > This patch is really not correct. It will cause new problems. In drivers/irqchip/Makefile obj-$(CONFIG_ARM_GIC_V3_ITS) += irq-gic-v3-its.o irq-gic-v3-its-pci-msi.o irq-gic-v3-its-platform-msi.o if CONFIG_ARM_GIC_V3_ITS is selected, irq-gic-v3-its-pci-msi.c will be compiled. But it depends on config PCI_MSI. if irq-gic-v3-its-pci-msi.c is not relied on by irq-gic-v3-its.c, maybe it should be controlled by another config item instead of CONFIG_ARM_GIC_V3_ITS. Otherwise, CONFIG_ARM_GIC_V3_ITS should depend on PCI_MSI. > Regards, > Jiancheng > > >