drivers/cdx/Kconfig | 1 - drivers/cdx/cdx.c | 2 +- drivers/cdx/controller/Kconfig | 1 - drivers/cdx/controller/cdx_controller.c | 3 ++- 4 files changed, 3 insertions(+), 4 deletions(-)
From: Arnd Bergmann <arnd@arndb.de>
x86 does not use CONFIG_GENERIC_MSI_IRQ, and trying to enable it anyway
results in a build failure:
In file included from include/linux/ssb/ssb.h:10,
from drivers/ssb/pcihost_wrapper.c:18:
include/linux/gpio/driver.h:41:33: error: field 'msiinfo' has incomplete type
41 | msi_alloc_info_t msiinfo;
| ^~~~~~~
In file included from include/linux/kvm_host.h:19,
from arch/x86/events/intel/core.c:17:
include/linux/msi.h:528:33: error: field 'alloc_info' has incomplete type
528 | msi_alloc_info_t alloc_info;
Change the driver to actually build without this symbol and remove the
incorrect 'select' statements.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/cdx/Kconfig | 1 -
drivers/cdx/cdx.c | 2 +-
drivers/cdx/controller/Kconfig | 1 -
drivers/cdx/controller/cdx_controller.c | 3 ++-
4 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/cdx/Kconfig b/drivers/cdx/Kconfig
index 3af41f51cf38..1f1e360507d7 100644
--- a/drivers/cdx/Kconfig
+++ b/drivers/cdx/Kconfig
@@ -8,7 +8,6 @@
config CDX_BUS
bool "CDX Bus driver"
depends on OF && ARM64 || COMPILE_TEST
- select GENERIC_MSI_IRQ
help
Driver to enable Composable DMA Transfer(CDX) Bus. CDX bus
exposes Fabric devices which uses composable DMA IP to the
diff --git a/drivers/cdx/cdx.c b/drivers/cdx/cdx.c
index 092306ca2541..1a5c95ba09ba 100644
--- a/drivers/cdx/cdx.c
+++ b/drivers/cdx/cdx.c
@@ -310,7 +310,7 @@ static int cdx_probe(struct device *dev)
* Setup MSI device data so that generic MSI alloc/free can
* be used by the device driver.
*/
- if (cdx->msi_domain) {
+ if (IS_ENABLED(CONFIG_GENERIC_MSI_IRQ) && cdx->msi_domain) {
error = msi_setup_device_data(&cdx_dev->dev);
if (error)
return error;
diff --git a/drivers/cdx/controller/Kconfig b/drivers/cdx/controller/Kconfig
index 0641a4c21e66..a480b62cbd1f 100644
--- a/drivers/cdx/controller/Kconfig
+++ b/drivers/cdx/controller/Kconfig
@@ -10,7 +10,6 @@ if CDX_BUS
config CDX_CONTROLLER
tristate "CDX bus controller"
depends on HAS_DMA
- select GENERIC_MSI_IRQ
select REMOTEPROC
select RPMSG
help
diff --git a/drivers/cdx/controller/cdx_controller.c b/drivers/cdx/controller/cdx_controller.c
index fca83141e3e6..5e3fd89b6b56 100644
--- a/drivers/cdx/controller/cdx_controller.c
+++ b/drivers/cdx/controller/cdx_controller.c
@@ -193,7 +193,8 @@ static int xlnx_cdx_probe(struct platform_device *pdev)
cdx->ops = &cdx_ops;
/* Create MSI domain */
- cdx->msi_domain = cdx_msi_domain_init(&pdev->dev);
+ if (IS_ENABLED(CONFIG_GENERIC_MSI_IRQ))
+ cdx->msi_domain = cdx_msi_domain_init(&pdev->dev);
if (!cdx->msi_domain) {
ret = dev_err_probe(&pdev->dev, -ENODEV, "cdx_msi_domain_init() failed");
goto cdx_msi_fail;
--
2.39.5
Hi Arnd, kernel test robot noticed the following build errors: [auto build test ERROR on linus/master] [also build test ERROR on next-20250806] [cannot apply to soc/for-next v6.16] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Arnd-Bergmann/cdx-don-t-select-CONFIG_GENERIC_MSI_IRQ/20250806-121343 base: linus/master patch link: https://lore.kernel.org/r/20250805161059.4006484-1-arnd%40kernel.org patch subject: [PATCH] cdx: don't select CONFIG_GENERIC_MSI_IRQ config: hexagon-randconfig-002-20250807 (https://download.01.org/0day-ci/archive/20250807/202508070308.opy5dIFX-lkp@intel.com/config) compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 7b8dea265e72c3037b6b1e54d5ab51b7e14f328b) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250807/202508070308.opy5dIFX-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202508070308.opy5dIFX-lkp@intel.com/ All errors (new ones prefixed by >>): >> drivers/vfio/cdx/intr.c:41:8: error: call to undeclared function 'msi_domain_alloc_irqs'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 41 | ret = msi_domain_alloc_irqs(dev, MSI_DEFAULT_DOMAIN, nvec); | ^ drivers/vfio/cdx/intr.c:41:8: note: did you mean 'msi_domain_get_virq'? include/linux/msi_api.h:58:14: note: 'msi_domain_get_virq' declared here 58 | unsigned int msi_domain_get_virq(struct device *dev, unsigned int domid, unsigned int index); | ^ >> drivers/vfio/cdx/intr.c:135:2: error: call to undeclared function 'msi_domain_free_irqs_all'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 135 | msi_domain_free_irqs_all(dev, MSI_DEFAULT_DOMAIN); | ^ 2 errors generated. vim +/msi_domain_alloc_irqs +41 drivers/vfio/cdx/intr.c 848e447e000c418 Nipun Gupta 2024-04-23 23 848e447e000c418 Nipun Gupta 2024-04-23 24 static int vfio_cdx_msi_enable(struct vfio_cdx_device *vdev, int nvec) 848e447e000c418 Nipun Gupta 2024-04-23 25 { 848e447e000c418 Nipun Gupta 2024-04-23 26 struct cdx_device *cdx_dev = to_cdx_device(vdev->vdev.dev); 848e447e000c418 Nipun Gupta 2024-04-23 27 struct device *dev = vdev->vdev.dev; 848e447e000c418 Nipun Gupta 2024-04-23 28 int msi_idx, ret; 848e447e000c418 Nipun Gupta 2024-04-23 29 848e447e000c418 Nipun Gupta 2024-04-23 30 vdev->cdx_irqs = kcalloc(nvec, sizeof(struct vfio_cdx_irq), GFP_KERNEL); 848e447e000c418 Nipun Gupta 2024-04-23 31 if (!vdev->cdx_irqs) 848e447e000c418 Nipun Gupta 2024-04-23 32 return -ENOMEM; 848e447e000c418 Nipun Gupta 2024-04-23 33 848e447e000c418 Nipun Gupta 2024-04-23 34 ret = cdx_enable_msi(cdx_dev); 848e447e000c418 Nipun Gupta 2024-04-23 35 if (ret) { 848e447e000c418 Nipun Gupta 2024-04-23 36 kfree(vdev->cdx_irqs); 848e447e000c418 Nipun Gupta 2024-04-23 37 return ret; 848e447e000c418 Nipun Gupta 2024-04-23 38 } 848e447e000c418 Nipun Gupta 2024-04-23 39 848e447e000c418 Nipun Gupta 2024-04-23 40 /* Allocate cdx MSIs */ 848e447e000c418 Nipun Gupta 2024-04-23 @41 ret = msi_domain_alloc_irqs(dev, MSI_DEFAULT_DOMAIN, nvec); 848e447e000c418 Nipun Gupta 2024-04-23 42 if (ret) { 848e447e000c418 Nipun Gupta 2024-04-23 43 cdx_disable_msi(cdx_dev); 848e447e000c418 Nipun Gupta 2024-04-23 44 kfree(vdev->cdx_irqs); 848e447e000c418 Nipun Gupta 2024-04-23 45 return ret; 848e447e000c418 Nipun Gupta 2024-04-23 46 } 848e447e000c418 Nipun Gupta 2024-04-23 47 848e447e000c418 Nipun Gupta 2024-04-23 48 for (msi_idx = 0; msi_idx < nvec; msi_idx++) 848e447e000c418 Nipun Gupta 2024-04-23 49 vdev->cdx_irqs[msi_idx].irq_no = msi_get_virq(dev, msi_idx); 848e447e000c418 Nipun Gupta 2024-04-23 50 848e447e000c418 Nipun Gupta 2024-04-23 51 vdev->msi_count = nvec; 848e447e000c418 Nipun Gupta 2024-04-23 52 vdev->config_msi = 1; 848e447e000c418 Nipun Gupta 2024-04-23 53 848e447e000c418 Nipun Gupta 2024-04-23 54 return 0; 848e447e000c418 Nipun Gupta 2024-04-23 55 } 848e447e000c418 Nipun Gupta 2024-04-23 56 848e447e000c418 Nipun Gupta 2024-04-23 57 static int vfio_cdx_msi_set_vector_signal(struct vfio_cdx_device *vdev, 848e447e000c418 Nipun Gupta 2024-04-23 58 int vector, int fd) 848e447e000c418 Nipun Gupta 2024-04-23 59 { 848e447e000c418 Nipun Gupta 2024-04-23 60 struct eventfd_ctx *trigger; 848e447e000c418 Nipun Gupta 2024-04-23 61 int irq_no, ret; 848e447e000c418 Nipun Gupta 2024-04-23 62 848e447e000c418 Nipun Gupta 2024-04-23 63 if (vector < 0 || vector >= vdev->msi_count) 848e447e000c418 Nipun Gupta 2024-04-23 64 return -EINVAL; 848e447e000c418 Nipun Gupta 2024-04-23 65 848e447e000c418 Nipun Gupta 2024-04-23 66 irq_no = vdev->cdx_irqs[vector].irq_no; 848e447e000c418 Nipun Gupta 2024-04-23 67 848e447e000c418 Nipun Gupta 2024-04-23 68 if (vdev->cdx_irqs[vector].trigger) { 848e447e000c418 Nipun Gupta 2024-04-23 69 free_irq(irq_no, vdev->cdx_irqs[vector].trigger); 848e447e000c418 Nipun Gupta 2024-04-23 70 kfree(vdev->cdx_irqs[vector].name); 848e447e000c418 Nipun Gupta 2024-04-23 71 eventfd_ctx_put(vdev->cdx_irqs[vector].trigger); 848e447e000c418 Nipun Gupta 2024-04-23 72 vdev->cdx_irqs[vector].trigger = NULL; 848e447e000c418 Nipun Gupta 2024-04-23 73 } 848e447e000c418 Nipun Gupta 2024-04-23 74 848e447e000c418 Nipun Gupta 2024-04-23 75 if (fd < 0) 848e447e000c418 Nipun Gupta 2024-04-23 76 return 0; 848e447e000c418 Nipun Gupta 2024-04-23 77 848e447e000c418 Nipun Gupta 2024-04-23 78 vdev->cdx_irqs[vector].name = kasprintf(GFP_KERNEL, "vfio-msi[%d](%s)", 848e447e000c418 Nipun Gupta 2024-04-23 79 vector, dev_name(vdev->vdev.dev)); 848e447e000c418 Nipun Gupta 2024-04-23 80 if (!vdev->cdx_irqs[vector].name) 848e447e000c418 Nipun Gupta 2024-04-23 81 return -ENOMEM; 848e447e000c418 Nipun Gupta 2024-04-23 82 848e447e000c418 Nipun Gupta 2024-04-23 83 trigger = eventfd_ctx_fdget(fd); 848e447e000c418 Nipun Gupta 2024-04-23 84 if (IS_ERR(trigger)) { 848e447e000c418 Nipun Gupta 2024-04-23 85 kfree(vdev->cdx_irqs[vector].name); 848e447e000c418 Nipun Gupta 2024-04-23 86 return PTR_ERR(trigger); 848e447e000c418 Nipun Gupta 2024-04-23 87 } 848e447e000c418 Nipun Gupta 2024-04-23 88 848e447e000c418 Nipun Gupta 2024-04-23 89 ret = request_irq(irq_no, vfio_cdx_msihandler, 0, 848e447e000c418 Nipun Gupta 2024-04-23 90 vdev->cdx_irqs[vector].name, trigger); 848e447e000c418 Nipun Gupta 2024-04-23 91 if (ret) { 848e447e000c418 Nipun Gupta 2024-04-23 92 kfree(vdev->cdx_irqs[vector].name); 848e447e000c418 Nipun Gupta 2024-04-23 93 eventfd_ctx_put(trigger); 848e447e000c418 Nipun Gupta 2024-04-23 94 return ret; 848e447e000c418 Nipun Gupta 2024-04-23 95 } 848e447e000c418 Nipun Gupta 2024-04-23 96 848e447e000c418 Nipun Gupta 2024-04-23 97 vdev->cdx_irqs[vector].trigger = trigger; 848e447e000c418 Nipun Gupta 2024-04-23 98 848e447e000c418 Nipun Gupta 2024-04-23 99 return 0; 848e447e000c418 Nipun Gupta 2024-04-23 100 } 848e447e000c418 Nipun Gupta 2024-04-23 101 848e447e000c418 Nipun Gupta 2024-04-23 102 static int vfio_cdx_msi_set_block(struct vfio_cdx_device *vdev, 848e447e000c418 Nipun Gupta 2024-04-23 103 unsigned int start, unsigned int count, 848e447e000c418 Nipun Gupta 2024-04-23 104 int32_t *fds) 848e447e000c418 Nipun Gupta 2024-04-23 105 { 848e447e000c418 Nipun Gupta 2024-04-23 106 int i, j, ret = 0; 848e447e000c418 Nipun Gupta 2024-04-23 107 848e447e000c418 Nipun Gupta 2024-04-23 108 if (start >= vdev->msi_count || start + count > vdev->msi_count) 848e447e000c418 Nipun Gupta 2024-04-23 109 return -EINVAL; 848e447e000c418 Nipun Gupta 2024-04-23 110 848e447e000c418 Nipun Gupta 2024-04-23 111 for (i = 0, j = start; i < count && !ret; i++, j++) { 848e447e000c418 Nipun Gupta 2024-04-23 112 int fd = fds ? fds[i] : -1; 848e447e000c418 Nipun Gupta 2024-04-23 113 848e447e000c418 Nipun Gupta 2024-04-23 114 ret = vfio_cdx_msi_set_vector_signal(vdev, j, fd); 848e447e000c418 Nipun Gupta 2024-04-23 115 } 848e447e000c418 Nipun Gupta 2024-04-23 116 848e447e000c418 Nipun Gupta 2024-04-23 117 if (ret) { 848e447e000c418 Nipun Gupta 2024-04-23 118 for (--j; j >= (int)start; j--) 848e447e000c418 Nipun Gupta 2024-04-23 119 vfio_cdx_msi_set_vector_signal(vdev, j, -1); 848e447e000c418 Nipun Gupta 2024-04-23 120 } 848e447e000c418 Nipun Gupta 2024-04-23 121 848e447e000c418 Nipun Gupta 2024-04-23 122 return ret; 848e447e000c418 Nipun Gupta 2024-04-23 123 } 848e447e000c418 Nipun Gupta 2024-04-23 124 848e447e000c418 Nipun Gupta 2024-04-23 125 static void vfio_cdx_msi_disable(struct vfio_cdx_device *vdev) 848e447e000c418 Nipun Gupta 2024-04-23 126 { 848e447e000c418 Nipun Gupta 2024-04-23 127 struct cdx_device *cdx_dev = to_cdx_device(vdev->vdev.dev); 848e447e000c418 Nipun Gupta 2024-04-23 128 struct device *dev = vdev->vdev.dev; 848e447e000c418 Nipun Gupta 2024-04-23 129 848e447e000c418 Nipun Gupta 2024-04-23 130 vfio_cdx_msi_set_block(vdev, 0, vdev->msi_count, NULL); 848e447e000c418 Nipun Gupta 2024-04-23 131 848e447e000c418 Nipun Gupta 2024-04-23 132 if (!vdev->config_msi) 848e447e000c418 Nipun Gupta 2024-04-23 133 return; 848e447e000c418 Nipun Gupta 2024-04-23 134 848e447e000c418 Nipun Gupta 2024-04-23 @135 msi_domain_free_irqs_all(dev, MSI_DEFAULT_DOMAIN); 848e447e000c418 Nipun Gupta 2024-04-23 136 cdx_disable_msi(cdx_dev); 848e447e000c418 Nipun Gupta 2024-04-23 137 kfree(vdev->cdx_irqs); 848e447e000c418 Nipun Gupta 2024-04-23 138 848e447e000c418 Nipun Gupta 2024-04-23 139 vdev->cdx_irqs = NULL; 848e447e000c418 Nipun Gupta 2024-04-23 140 vdev->msi_count = 0; 848e447e000c418 Nipun Gupta 2024-04-23 141 vdev->config_msi = 0; 848e447e000c418 Nipun Gupta 2024-04-23 142 } 848e447e000c418 Nipun Gupta 2024-04-23 143 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
On 05/08/2025 18:10, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > x86 does not use CONFIG_GENERIC_MSI_IRQ, and trying to enable it anyway > results in a build failure: > > In file included from include/linux/ssb/ssb.h:10, > from drivers/ssb/pcihost_wrapper.c:18: > include/linux/gpio/driver.h:41:33: error: field 'msiinfo' has incomplete type > 41 | msi_alloc_info_t msiinfo; > | ^~~~~~~ > In file included from include/linux/kvm_host.h:19, > from arch/x86/events/intel/core.c:17: > include/linux/msi.h:528:33: error: field 'alloc_info' has incomplete type > 528 | msi_alloc_info_t alloc_info; > > Change the driver to actually build without this symbol and remove the > incorrect 'select' statements. > Maybe also original reported-by credits? https://lore.kernel.org/all/20250717091053.129175-2-krzysztof.kozlowski@linaro.org/ And cc-stable and fixes. I started working on this and had similar fix, but then I got impression the CDX people will fix that: https://lore.kernel.org/all/BL1PR12MB5333449243C7FE258728C8E39D5EA@BL1PR12MB5333.namprd12.prod.outlook.com/ so I stopped working. Shall CDX maintainers entry be changed to Odd Fixes? Best regards, Krzysztof
On 2025-08-05 5:10 pm, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > x86 does not use CONFIG_GENERIC_MSI_IRQ, and trying to enable it anyway > results in a build failure: > > In file included from include/linux/ssb/ssb.h:10, > from drivers/ssb/pcihost_wrapper.c:18: > include/linux/gpio/driver.h:41:33: error: field 'msiinfo' has incomplete type > 41 | msi_alloc_info_t msiinfo; > | ^~~~~~~ > In file included from include/linux/kvm_host.h:19, > from arch/x86/events/intel/core.c:17: > include/linux/msi.h:528:33: error: field 'alloc_info' has incomplete type > 528 | msi_alloc_info_t alloc_info; > > Change the driver to actually build without this symbol and remove the > incorrect 'select' statements. Looks OK to me, the Makefile is clearly trying to support building without this force-enabled anyway. In fact I'd go as far as saying that this also deserves a Fixes: e8b18c11731d ("cdx: Fix missing GENERIC_MSI_IRQ on compile test") And FWIW, Reviewed-by: Robin Murphy <robin.murphy@arm.com> > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > drivers/cdx/Kconfig | 1 - > drivers/cdx/cdx.c | 2 +- > drivers/cdx/controller/Kconfig | 1 - > drivers/cdx/controller/cdx_controller.c | 3 ++- > 4 files changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/cdx/Kconfig b/drivers/cdx/Kconfig > index 3af41f51cf38..1f1e360507d7 100644 > --- a/drivers/cdx/Kconfig > +++ b/drivers/cdx/Kconfig > @@ -8,7 +8,6 @@ > config CDX_BUS > bool "CDX Bus driver" > depends on OF && ARM64 || COMPILE_TEST > - select GENERIC_MSI_IRQ > help > Driver to enable Composable DMA Transfer(CDX) Bus. CDX bus > exposes Fabric devices which uses composable DMA IP to the > diff --git a/drivers/cdx/cdx.c b/drivers/cdx/cdx.c > index 092306ca2541..1a5c95ba09ba 100644 > --- a/drivers/cdx/cdx.c > +++ b/drivers/cdx/cdx.c > @@ -310,7 +310,7 @@ static int cdx_probe(struct device *dev) > * Setup MSI device data so that generic MSI alloc/free can > * be used by the device driver. > */ > - if (cdx->msi_domain) { > + if (IS_ENABLED(CONFIG_GENERIC_MSI_IRQ) && cdx->msi_domain) { > error = msi_setup_device_data(&cdx_dev->dev); > if (error) > return error; > diff --git a/drivers/cdx/controller/Kconfig b/drivers/cdx/controller/Kconfig > index 0641a4c21e66..a480b62cbd1f 100644 > --- a/drivers/cdx/controller/Kconfig > +++ b/drivers/cdx/controller/Kconfig > @@ -10,7 +10,6 @@ if CDX_BUS > config CDX_CONTROLLER > tristate "CDX bus controller" > depends on HAS_DMA > - select GENERIC_MSI_IRQ > select REMOTEPROC > select RPMSG > help > diff --git a/drivers/cdx/controller/cdx_controller.c b/drivers/cdx/controller/cdx_controller.c > index fca83141e3e6..5e3fd89b6b56 100644 > --- a/drivers/cdx/controller/cdx_controller.c > +++ b/drivers/cdx/controller/cdx_controller.c > @@ -193,7 +193,8 @@ static int xlnx_cdx_probe(struct platform_device *pdev) > cdx->ops = &cdx_ops; > > /* Create MSI domain */ > - cdx->msi_domain = cdx_msi_domain_init(&pdev->dev); > + if (IS_ENABLED(CONFIG_GENERIC_MSI_IRQ)) > + cdx->msi_domain = cdx_msi_domain_init(&pdev->dev); > if (!cdx->msi_domain) { > ret = dev_err_probe(&pdev->dev, -ENODEV, "cdx_msi_domain_init() failed"); > goto cdx_msi_fail;
© 2016 - 2025 Red Hat, Inc.