From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753823AbdBUQ7y (ORCPT ); Tue, 21 Feb 2017 11:59:54 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:59324 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751555AbdBUQ7p (ORCPT ); Tue, 21 Feb 2017 11:59:45 -0500 Date: Tue, 21 Feb 2017 17:59:32 +0100 From: Thomas Petazzoni To: Arnd Bergmann Cc: Thomas Gleixner , Jason Cooper , Marc Zyngier , linux-kernel@vger.kernel.org, =?UTF-8?B?R3LDqWdvcnk=?= Clement , Jason Cooper , Sebastian Hesselbarth , Andrew Lunn Subject: Re: [PATCH] irqchip: mvebu-odmi: select GENERIC_MSI_IRQ_DOMAIN Message-ID: <20170221175932.508c628a@free-electrons.com> In-Reply-To: <20170214212502.2752378-1-arnd@arndb.de> References: <20170214212502.2752378-1-arnd@arndb.de> Organization: Free Electrons X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gHello, On Tue, 14 Feb 2017 22:24:36 +0100, Arnd Bergmann wrote: > This driver uses the MSI domain but has no strict dependency on PCI_MSI, so we > may run into a build failure when CONFIG_GENERIC_MSI_IRQ_DOMAIN is disabled: > > drivers/irqchip/irq-mvebu-odmi.c:152:15: error: variable 'odmi_msi_ops' has initializer but incomplete type > static struct msi_domain_ops odmi_msi_ops = { > ^~~~~~~~~~~~~~ > drivers/irqchip/irq-mvebu-odmi.c:155:15: error: variable 'odmi_msi_domain_info' has initializer but incomplete type > static struct msi_domain_info odmi_msi_domain_info = { > ^~~~~~~~~~~~~~~ > drivers/irqchip/irq-mvebu-odmi.c:156:3: error: 'struct msi_domain_info' has no member named 'flags' > .flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS), > ^~~~~ > drivers/irqchip/irq-mvebu-odmi.c:156:12: error: 'MSI_FLAG_USE_DEF_DOM_OPS' undeclared here (not in a function) > .flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS), > ^~~~~~~~~~~~~~~~~~~~~~~~ > drivers/irqchip/irq-mvebu-odmi.c:156:39: error: 'MSI_FLAG_USE_DEF_CHIP_OPS' undeclared here (not in a function); did you mean 'MSI_FLAG_USE_DEF_DOM_OPS'? > > Selecting the option from this driver seems to solve this nicely, though I could > not find any other instance of this in irqchip drivers. Here is my explanation of why MVEBU_ODMI is the only one affected: because it's the only one that provides only platform MSI and not PCI MSI. Let's look at the other irqchip drivers using msi_domain_ops: irq-gic-v2m.c:static struct msi_domain_ops gicv2m_pmsi_ops = { irq-gic-v3-its-pci-msi.c:static struct msi_domain_ops its_pci_msi_ops = { irq-gic-v3-its-platform-msi.c:static struct msi_domain_ops its_pmsi_ops = { irq-gic-v3-its.c:static struct msi_domain_ops its_msi_domain_ops = { irq-mvebu-odmi.c:static struct msi_domain_ops odmi_msi_ops = { So, besides mvebu-odmi, we've got GICv2m and GIv3 ITS. Their Kconfig declaration is: config ARM_GIC_V2M bool depends on PCI select ARM_GIC select PCI_MSI config ARM_GIC_V3_ITS bool depends on PCI depends on PCI_MSI select ACPI_IORT if ACPI so both of them "select PCI_MSI". Then we have: config PCI_MSI_IRQ_DOMAIN def_bool ARC || ARM || ARM64 || X86 depends on PCI_MSI select GENERIC_MSI_IRQ_DOMAIN So, when we are on ARC, ARM, ARM64 or x86, and PCI_MSI is enabled, GENERIC_MSI_IRQ_DOMAIN is automatically enabled. So basically the fact that GICv2m and GICv3 "select PCI_MSI" ensure that "GENERIC_MSI_IRQ_DOMAIN" will be enabled. Therefore: > Signed-off-by: Arnd Bergmann Acked-by: Thomas Petazzoni Thanks! Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com