Skip to contentSkip to conversation

PCI/MSI: Initialize the prepare descriptor by default

PATCH In review Naman Jain 3 participants 5 messages Jul 8, 2025 – Jul 9, 2025

Subsystems (3)
lore
Share & tools
lore

Naman Jain

author
#0 lore raw

PATCH 1/1 PCI/MSI: Initialize the prepare descriptor by default

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.

---
 drivers/pci/msi/irqdomain.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/pci/msi/irqdomain.c +2 -0
index 765312c92d9b..655e99b9c8cc 100644
@@ -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

Signature · 1 line
2.34.1
#1 lore raw
Quoted 24 lines · Naman Jain

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.

---
 drivers/pci/msi/irqdomain.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/pci/msi/irqdomain.c +2 -0
index 765312c92d9b..655e99b9c8cc 100644
@@ -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;
 	}
 }
 
Quoted 4 lines

base-commit: 26ffb3d6f02cd0935fb9fa3db897767beee1cb2a

Signature · 1 line
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.

author
#2 lore raw
Quoted 32 lines · Shradha Gupta
Quoted 24 lines · Naman Jain

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.

---
  drivers/pci/msi/irqdomain.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/pci/msi/irqdomain.c +2 -0
index 765312c92d9b..655e99b9c8cc 100644
@@ -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;
  	}
  }
 
Quoted 4 lines

base-commit: 26ffb3d6f02cd0935fb9fa3db897767beee1cb2a

Signature · 1 line
2.34.1

Hey Naman,

Quoted 6 lines

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

#3 lore raw
Quoted 32 lines · Naman Jain
Quoted 31 lines · Shradha Gupta
Quoted 23 lines · Naman Jain

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.

---
  drivers/pci/msi/irqdomain.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/pci/msi/irqdomain.c +2 -0
index 765312c92d9b..655e99b9c8cc 100644
@@ -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;
  	}
  }
 
Quoted 4 lines

base-commit: 26ffb3d6f02cd0935fb9fa3db897767beee1cb2a

Signature · 1 line
2.34.1

Hey Naman,

Quoted 8 lines
Quoted 3 lines

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

author
#4 lore raw
Quoted 40 lines · Bjorn Helgaas
Quoted 39 lines · Naman Jain
Quoted 31 lines · Shradha Gupta
Quoted 23 lines · Naman Jain

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.

---
   drivers/pci/msi/irqdomain.c | 2 ++
   1 file changed, 2 insertions(+)
drivers/pci/msi/irqdomain.c +2 -0
index 765312c92d9b..655e99b9c8cc 100644
@@ -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;
   	}
   }
 
Quoted 4 lines

base-commit: 26ffb3d6f02cd0935fb9fa3db897767beee1cb2a

Signature · 1 line
2.34.1

Hey Naman,

Quoted 3 lines

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.

Quoted 7 lines
Quoted 1 line

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