public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiancheng Xue <xuejiancheng@hisilicon.com>
To: Marc Zyngier <marc.zyngier@arm.com>, <tglx@linutronix.de>,
	<jason@lakedaemon.net>, <majun258@huawei.com>
Cc: <linux-kernel@vger.kernel.org>, <yanhaifeng@hisilicon.com>
Subject: Re: [PATCH] irqchip: fix the config HISILICON_IRQ_MBIGEN dependency error.
Date: Thu, 23 Jun 2016 16:53:46 +0800	[thread overview]
Message-ID: <576BA39A.8040807@hisilicon.com> (raw)
In-Reply-To: <576937EB.3060005@arm.com>

Hi Marc,

On 2016/6/21 20:49, Marc Zyngier wrote:
> On 21/06/16 13:01, Jiancheng Xue wrote:
>>
>>
>> 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 <xuejiancheng@hisilicon.com>
>>>>> ---
>>>>>  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.
> 
> Can you check this patch out:
> 
> https://patchwork.kernel.org/patch/9179303/
> 
> and let people know if that solves your problem or not?
> 
I applied this patch from -next tree (commit 3ee803641e76bea) and compiled with my configure file
in which CONFIG_PCI is not set.

Some warning and error messages are as follows:

warning: (ARM64 && HISILICON_IRQ_MBIGEN) selects ARM_GIC_V3_ITS which has unmet direct dependencies (PCI && PCI_MSI)
...

CC      drivers/irqchip/irq-gic-v3-its.o
drivers/irqchip/irq-gic-v3-its.c:1283:17: error: unknown type name 'msi_alloc_info_t'
       int nvec, msi_alloc_info_t *info)
                 ^
drivers/irqchip/irq-gic-v3-its.c:1322:15: error: variable 'its_msi_domain_ops' has initializer but incomplete type
 static struct msi_domain_ops its_msi_domain_ops = {
               ^
drivers/irqchip/irq-gic-v3-its.c:1323:2: error: unknown field 'msi_prepare' specified in initializer
  .msi_prepare = its_msi_prepare,
  ^
drivers/irqchip/irq-gic-v3-its.c:1323:17: error: 'its_msi_prepare' undeclared here (not in a function)
  .msi_prepare = its_msi_prepare,
                 ^
drivers/irqchip/irq-gic-v3-its.c:1323:17: warning: excess elements in struct initializer
drivers/irqchip/irq-gic-v3-its.c:1323:17: note: (near initialization for 'its_msi_domain_ops')
drivers/irqchip/irq-gic-v3-its.c: In function 'its_irq_domain_alloc':
drivers/irqchip/irq-gic-v3-its.c:1348:2: error: unknown type name 'msi_alloc_info_t'
  msi_alloc_info_t *info = args;
  ^
drivers/irqchip/irq-gic-v3-its.c:1349:35: error: request for member 'scratchpad' in something not a structure or union
  struct its_device *its_dev = info->scratchpad[0].ptr;
                                   ^
drivers/irqchip/irq-gic-v3-its.c: In function 'its_probe':
drivers/irqchip/irq-gic-v3-its.c:1611:25: error: dereferencing pointer to incomplete type 'struct msi_domain_info'
   info = kzalloc(sizeof(*info), GFP_KERNEL);
                         ^
drivers/irqchip/irq-gic-v3-its.c: At top level:
drivers/irqchip/irq-gic-v3-its.c:1157:27: warning: 'its_find_device' defined but not used [-Wunused-function]
 static struct its_device *its_find_device(struct its_node *its, u32 dev_id)
                           ^
drivers/irqchip/irq-gic-v3-its.c:1188:27: warning: 'its_create_device' defined but not used [-Wunused-function]
 static struct its_device *its_create_device(struct its_node *its, u32 dev_id,
                           ^
make[3]: *** [drivers/irqchip/irq-gic-v3-its.o] Error 1
make[2]: *** [drivers/irqchip] Error 2
make[1]: *** [drivers] Error 2

Regards,
Jiancheng

      reply	other threads:[~2016-06-23  8:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-21  9:26 [PATCH] irqchip: fix the config HISILICON_IRQ_MBIGEN dependency error Jiancheng Xue
2016-06-21 10:36 ` Marc Zyngier
2016-06-21 11:30   ` Jiancheng Xue
2016-06-21 12:01     ` Jiancheng Xue
2016-06-21 12:49       ` Marc Zyngier
2016-06-23  8:53         ` Jiancheng Xue [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=576BA39A.8040807@hisilicon.com \
    --to=xuejiancheng@hisilicon.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=majun258@huawei.com \
    --cc=marc.zyngier@arm.com \
    --cc=tglx@linutronix.de \
    --cc=yanhaifeng@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox