PCI: call dma_debug_add_bus for pci_bus_type in common code
PATCH 1/1 PCI: call dma_debug_add_bus for pci_bus_type in common code
There is nothing arch specific about PCI or dma-debug, so move this call to common code just after registering the bus type.
--- arch/powerpc/kernel/dma.c | 3 --- arch/sh/drivers/pci/pci.c | 2 -- arch/x86/kernel/pci-dma.c | 3 --- drivers/pci/pci-driver.c | 2 +- 4 files changed, 1 insertion(+), 9 deletions(-)
arch/powerpc/kernel/dma.c +0 -3
@@ -357,9 +357,6 @@ EXPORT_SYMBOL_GPL(dma_get_required_mask);static int __init dma_init (void ) { -#ifdef CONFIG_PCI -dma_debug_add_bus (&pci_bus_type); -#endif #ifdef CONFIG_IBMVIO dma_debug_add_bus (&vio_bus_type);#endif
arch/sh/drivers/pci/pci.c +0 -2
@@ -160,8 +160,6 @@ static int __init pcibios_init(void)for (hose = hose_head; hose; hose = hose->next)pcibios_scanbus (hose); -dma_debug_add_bus (&pci_bus_type); - pci_initialized =1 ;return 0 ;
arch/x86/kernel/pci-dma.c +0 -3
@@ -155,9 +155,6 @@ static int __init pci_iommu_init(void) {struct iommu_table_entry *p; -#ifdef CONFIG_PCI -dma_debug_add_bus (&pci_bus_type); -#endif x86_init.iommu.iommu_init ();for (p = __iommu_table; p < __iommu_table_end; p++) {
drivers/pci/pci-driver.c +1 -1
@@ -1668,7 +1668,7 @@ static int __init pci_driver_init(void)if (ret)return ret;#endif - +dma_debug_add_bus (&pci_bus_type);return 0 ; }postcore_initcall (pci_driver_init);
Signature · 1 line
2.18.0
Quoted 4 lines · Christoph Hellwig
There is nothing arch specific about PCI or dma-debug, so move this call to common code just after registering the bus type.
Signed-off-by Christoph Hellwig <[email protected]>
[+cc Joerg]
Quoted 2 lines · Christoph Hellwig
There is nothing arch specific about PCI or dma-debug, so move this call to common code just after registering the bus type.
I assume that previously, even if the user set CONFIG_DMA_API_DEBUG=y we only got PCI DMA debug on powerpc, sh, and x86. And after this patch, we'll get PCI DMA debug on *all* arches?
If that's true, I'll add a comment to that effect to the commitlog since that new functionality might be of interest to other arches.
Quoted 65 lines
Signed-off-by Christoph Hellwig <[email protected]>--- arch/powerpc/kernel/dma.c | 3 --- arch/sh/drivers/pci/pci.c | 2 -- arch/x86/kernel/pci-dma.c | 3 --- drivers/pci/pci-driver.c | 2 +- 4 files changed, 1 insertion(+), 9 deletions(-)arch/powerpc/kernel/dma.c +0
-3@@ -357,9 +357,6 @@ EXPORT_SYMBOL_GPL(dma_get_required_mask);static int __init dma_init (void ) { -#ifdef CONFIG_PCI -dma_debug_add_bus (&pci_bus_type); -#endif #ifdef CONFIG_IBMVIO dma_debug_add_bus (&vio_bus_type);#endif arch/sh/drivers/pci/pci.c +0
-2@@ -160,8 +160,6 @@ static int __init pcibios_init(void)for (hose = hose_head; hose; hose = hose->next)pcibios_scanbus (hose); -dma_debug_add_bus (&pci_bus_type); - pci_initialized =1 ;return 0 ;arch/x86/kernel/pci-dma.c +0
-3@@ -155,9 +155,6 @@ static int __init pci_iommu_init(void) {struct iommu_table_entry *p; -#ifdef CONFIG_PCI -dma_debug_add_bus (&pci_bus_type); -#endif x86_init.iommu.iommu_init ();for (p = __iommu_table; p < __iommu_table_end; p++) {drivers/pci/pci-driver.c +1
-1@@ -1668,7 +1668,7 @@ static int __init pci_driver_init(void)if (ret)return ret;#endif - +dma_debug_add_bus (&pci_bus_type);return 0 ; }postcore_initcall (pci_driver_init);Signature · 1 line
2.18.0
Quoted 6 lines · Bjorn Helgaas
[+cc Joerg]
Quoted 2 lines · Christoph Hellwig
There is nothing arch specific about PCI or dma-debug, so move this call to common code just after registering the bus type.
Quoted 6 lines
I assume that previously, even if the user set
CONFIG_DMA_API_DEBUG=ywe only got PCI DMA debug on powerpc, sh, and x86. And after this patch, we'll get PCI DMA debug on *all* arches?If that's true, I'll add a comment to that effect to the commitlog since that new functionality might be of interest to other arches.
There should be implicit support for dma-debug for all arches that use the generic dma_ops code. The dma_debug_add_bus() function just adds the reporting of pending dma-allocations on driver-unload for a device.
Regards,
Joerg
Quoted 9 lines · Bjorn Helgaas
[+cc Joerg]
Quoted 2 lines · Christoph Hellwig
There is nothing arch specific about PCI or dma-debug, so move this call to common code just after registering the bus type.
I assume that previously, even if the user set
CONFIG_DMA_API_DEBUG=ywe only got PCI DMA debug on powerpc, sh, and x86. And after this patch, we'll get PCI DMA debug on *all* arches?
Yes. Note that this only covers the actual bus related part, that is warning about outstanding dma mappings on unload. The rest of the dma api debugging already is entirely generic.
Quoted 16 lines · Christoph Hellwig
There is nothing arch specific about PCI or dma-debug, so move this call to common code just after registering the bus type.
Signed-off-by Christoph Hellwig <[email protected]>--- arch/powerpc/kernel/dma.c | 3 --- arch/sh/drivers/pci/pci.c | 2 -- arch/x86/kernel/pci-dma.c | 3 --- drivers/pci/pci-driver.c | 2 +- 4 files changed, 1 insertion(+), 9 deletions(-)arch/powerpc/kernel/dma.c +0
-0
arch/powerpc/kernel/dma.c EXPORT_SYMBOL_GPL(dma_get_required_mask); · line 362
Quoted 9 lines
arch/powerpc/kernel/dma.c +0
-3@@ -357,9 +357,6 @@ EXPORT_SYMBOL_GPL(dma_get_required_mask);static int __init dma_init (void ) { -#ifdef CONFIG_PCI -dma_debug_add_bus (&pci_bus_type); -#endif #ifdef CONFIG_IBMVIO dma_debug_add_bus (&vio_bus_type);#endif
cheers
Quoted 4 lines · Christoph Hellwig
There is nothing arch specific about PCI or dma-debug, so move this call to common code just after registering the bus type.
Signed-off-by Christoph Hellwig <[email protected]>
Applied with acks from Thomas and Michael to pci/misc for v4.19, thanks!
Quoted 64 lines
--- arch/powerpc/kernel/dma.c | 3 --- arch/sh/drivers/pci/pci.c | 2 -- arch/x86/kernel/pci-dma.c | 3 --- drivers/pci/pci-driver.c | 2 +- 4 files changed, 1 insertion(+), 9 deletions(-)arch/powerpc/kernel/dma.c +0
-3@@ -357,9 +357,6 @@ EXPORT_SYMBOL_GPL(dma_get_required_mask);static int __init dma_init (void ) { -#ifdef CONFIG_PCI -dma_debug_add_bus (&pci_bus_type); -#endif #ifdef CONFIG_IBMVIO dma_debug_add_bus (&vio_bus_type);#endif arch/sh/drivers/pci/pci.c +0
-2@@ -160,8 +160,6 @@ static int __init pcibios_init(void)for (hose = hose_head; hose; hose = hose->next)pcibios_scanbus (hose); -dma_debug_add_bus (&pci_bus_type); - pci_initialized =1 ;return 0 ;arch/x86/kernel/pci-dma.c +0
-3@@ -155,9 +155,6 @@ static int __init pci_iommu_init(void) {struct iommu_table_entry *p; -#ifdef CONFIG_PCI -dma_debug_add_bus (&pci_bus_type); -#endif x86_init.iommu.iommu_init ();for (p = __iommu_table; p < __iommu_table_end; p++) {drivers/pci/pci-driver.c +1
-1@@ -1668,7 +1668,7 @@ static int __init pci_driver_init(void)if (ret)return ret;#endif - +dma_debug_add_bus (&pci_bus_type);return 0 ; }postcore_initcall (pci_driver_init);Signature · 1 line
2.18.0