linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI/MSI: Initialize the prepare descriptor by default
@ 2025-07-08  5:18 Naman Jain
  2025-07-08 10:02 ` Shradha Gupta
  0 siblings, 1 reply; 5+ messages in thread
From: Naman Jain @ 2025-07-08  5:18 UTC (permalink / raw)
  To: Bjorn Helgaas, Thomas Gleixner, Marc Zyngier, Lorenzo Pieralisi,
	Shivamurthy Shastri, Shradha Gupta
  Cc: Naman Jain, linux-pci, linux-kernel, linux-hyperv, Roman Kisel

Plug the default MSI-X prepare descriptor for non-implemented ops by
default to workaround the inability of Hyper-V vPCI module to setup
the MSI-X descriptors properly; especially for dynamically allocated
MSI-X.

Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
---
 drivers/pci/msi/irqdomain.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pci/msi/irqdomain.c b/drivers/pci/msi/irqdomain.c
index 765312c92d9b..655e99b9c8cc 100644
--- a/drivers/pci/msi/irqdomain.c
+++ b/drivers/pci/msi/irqdomain.c
@@ -84,6 +84,8 @@ static void pci_msi_domain_update_dom_ops(struct msi_domain_info *info)
 	} else {
 		if (ops->set_desc == NULL)
 			ops->set_desc = pci_msi_domain_set_desc;
+		if (ops->prepare_desc == NULL)
+			ops->prepare_desc = pci_msix_prepare_desc;
 	}
 }
 

base-commit: 26ffb3d6f02cd0935fb9fa3db897767beee1cb2a
-- 
2.34.1


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

* Re: [PATCH] PCI/MSI: Initialize the prepare descriptor by default
  2025-07-08  5:18 [PATCH] PCI/MSI: Initialize the prepare descriptor by default Naman Jain
@ 2025-07-08 10:02 ` Shradha Gupta
  2025-07-08 10:15   ` Naman Jain
  0 siblings, 1 reply; 5+ messages in thread
From: Shradha Gupta @ 2025-07-08 10:02 UTC (permalink / raw)
  To: Naman Jain
  Cc: Bjorn Helgaas, Thomas Gleixner, Marc Zyngier, Lorenzo Pieralisi,
	Shivamurthy Shastri, linux-pci, linux-kernel, linux-hyperv,
	Roman Kisel

On Tue, Jul 08, 2025 at 10:48:48AM +0530, Naman Jain wrote:
> Plug the default MSI-X prepare descriptor for non-implemented ops by
> default to workaround the inability of Hyper-V vPCI module to setup
> the MSI-X descriptors properly; especially for dynamically allocated
> MSI-X.
> 
> Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
> ---
>  drivers/pci/msi/irqdomain.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/pci/msi/irqdomain.c b/drivers/pci/msi/irqdomain.c
> index 765312c92d9b..655e99b9c8cc 100644
> --- a/drivers/pci/msi/irqdomain.c
> +++ b/drivers/pci/msi/irqdomain.c
> @@ -84,6 +84,8 @@ static void pci_msi_domain_update_dom_ops(struct msi_domain_info *info)
>  	} else {
>  		if (ops->set_desc == NULL)
>  			ops->set_desc = pci_msi_domain_set_desc;
> +		if (ops->prepare_desc == NULL)
> +			ops->prepare_desc = pci_msix_prepare_desc;
>  	}
>  }
>  
> 
> base-commit: 26ffb3d6f02cd0935fb9fa3db897767beee1cb2a
> -- 
> 2.34.1
>

Hey Naman,

can you please try your tests with this patch:
https://lore.kernel.org/all/1749651015-9668-1-git-send-email-shradhagupta@linux.microsoft.com/
I think this should help your use case

Regards,
Shradha. 

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

* Re: [PATCH] PCI/MSI: Initialize the prepare descriptor by default
  2025-07-08 10:02 ` Shradha Gupta
@ 2025-07-08 10:15   ` Naman Jain
  2025-07-08 16:08     ` Bjorn Helgaas
  0 siblings, 1 reply; 5+ messages in thread
From: Naman Jain @ 2025-07-08 10:15 UTC (permalink / raw)
  To: Shradha Gupta
  Cc: Bjorn Helgaas, Thomas Gleixner, Marc Zyngier, Lorenzo Pieralisi,
	Shivamurthy Shastri, linux-pci, linux-kernel, linux-hyperv,
	Roman Kisel



On 7/8/2025 3:32 PM, Shradha Gupta wrote:
> On Tue, Jul 08, 2025 at 10:48:48AM +0530, Naman Jain wrote:
>> Plug the default MSI-X prepare descriptor for non-implemented ops by
>> default to workaround the inability of Hyper-V vPCI module to setup
>> the MSI-X descriptors properly; especially for dynamically allocated
>> MSI-X.
>>
>> Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
>> ---
>>   drivers/pci/msi/irqdomain.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/pci/msi/irqdomain.c b/drivers/pci/msi/irqdomain.c
>> index 765312c92d9b..655e99b9c8cc 100644
>> --- a/drivers/pci/msi/irqdomain.c
>> +++ b/drivers/pci/msi/irqdomain.c
>> @@ -84,6 +84,8 @@ static void pci_msi_domain_update_dom_ops(struct msi_domain_info *info)
>>   	} else {
>>   		if (ops->set_desc == NULL)
>>   			ops->set_desc = pci_msi_domain_set_desc;
>> +		if (ops->prepare_desc == NULL)
>> +			ops->prepare_desc = pci_msix_prepare_desc;
>>   	}
>>   }
>>   
>>
>> base-commit: 26ffb3d6f02cd0935fb9fa3db897767beee1cb2a
>> -- 
>> 2.34.1
>>
> 
> Hey Naman,
> 
> can you please try your tests with this patch:
> https://lore.kernel.org/all/1749651015-9668-1-git-send-email-shradhagupta@linux.microsoft.com/
> I think this should help your use case
> 
> Regards,
> Shradha.

Hey,
Thanks for sharing this, this works for me.

Closing this thread.

Regards,
Naman

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

* Re: [PATCH] PCI/MSI: Initialize the prepare descriptor by default
  2025-07-08 10:15   ` Naman Jain
@ 2025-07-08 16:08     ` Bjorn Helgaas
  2025-07-09  4:42       ` Naman Jain
  0 siblings, 1 reply; 5+ messages in thread
From: Bjorn Helgaas @ 2025-07-08 16:08 UTC (permalink / raw)
  To: Naman Jain
  Cc: Shradha Gupta, Bjorn Helgaas, Thomas Gleixner, Marc Zyngier,
	Lorenzo Pieralisi, Shivamurthy Shastri, linux-pci, linux-kernel,
	linux-hyperv, Roman Kisel

On Tue, Jul 08, 2025 at 03:45:05PM +0530, Naman Jain wrote:
> On 7/8/2025 3:32 PM, Shradha Gupta wrote:
> > On Tue, Jul 08, 2025 at 10:48:48AM +0530, Naman Jain wrote:
> > > Plug the default MSI-X prepare descriptor for non-implemented ops by
> > > default to workaround the inability of Hyper-V vPCI module to setup
> > > the MSI-X descriptors properly; especially for dynamically allocated
> > > MSI-X.
> > > 
> > > Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
> > > ---
> > >   drivers/pci/msi/irqdomain.c | 2 ++
> > >   1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/drivers/pci/msi/irqdomain.c b/drivers/pci/msi/irqdomain.c
> > > index 765312c92d9b..655e99b9c8cc 100644
> > > --- a/drivers/pci/msi/irqdomain.c
> > > +++ b/drivers/pci/msi/irqdomain.c
> > > @@ -84,6 +84,8 @@ static void pci_msi_domain_update_dom_ops(struct msi_domain_info *info)
> > >   	} else {
> > >   		if (ops->set_desc == NULL)
> > >   			ops->set_desc = pci_msi_domain_set_desc;
> > > +		if (ops->prepare_desc == NULL)
> > > +			ops->prepare_desc = pci_msix_prepare_desc;
> > >   	}
> > >   }
> > > 
> > > base-commit: 26ffb3d6f02cd0935fb9fa3db897767beee1cb2a
> > > -- 
> > > 2.34.1
> > > 
> > 
> > Hey Naman,
> > 
> > can you please try your tests with this patch:
> > https://lore.kernel.org/all/1749651015-9668-1-git-send-email-shradhagupta@linux.microsoft.com/
> > I think this should help your use case
> 
> Hey,
> Thanks for sharing this, this works for me.
> 
> Closing this thread.

I guess this means we should ignore this patch?  If it turns out that
we do need this patch, I'd like to add some details in the commit log
about what this problem looks like to users.

Bjorn

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

* Re: [PATCH] PCI/MSI: Initialize the prepare descriptor by default
  2025-07-08 16:08     ` Bjorn Helgaas
@ 2025-07-09  4:42       ` Naman Jain
  0 siblings, 0 replies; 5+ messages in thread
From: Naman Jain @ 2025-07-09  4:42 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Shradha Gupta, Bjorn Helgaas, Thomas Gleixner, Marc Zyngier,
	Lorenzo Pieralisi, Shivamurthy Shastri, linux-pci, linux-kernel,
	linux-hyperv, Roman Kisel



On 7/8/2025 9:38 PM, Bjorn Helgaas wrote:
> On Tue, Jul 08, 2025 at 03:45:05PM +0530, Naman Jain wrote:
>> On 7/8/2025 3:32 PM, Shradha Gupta wrote:
>>> On Tue, Jul 08, 2025 at 10:48:48AM +0530, Naman Jain wrote:
>>>> Plug the default MSI-X prepare descriptor for non-implemented ops by
>>>> default to workaround the inability of Hyper-V vPCI module to setup
>>>> the MSI-X descriptors properly; especially for dynamically allocated
>>>> MSI-X.
>>>>
>>>> Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
>>>> ---
>>>>    drivers/pci/msi/irqdomain.c | 2 ++
>>>>    1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/drivers/pci/msi/irqdomain.c b/drivers/pci/msi/irqdomain.c
>>>> index 765312c92d9b..655e99b9c8cc 100644
>>>> --- a/drivers/pci/msi/irqdomain.c
>>>> +++ b/drivers/pci/msi/irqdomain.c
>>>> @@ -84,6 +84,8 @@ static void pci_msi_domain_update_dom_ops(struct msi_domain_info *info)
>>>>    	} else {
>>>>    		if (ops->set_desc == NULL)
>>>>    			ops->set_desc = pci_msi_domain_set_desc;
>>>> +		if (ops->prepare_desc == NULL)
>>>> +			ops->prepare_desc = pci_msix_prepare_desc;
>>>>    	}
>>>>    }
>>>>
>>>> base-commit: 26ffb3d6f02cd0935fb9fa3db897767beee1cb2a
>>>> -- 
>>>> 2.34.1
>>>>
>>>
>>> Hey Naman,
>>>
>>> can you please try your tests with this patch:
>>> https://lore.kernel.org/all/1749651015-9668-1-git-send-email-shradhagupta@linux.microsoft.com/
>>> I think this should help your use case
>>
>> Hey,
>> Thanks for sharing this, this works for me.
>>
>> Closing this thread.
> 
> I guess this means we should ignore this patch?  If it turns out that
> we do need this patch, I'd like to add some details in the commit log
> about what this problem looks like to users.
> 
> Bjorn

Yes, my patch is no longer required, since it was doing the same thing
that Shradha's patch (1-2) were doing, but in a different way. Shradha's
patch is better and would suffice for the use case. Please ignore this
patch.

Thanks.
Regards,
Naman

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

end of thread, other threads:[~2025-07-09  4:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-08  5:18 [PATCH] PCI/MSI: Initialize the prepare descriptor by default Naman Jain
2025-07-08 10:02 ` Shradha Gupta
2025-07-08 10:15   ` Naman Jain
2025-07-08 16:08     ` Bjorn Helgaas
2025-07-09  4:42       ` Naman Jain

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).