diff mbox series

PCI: dwc: Fix inner MSI IRQ domain registration

Message ID 20200501113921.366597-1-maz@kernel.org
State New
Headers show
Series PCI: dwc: Fix inner MSI IRQ domain registration | expand

Commit Message

Marc Zyngier May 1, 2020, 11:39 a.m. UTC
On a system that uses the internal DWC MSI widget, I get this
warning from debugfs when CONFIG_GENERIC_IRQ_DEBUGFS is selected:

  debugfs: File ':soc:pcie@fc000000' in directory 'domains' already present!

This is due to the fact that the DWC MSI code tries to register two
IRQ domains for the same firmware node, without telling the low
level code how to distinguish them (by setting a bus token). This
further confuses debugfs which tries to create corresponding
files for each domain.

Fix it by tagging the inner domain as DOMAIN_BUS_NEXUS, which is
the closest thing we have as to "generic MSI".

Signed-off-by: Marc Zyngier <maz@kernel.org>
---
 drivers/pci/controller/dwc/pcie-designware-host.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Han Jingoo May 1, 2020, 3:25 p.m. UTC | #1
On 5/1/20, 7:39 AM, Marc Zyngier wrote:
> On a system that uses the internal DWC MSI widget, I get this
> warning from debugfs when CONFIG_GENERIC_IRQ_DEBUGFS is selected:
>
>   debugfs: File ':soc:pcie@fc000000' in directory 'domains' already present!
>
> This is due to the fact that the DWC MSI code tries to register two
> IRQ domains for the same firmware node, without telling the low
> level code how to distinguish them (by setting a bus token). This
> further confuses debugfs which tries to create corresponding
> files for each domain.
>
> Fix it by tagging the inner domain as DOMAIN_BUS_NEXUS, which is
> the closest thing we have as to "generic MSI".
>
> Signed-off-by: Marc Zyngier <maz@kernel.org>

Acked-by: Jingoo Han <jingoohan1@gmail.com>


> ---
>  drivers/pci/controller/dwc/pcie-designware-host.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
> index 395feb8ca051..3c43311bb95c 100644
> --- a/drivers/pci/controller/dwc/pcie-designware-host.c
> +++ b/drivers/pci/controller/dwc/pcie-designware-host.c
> @@ -264,6 +264,8 @@ int dw_pcie_allocate_domains(struct pcie_port *pp)
>  		return -ENOMEM;
>  	}
>  
> +	irq_domain_update_bus_token(pp->irq_domain, DOMAIN_BUS_NEXUS);
> +
>  	pp->msi_domain = pci_msi_create_irq_domain(fwnode,
>  						   &dw_pcie_msi_domain_info,
>  						   pp->irq_domain);
> -- 
> 2.26.2
Lorenzo Pieralisi May 5, 2020, 11:53 a.m. UTC | #2
On Fri, May 01, 2020 at 12:39:21PM +0100, Marc Zyngier wrote:
> On a system that uses the internal DWC MSI widget, I get this
> warning from debugfs when CONFIG_GENERIC_IRQ_DEBUGFS is selected:
> 
>   debugfs: File ':soc:pcie@fc000000' in directory 'domains' already present!
> 
> This is due to the fact that the DWC MSI code tries to register two
> IRQ domains for the same firmware node, without telling the low
> level code how to distinguish them (by setting a bus token). This
> further confuses debugfs which tries to create corresponding
> files for each domain.
> 
> Fix it by tagging the inner domain as DOMAIN_BUS_NEXUS, which is
> the closest thing we have as to "generic MSI".
> 
> Signed-off-by: Marc Zyngier <maz@kernel.org>
> ---
>  drivers/pci/controller/dwc/pcie-designware-host.c | 2 ++
>  1 file changed, 2 insertions(+)

Applied to pci/dwc, thanks !

Lorenzo

> diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
> index 395feb8ca051..3c43311bb95c 100644
> --- a/drivers/pci/controller/dwc/pcie-designware-host.c
> +++ b/drivers/pci/controller/dwc/pcie-designware-host.c
> @@ -264,6 +264,8 @@ int dw_pcie_allocate_domains(struct pcie_port *pp)
>  		return -ENOMEM;
>  	}
>  
> +	irq_domain_update_bus_token(pp->irq_domain, DOMAIN_BUS_NEXUS);
> +
>  	pp->msi_domain = pci_msi_create_irq_domain(fwnode,
>  						   &dw_pcie_msi_domain_info,
>  						   pp->irq_domain);
> -- 
> 2.26.2
>
diff mbox series

Patch

diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
index 395feb8ca051..3c43311bb95c 100644
--- a/drivers/pci/controller/dwc/pcie-designware-host.c
+++ b/drivers/pci/controller/dwc/pcie-designware-host.c
@@ -264,6 +264,8 @@  int dw_pcie_allocate_domains(struct pcie_port *pp)
 		return -ENOMEM;
 	}
 
+	irq_domain_update_bus_token(pp->irq_domain, DOMAIN_BUS_NEXUS);
+
 	pp->msi_domain = pci_msi_create_irq_domain(fwnode,
 						   &dw_pcie_msi_domain_info,
 						   pp->irq_domain);