Skip to contentSkip to conversation

PCI: dwc: EXPORT dw_pcie_allocate_domains

PATCH In review Samiksha Garg 5 participants 9 messages May 26, 2025 – May 28, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: dwc: EXPORT dw_pcie_allocate_domains

Some vendor drivers need to write their own msi_init while still utilizing dw_pcie_allocate_domains method to allocate IRQ domains. Export the function for this purpose.

---
 drivers/pci/controller/dwc/pcie-designware-host.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pci/controller/dwc/pcie-designware-host.c +1 -0
index ecc33f6789e3..5b949547f917 100644
@@ -249,6 +249,7 @@ int dw_pcie_allocate_domains(struct dw_pcie_rp *pp)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(dw_pcie_allocate_domains);
 
 static void dw_pcie_free_msi(struct dw_pcie_rp *pp)
 {
Signature · 1 line
2.49.0.1151.ga128411c76-goog
#1 lore raw
Quoted 4 lines · Samiksha Garg

Some vendor drivers need to write their own msi_init while still utilizing dw_pcie_allocate_domains method to allocate IRQ domains. Export the function for this purpose.

NAK. Symbols should have atleast one upstream user to be exported. We do not export symbols for random vendor drivers, sorry.

- Mani

Quoted 20 lines
---
 drivers/pci/controller/dwc/pcie-designware-host.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pci/controller/dwc/pcie-designware-host.c +1 -0
index ecc33f6789e3..5b949547f917 100644
@@ -249,6 +249,7 @@ int dw_pcie_allocate_domains(struct dw_pcie_rp *pp)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(dw_pcie_allocate_domains);
 
 static void dw_pcie_free_msi(struct dw_pcie_rp *pp)
 {
Signature · 1 line
2.49.0.1151.ga128411c76-goog
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#2 lore raw

Hi Mani,
Thanks for your response. I can see that pci-keystone driver already calls this function. Does it not mean that there is already an upstream user?

Thanks,
Samiksha

Quoted 34 lines · Manivannan Sadhasivam
Quoted 4 lines · Samiksha Garg

Some vendor drivers need to write their own msi_init while still utilizing dw_pcie_allocate_domains method to allocate IRQ domains. Export the function for this purpose.

NAK. Symbols should have atleast one upstream user to be exported. We do not export symbols for random vendor drivers, sorry.

- Mani

Quoted 20 lines
---
 drivers/pci/controller/dwc/pcie-designware-host.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pci/controller/dwc/pcie-designware-host.c +1 -0
index ecc33f6789e3..5b949547f917 100644
@@ -249,6 +249,7 @@ int dw_pcie_allocate_domains(struct dw_pcie_rp *pp)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(dw_pcie_allocate_domains);
 
 static void dw_pcie_free_msi(struct dw_pcie_rp *pp)
 {
Signature · 1 line
2.49.0.1151.ga128411c76-goog
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#3 lore raw
Quoted 4 lines · Samiksha Garg

Hi Mani,
Thanks for your response. I can see that pci-keystone driver already calls this function. Does it not mean that there is already an upstream user?

No, since keystone driver is not using the exported symbol.

- Mani

Quoted 38 lines

Thanks,
Samiksha

Quoted 34 lines · Manivannan Sadhasivam
Quoted 4 lines · Samiksha Garg

Some vendor drivers need to write their own msi_init while still utilizing dw_pcie_allocate_domains method to allocate IRQ domains. Export the function for this purpose.

NAK. Symbols should have atleast one upstream user to be exported. We do not export symbols for random vendor drivers, sorry.

- Mani

Quoted 20 lines
---
 drivers/pci/controller/dwc/pcie-designware-host.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pci/controller/dwc/pcie-designware-host.c +1 -0
index ecc33f6789e3..5b949547f917 100644
@@ -249,6 +249,7 @@ int dw_pcie_allocate_domains(struct dw_pcie_rp *pp)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(dw_pcie_allocate_domains);
 
 static void dw_pcie_free_msi(struct dw_pcie_rp *pp)
 {
Signature · 1 line
2.49.0.1151.ga128411c76-goog
Signature · 1 line
மணிவண்ணன் சதாசிவம்
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#4 lore raw
In reply to Samiksha Garg
Quoted 31 lines · Samiksha Garg

Hi Mani, Thanks for your response. I can see that pci-keystone driver already calls this function. Does it not mean that there is already an upstream user? Thanks, Samiksha On Mon, May 26, 2025 at 04:50:11PM

Quoted 29 lines · Manivannan Sadhasivam
Quoted 4 lines · Samiksha Garg

Some vendor drivers need to write their own msi_init while still utilizing dw_pcie_allocate_domains method to allocate IRQ domains. Export the function for this purpose.

NAK. Symbols should have atleast one upstream user to be exported. We do not export symbols for random vendor drivers, sorry.

- Mani

Quoted 19 lines
---
  drivers/pci/controller/dwc/pcie-designware-host.c | 1 +
  1 file changed, 1 insertion(+)
drivers/pci/controller/dwc/pcie-designware-host.c +1 -0
index ecc33f6789e3..5b949547f917 100644
@@ -249,6 +249,7 @@ int dw_pcie_allocate_domains(struct dw_pcie_rp *pp)
 
  	return 0;
  }
+EXPORT_SYMBOL_GPL(dw_pcie_allocate_domains);
 
  static void dw_pcie_free_msi(struct dw_pcie_rp *pp)
  {
Signature · 1 line
2.49.0.1151.ga128411c76-goog
#5 lore raw
In reply to Samiksha Garg
Quoted 4 lines · Samiksha Garg

Hi Mani,
Thanks for your response. I can see that pci-keystone driver already calls this function. Does it not mean that there is already an upstream user?

Hello,

pci-keystone is build-in.

Best regards,
Hans

#6 lore raw

Hi,
Yes I understand that pci-keystone is currently built in, which is why it can use dw_pcie_allocate_domains without the need for symbol export.

My intent with the patch was to make this API accessible to other out-of-tree drivers that rely on the Designware core and might have similar want as pci-keystone.

Since dw_pcie_allocate_domains is already non-static, exporting it could enable consistent reuse without requiring duplication or workarounds.

Thanks,
Samiksha

Quoted 15 lines · Hans Zhang
Quoted 4 lines · Samiksha Garg

Hi Mani,
Thanks for your response. I can see that pci-keystone driver already calls this function. Does it not mean that there is already an upstream user?

Hello,

pci-keystone is build-in.

Best regards,
Hans

#7 lore raw
Quoted 9 lines · Samiksha Garg

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

EXTERNAL EMAIL

Hi,
Yes I understand that pci-keystone is currently built in, which is why it can use dw_pcie_allocate_domains without the need for symbol export.

Quoted 8 lines

My intent with the patch was to make this API accessible to other out-of-tree drivers that rely on the Designware core and might have similar want as pci-keystone.

Since dw_pcie_allocate_domains is already non-static, exporting it could enable consistent reuse without requiring duplication or workarounds.

Hello,

Just as Mani said, you need to upstream your Root Port driver. Otherwise, too many APIs need to be exported.

I have also encountered this kind of problem of yours. Actually, I think the dwc driver should be compiled as a module so that many SOC manufacturers can modify it by themselves. Otherwise, for example, Android GKI cannot meet the requirements. My previous approach was to copy the entire dwc driver and rename all the functions. Finally, it is loaded in the form of ko.

Best regards,
Hans

Quoted 20 lines

Thanks,
Samiksha

Quoted 15 lines · Hans Zhang
Quoted 4 lines · Samiksha Garg

Hi Mani,
Thanks for your response. I can see that pci-keystone driver already calls this function. Does it not mean that there is already an upstream user?

Hello,

pci-keystone is build-in.

Best regards,
Hans

#8 lore raw
Quoted 5 lines · Hans Zhang

I have also encountered this kind of problem of yours. Actually, I think the dwc driver should be compiled as a module so that many SOC manufacturers can modify it by themselves. Otherwise, for example, Android GKI cannot meet the requirements. My previous approach was to copy the entire dwc driver and rename all the functions. Finally, it is loaded in the form of ko.

Adnroid folks just need to upstream their bloody drivers instead of all this crap. And if they don't it is none of our business.