linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cdx: Fix missing GENERIC_MSI_IRQ on compile test
@ 2025-07-16  6:49 Krzysztof Kozlowski
  2025-07-16 20:12 ` Randy Dunlap
  2025-07-17 19:33 ` Alex Williamson
  0 siblings, 2 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2025-07-16  6:49 UTC (permalink / raw)
  To: Nipun Gupta, Nikhil Agarwal, Krzysztof Kozlowski,
	Greg Kroah-Hartman, linux-kernel
  Cc: Randy Dunlap

CDX_BUS driver uses msi_setup_device_data() which is selected by
GENERIC_MSI_IRQ, thus compile testing without the latter failed:

  /usr/bin/ld: drivers/cdx/cdx.o: in function `cdx_probe':
  build/drivers/cdx/cdx.c:314: undefined reference to `msi_setup_device_data'

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Closes: https://lore.kernel.org/all/b2c54a12-480c-448a-8b90-333cb03d9c14@infradead.org/
Fixes: 7f81907b7e3f ("cdx: Enable compile testing")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/cdx/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/cdx/Kconfig b/drivers/cdx/Kconfig
index 1f1e360507d7..3af41f51cf38 100644
--- a/drivers/cdx/Kconfig
+++ b/drivers/cdx/Kconfig
@@ -8,6 +8,7 @@
 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
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] cdx: Fix missing GENERIC_MSI_IRQ on compile test
  2025-07-16  6:49 [PATCH] cdx: Fix missing GENERIC_MSI_IRQ on compile test Krzysztof Kozlowski
@ 2025-07-16 20:12 ` Randy Dunlap
  2025-07-17 19:33 ` Alex Williamson
  1 sibling, 0 replies; 7+ messages in thread
From: Randy Dunlap @ 2025-07-16 20:12 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Nipun Gupta, Nikhil Agarwal,
	Greg Kroah-Hartman, linux-kernel



On 7/15/25 11:49 PM, Krzysztof Kozlowski wrote:
> CDX_BUS driver uses msi_setup_device_data() which is selected by
> GENERIC_MSI_IRQ, thus compile testing without the latter failed:
> 
>   /usr/bin/ld: drivers/cdx/cdx.o: in function `cdx_probe':
>   build/drivers/cdx/cdx.c:314: undefined reference to `msi_setup_device_data'
> 
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Closes: https://lore.kernel.org/all/b2c54a12-480c-448a-8b90-333cb03d9c14@infradead.org/
> Fixes: 7f81907b7e3f ("cdx: Enable compile testing")
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>

Thanks.

> ---
>  drivers/cdx/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/cdx/Kconfig b/drivers/cdx/Kconfig
> index 1f1e360507d7..3af41f51cf38 100644
> --- a/drivers/cdx/Kconfig
> +++ b/drivers/cdx/Kconfig
> @@ -8,6 +8,7 @@
>  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

-- 
~Randy

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] cdx: Fix missing GENERIC_MSI_IRQ on compile test
  2025-07-16  6:49 [PATCH] cdx: Fix missing GENERIC_MSI_IRQ on compile test Krzysztof Kozlowski
  2025-07-16 20:12 ` Randy Dunlap
@ 2025-07-17 19:33 ` Alex Williamson
  2025-07-17 20:40   ` Alex Williamson
  2025-07-18 13:34   ` Krzysztof Kozlowski
  1 sibling, 2 replies; 7+ messages in thread
From: Alex Williamson @ 2025-07-17 19:33 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Nipun Gupta, Nikhil Agarwal, Greg Kroah-Hartman, linux-kernel,
	Randy Dunlap

On Wed, 16 Jul 2025 08:49:04 +0200
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:

> CDX_BUS driver uses msi_setup_device_data() which is selected by
> GENERIC_MSI_IRQ, thus compile testing without the latter failed:
> 
>   /usr/bin/ld: drivers/cdx/cdx.o: in function `cdx_probe':
>   build/drivers/cdx/cdx.c:314: undefined reference to `msi_setup_device_data'
> 
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Closes: https://lore.kernel.org/all/b2c54a12-480c-448a-8b90-333cb03d9c14@infradead.org/
> Fixes: 7f81907b7e3f ("cdx: Enable compile testing")
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  drivers/cdx/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/cdx/Kconfig b/drivers/cdx/Kconfig
> index 1f1e360507d7..3af41f51cf38 100644
> --- a/drivers/cdx/Kconfig
> +++ b/drivers/cdx/Kconfig
> @@ -8,6 +8,7 @@
>  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

This looks incomplete to me.  The Makefile has:

ifdef CONFIG_GENERIC_MSI_IRQ
obj-$(CONFIG_CDX_BUS) += cdx_msi.o
endif

The call to msi_setup_device_data(), the conditional inclusion of
cdx_msi.o, and cdx_msi.c itself were added in 0e439ba38e61 ("cdx: add
MSI support for CDX bus").  That's the source of the issue, not the
Kconfig update to build under COMPILE_TEST, but also the Makefile
should be updated to statically include cdx_msi.o.  Thanks,

Alex


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] cdx: Fix missing GENERIC_MSI_IRQ on compile test
  2025-07-17 19:33 ` Alex Williamson
@ 2025-07-17 20:40   ` Alex Williamson
  2025-07-18 14:08     ` Krzysztof Kozlowski
  2025-07-24  7:29     ` Agarwal, Nikhil
  2025-07-18 13:34   ` Krzysztof Kozlowski
  1 sibling, 2 replies; 7+ messages in thread
From: Alex Williamson @ 2025-07-17 20:40 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Nipun Gupta, Nikhil Agarwal, Greg Kroah-Hartman, linux-kernel,
	Randy Dunlap

On Thu, 17 Jul 2025 13:33:58 -0600
Alex Williamson <alex.williamson@redhat.com> wrote:

> On Wed, 16 Jul 2025 08:49:04 +0200
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> 
> > CDX_BUS driver uses msi_setup_device_data() which is selected by
> > GENERIC_MSI_IRQ, thus compile testing without the latter failed:
> > 
> >   /usr/bin/ld: drivers/cdx/cdx.o: in function `cdx_probe':
> >   build/drivers/cdx/cdx.c:314: undefined reference to `msi_setup_device_data'
> > 
> > Reported-by: Randy Dunlap <rdunlap@infradead.org>
> > Closes: https://lore.kernel.org/all/b2c54a12-480c-448a-8b90-333cb03d9c14@infradead.org/
> > Fixes: 7f81907b7e3f ("cdx: Enable compile testing")
> > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > ---
> >  drivers/cdx/Kconfig | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/cdx/Kconfig b/drivers/cdx/Kconfig
> > index 1f1e360507d7..3af41f51cf38 100644
> > --- a/drivers/cdx/Kconfig
> > +++ b/drivers/cdx/Kconfig
> > @@ -8,6 +8,7 @@
> >  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  
> 
> This looks incomplete to me.  The Makefile has:
> 
> ifdef CONFIG_GENERIC_MSI_IRQ
> obj-$(CONFIG_CDX_BUS) += cdx_msi.o
> endif
> 
> The call to msi_setup_device_data(), the conditional inclusion of
> cdx_msi.o, and cdx_msi.c itself were added in 0e439ba38e61 ("cdx: add
> MSI support for CDX bus").  That's the source of the issue, not the
> Kconfig update to build under COMPILE_TEST, but also the Makefile
> should be updated to statically include cdx_msi.o.  Thanks,

Also, we may not be philosophically aligned on this, but if CDX_BUS
selects GENERIC_MSI_IRQ and CDX_CONTROLLER depends on CDX_BUS, then the
select of the same under CDX_CONTROLLER becomes redundant.

Independent of that there are also some ifdefs in cdx_bus.h that would
become invalid if the entire CDX_BUS depends on GENERIC_MSI_IRQ.  It
really kinda looks like CDX_BUS expects a use case that doesn't depend
on GENERIC_MSI_IRQ and I wonder if the right answer isn't just:

diff --git a/drivers/cdx/cdx.c b/drivers/cdx/cdx.c
index 092306ca2541..3d50f8cd9c0b 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;
@@ -833,7 +833,7 @@ int cdx_device_add(struct cdx_dev_params *dev_params)
 		     ((cdx->id << CDX_CONTROLLER_ID_SHIFT) | (cdx_dev->bus_num & CDX_BUS_NUM_MASK)),
 		     cdx_dev->dev_num);
 
-	if (cdx->msi_domain) {
+	if (IS_ENABLED(CONFIG_GENERIC_MSI_IRQ) && cdx->msi_domain) {
 		cdx_dev->num_msi = dev_params->num_msi;
 		dev_set_msi_domain(&cdx_dev->dev, cdx->msi_domain);
 	}

Then I suppose vfio-cdx would also have the option to either
select/depend on GENERIC_MSI_IRQ or perhaps get away with stubbing
vfio_cdx_set_irqs_ioctl and vfio_cdx_irqs_cleanup and conditionally
building intr.o, depending on if there's a use case without MSI.
Thanks,

Alex


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] cdx: Fix missing GENERIC_MSI_IRQ on compile test
  2025-07-17 19:33 ` Alex Williamson
  2025-07-17 20:40   ` Alex Williamson
@ 2025-07-18 13:34   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2025-07-18 13:34 UTC (permalink / raw)
  To: Alex Williamson
  Cc: Nipun Gupta, Nikhil Agarwal, Greg Kroah-Hartman, linux-kernel,
	Randy Dunlap

On 17/07/2025 21:33, Alex Williamson wrote:
> On Wed, 16 Jul 2025 08:49:04 +0200
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> 
>> CDX_BUS driver uses msi_setup_device_data() which is selected by
>> GENERIC_MSI_IRQ, thus compile testing without the latter failed:
>>
>>   /usr/bin/ld: drivers/cdx/cdx.o: in function `cdx_probe':
>>   build/drivers/cdx/cdx.c:314: undefined reference to `msi_setup_device_data'
>>
>> Reported-by: Randy Dunlap <rdunlap@infradead.org>
>> Closes: https://lore.kernel.org/all/b2c54a12-480c-448a-8b90-333cb03d9c14@infradead.org/
>> Fixes: 7f81907b7e3f ("cdx: Enable compile testing")
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> ---
>>  drivers/cdx/Kconfig | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/cdx/Kconfig b/drivers/cdx/Kconfig
>> index 1f1e360507d7..3af41f51cf38 100644
>> --- a/drivers/cdx/Kconfig
>> +++ b/drivers/cdx/Kconfig
>> @@ -8,6 +8,7 @@
>>  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
> 
> This looks incomplete to me.  The Makefile has:

Just FYI (because there was no public email), Greg applied this one, so
whatever we decide here will be on top.

> 
> ifdef CONFIG_GENERIC_MSI_IRQ
> obj-$(CONFIG_CDX_BUS) += cdx_msi.o
> endif
> 

Yes, this should be dropped in such case, at least with my patch.


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] cdx: Fix missing GENERIC_MSI_IRQ on compile test
  2025-07-17 20:40   ` Alex Williamson
@ 2025-07-18 14:08     ` Krzysztof Kozlowski
  2025-07-24  7:29     ` Agarwal, Nikhil
  1 sibling, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2025-07-18 14:08 UTC (permalink / raw)
  To: Alex Williamson
  Cc: Nipun Gupta, Nikhil Agarwal, Greg Kroah-Hartman, linux-kernel,
	Randy Dunlap

On 17/07/2025 22:40, Alex Williamson wrote:
> On Thu, 17 Jul 2025 13:33:58 -0600
> Alex Williamson <alex.williamson@redhat.com> wrote:
> 
>> On Wed, 16 Jul 2025 08:49:04 +0200
>> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
>>
>>> CDX_BUS driver uses msi_setup_device_data() which is selected by
>>> GENERIC_MSI_IRQ, thus compile testing without the latter failed:
>>>
>>>   /usr/bin/ld: drivers/cdx/cdx.o: in function `cdx_probe':
>>>   build/drivers/cdx/cdx.c:314: undefined reference to `msi_setup_device_data'
>>>
>>> Reported-by: Randy Dunlap <rdunlap@infradead.org>
>>> Closes: https://lore.kernel.org/all/b2c54a12-480c-448a-8b90-333cb03d9c14@infradead.org/
>>> Fixes: 7f81907b7e3f ("cdx: Enable compile testing")
>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>> ---
>>>  drivers/cdx/Kconfig | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/cdx/Kconfig b/drivers/cdx/Kconfig
>>> index 1f1e360507d7..3af41f51cf38 100644
>>> --- a/drivers/cdx/Kconfig
>>> +++ b/drivers/cdx/Kconfig
>>> @@ -8,6 +8,7 @@
>>>  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  
>>
>> This looks incomplete to me.  The Makefile has:
>>
>> ifdef CONFIG_GENERIC_MSI_IRQ
>> obj-$(CONFIG_CDX_BUS) += cdx_msi.o
>> endif
>>
>> The call to msi_setup_device_data(), the conditional inclusion of
>> cdx_msi.o, and cdx_msi.c itself were added in 0e439ba38e61 ("cdx: add
>> MSI support for CDX bus").  That's the source of the issue, not the
>> Kconfig update to build under COMPILE_TEST, but also the Makefile
>> should be updated to statically include cdx_msi.o.  Thanks,
> 
> Also, we may not be philosophically aligned on this, but if CDX_BUS
> selects GENERIC_MSI_IRQ and CDX_CONTROLLER depends on CDX_BUS, then the
> select of the same under CDX_CONTROLLER becomes redundant.

I don't have a preference for that. I imagine that they use/depend on
MSI independently of each other. At least I could imagine such code.


> 
> Independent of that there are also some ifdefs in cdx_bus.h that would
> become invalid if the entire CDX_BUS depends on GENERIC_MSI_IRQ.  It

These ifdefs are for cdx_msi.c which looks like quite independent piece
of code from cdx.c.

> really kinda looks like CDX_BUS expects a use case that doesn't depend
> on GENERIC_MSI_IRQ and I wonder if the right answer isn't just:

Yes, I agree.

> 
> diff --git a/drivers/cdx/cdx.c b/drivers/cdx/cdx.c
> index 092306ca2541..3d50f8cd9c0b 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;
> @@ -833,7 +833,7 @@ int cdx_device_add(struct cdx_dev_params *dev_params)
>  		     ((cdx->id << CDX_CONTROLLER_ID_SHIFT) | (cdx_dev->bus_num & CDX_BUS_NUM_MASK)),
>  		     cdx_dev->dev_num);
>  
> -	if (cdx->msi_domain) {
> +	if (IS_ENABLED(CONFIG_GENERIC_MSI_IRQ) && cdx->msi_domain) {
>  		cdx_dev->num_msi = dev_params->num_msi;
>  		dev_set_msi_domain(&cdx_dev->dev, cdx->msi_domain);
>  	}
> 
> Then I suppose vfio-cdx would also have the option to either
> select/depend on GENERIC_MSI_IRQ or perhaps get away with stubbing
> vfio_cdx_set_irqs_ioctl and vfio_cdx_irqs_cleanup and conditionally
> building intr.o, depending on if there's a use case without MSI.
> Thanks,

vfio/cdx/intr.c unconditionally calls cdx_enable_msi() and entire code
looks like relies on MSI. cdx_enable_msi() stub seems to be only for the
purpose of modular builds.

But these are just guesses...




Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] cdx: Fix missing GENERIC_MSI_IRQ on compile test
  2025-07-17 20:40   ` Alex Williamson
  2025-07-18 14:08     ` Krzysztof Kozlowski
@ 2025-07-24  7:29     ` Agarwal, Nikhil
  1 sibling, 0 replies; 7+ messages in thread
From: Agarwal, Nikhil @ 2025-07-24  7:29 UTC (permalink / raw)
  To: Alex Williamson, Krzysztof Kozlowski
  Cc: Gupta, Nipun, Greg Kroah-Hartman, linux-kernel@vger.kernel.org,
	Randy Dunlap



> -----Original Message-----
> From: Alex Williamson <alex.williamson@redhat.com>
> Sent: Friday, July 18, 2025 2:11 AM
> To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Cc: Gupta, Nipun <Nipun.Gupta@amd.com>; Agarwal, Nikhil
> <nikhil.agarwal@amd.com>; Greg Kroah-Hartman <gregkh@linuxfoundation.org>;
> linux-kernel@vger.kernel.org; Randy Dunlap <rdunlap@infradead.org>
> Subject: Re: [PATCH] cdx: Fix missing GENERIC_MSI_IRQ on compile test
> 
> On Thu, 17 Jul 2025 13:33:58 -0600
> Alex Williamson <alex.williamson@redhat.com> wrote:
> 
> > On Wed, 16 Jul 2025 08:49:04 +0200
> > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> >
> > > CDX_BUS driver uses msi_setup_device_data() which is selected by
> > > GENERIC_MSI_IRQ, thus compile testing without the latter failed:
> > >
> > >   /usr/bin/ld: drivers/cdx/cdx.o: in function `cdx_probe':
> > >   build/drivers/cdx/cdx.c:314: undefined reference to `msi_setup_device_data'
> > >
> > > Reported-by: Randy Dunlap <rdunlap@infradead.org>
> > > Closes:
> > > https://lore.kernel.org/all/b2c54a12-480c-448a-8b90-333cb03d9c14@inf
> > > radead.org/
> > > Fixes: 7f81907b7e3f ("cdx: Enable compile testing")
> > > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > ---
> > >  drivers/cdx/Kconfig | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/drivers/cdx/Kconfig b/drivers/cdx/Kconfig index
> > > 1f1e360507d7..3af41f51cf38 100644
> > > --- a/drivers/cdx/Kconfig
> > > +++ b/drivers/cdx/Kconfig
> > > @@ -8,6 +8,7 @@
> > >  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
> >
> > This looks incomplete to me.  The Makefile has:
> >
> > ifdef CONFIG_GENERIC_MSI_IRQ
> > obj-$(CONFIG_CDX_BUS) += cdx_msi.o
> > endif
> >
> > The call to msi_setup_device_data(), the conditional inclusion of
> > cdx_msi.o, and cdx_msi.c itself were added in 0e439ba38e61 ("cdx: add
> > MSI support for CDX bus").  That's the source of the issue, not the
> > Kconfig update to build under COMPILE_TEST, but also the Makefile
> > should be updated to statically include cdx_msi.o.  Thanks,
> 
> Also, we may not be philosophically aligned on this, but if CDX_BUS selects
> GENERIC_MSI_IRQ and CDX_CONTROLLER depends on CDX_BUS, then the
> select of the same under CDX_CONTROLLER becomes redundant.
> 
> Independent of that there are also some ifdefs in cdx_bus.h that would become
> invalid if the entire CDX_BUS depends on GENERIC_MSI_IRQ.  It really kinda
> looks like CDX_BUS expects a use case that doesn't depend on
> GENERIC_MSI_IRQ and I wonder if the right answer isn't just:
> 
> diff --git a/drivers/cdx/cdx.c b/drivers/cdx/cdx.c index 092306ca2541..3d50f8cd9c0b
> 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;
> @@ -833,7 +833,7 @@ int cdx_device_add(struct cdx_dev_params *dev_params)
>  		     ((cdx->id << CDX_CONTROLLER_ID_SHIFT) | (cdx_dev-
> >bus_num & CDX_BUS_NUM_MASK)),
>  		     cdx_dev->dev_num);
> 
> -	if (cdx->msi_domain) {
> +	if (IS_ENABLED(CONFIG_GENERIC_MSI_IRQ) && cdx->msi_domain) {
>  		cdx_dev->num_msi = dev_params->num_msi;
>  		dev_set_msi_domain(&cdx_dev->dev, cdx->msi_domain);
>  	}
> 
> Then I suppose vfio-cdx would also have the option to either select/depend on
> GENERIC_MSI_IRQ or perhaps get away with stubbing vfio_cdx_set_irqs_ioctl and
> vfio_cdx_irqs_cleanup and conditionally building intr.o, depending on if there's a
> use case without MSI.
Apologies for the late response here, was on vacation last week. CDX bus is supposed to be independent of CONFIG_GENERIC_MSI_IRQ.
Will send a patch to fix it on similar lines suggested by Alex.

> Thanks,
> 
> Alex


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-07-24  7:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-16  6:49 [PATCH] cdx: Fix missing GENERIC_MSI_IRQ on compile test Krzysztof Kozlowski
2025-07-16 20:12 ` Randy Dunlap
2025-07-17 19:33 ` Alex Williamson
2025-07-17 20:40   ` Alex Williamson
2025-07-18 14:08     ` Krzysztof Kozlowski
2025-07-24  7:29     ` Agarwal, Nikhil
2025-07-18 13:34   ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).