diff mbox

[kernel,v4,3/6] PCI: Set PCI_BUS_FLAGS_MSI_REMAP if IOMMU have capability of IRQ remapping

Message ID 20170630052436.15212-4-aik@ozlabs.ru (mailing list archive)
State New, archived
Headers show

Commit Message

Alexey Kardashevskiy June 30, 2017, 5:24 a.m. UTC
From: Yongji Xie <elohimes@gmail.com>

The capability of IRQ remapping is abstracted on IOMMU side on
some archs. There is a existing flag IOMMU_CAP_INTR_REMAP for this.

To have a universal flag to test this capability for different
archs on PCI side, we set PCI_BUS_FLAGS_MSI_REMAP for PCI buses
when IOMMU_CAP_INTR_REMAP is set.

Signed-off-by: Yongji Xie <xyjxie@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 drivers/pci/probe.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

kernel test robot July 1, 2017, 10:27 a.m. UTC | #1
Hi Yongji,

[auto build test ERROR on pci/next]
[also build test ERROR on v4.12-rc7 next-20170630]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Alexey-Kardashevskiy/PCI-Add-a-new-PCI_BUS_FLAGS_MSI_REMAP-flag/20170701-171815
base:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
config: x86_64-randconfig-x010-201726 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

Note: the linux-review/Alexey-Kardashevskiy/PCI-Add-a-new-PCI_BUS_FLAGS_MSI_REMAP-flag/20170701-171815 HEAD 315f74455dce23dfb8bb1f5195c8c94ed62743a4 builds fine.
      It only hurts bisectibility.

All error/warnings (new ones prefixed by >>):

   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from drivers/pci/probe.c:5:
   drivers/pci/probe.c: In function 'pci_register_host_bridge':
>> drivers/pci/probe.c:805:6: error: implicit declaration of function 'iommu_capable' [-Werror=implicit-function-declaration]
     if (iommu_capable(&pci_bus_type, IOMMU_CAP_INTR_REMAP))
         ^
   include/linux/compiler.h:160:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^~~~
>> drivers/pci/probe.c:805:2: note: in expansion of macro 'if'
     if (iommu_capable(&pci_bus_type, IOMMU_CAP_INTR_REMAP))
     ^~
>> drivers/pci/probe.c:805:35: error: 'IOMMU_CAP_INTR_REMAP' undeclared (first use in this function)
     if (iommu_capable(&pci_bus_type, IOMMU_CAP_INTR_REMAP))
                                      ^
   include/linux/compiler.h:160:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^~~~
>> drivers/pci/probe.c:805:2: note: in expansion of macro 'if'
     if (iommu_capable(&pci_bus_type, IOMMU_CAP_INTR_REMAP))
     ^~
   drivers/pci/probe.c:805:35: note: each undeclared identifier is reported only once for each function it appears in
     if (iommu_capable(&pci_bus_type, IOMMU_CAP_INTR_REMAP))
                                      ^
   include/linux/compiler.h:160:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^~~~
>> drivers/pci/probe.c:805:2: note: in expansion of macro 'if'
     if (iommu_capable(&pci_bus_type, IOMMU_CAP_INTR_REMAP))
     ^~
   cc1: some warnings being treated as errors

vim +/iommu_capable +805 drivers/pci/probe.c

   799	
   800		bus->bridge = get_device(&bridge->dev);
   801		device_enable_async_suspend(bus->bridge);
   802		pci_set_bus_of_node(bus);
   803		pci_set_bus_msi_domain(bus);
   804	
 > 805		if (iommu_capable(&pci_bus_type, IOMMU_CAP_INTR_REMAP))
   806			b->bus_flags |= PCI_BUS_FLAGS_MSI_REMAP;
   807	
   808		if (!parent)

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 3529ae17b70e..f2393b7d7ebf 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -775,6 +775,9 @@  int pci_register_host_bridge(struct pci_host_bridge *bridge)
 	pci_set_bus_of_node(bus);
 	pci_set_bus_msi_domain(bus);
 
+	if (iommu_capable(&pci_bus_type, IOMMU_CAP_INTR_REMAP))
+		b->bus_flags |= PCI_BUS_FLAGS_MSI_REMAP;
+
 	if (!parent)
 		set_dev_node(bus->bridge, pcibus_to_node(bus));