diff options
author | Christoph Hellwig <hch@lst.de> | 2018-07-30 03:38:42 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2018-07-30 16:58:01 -0400 |
commit | a8651194f9f61406cb8926feeeb7829258295b2a (patch) | |
tree | f428ce34e6a3bdcafbc3afa5d351f04a7f7e1269 | |
parent | d6488ac19aabcc6c85a74b69eaf1b7301124c323 (diff) |
PCI: Call dma_debug_add_bus() for pci_bus_type from PCI core
There is nothing arch-specific about PCI or dma-debug, so call
dma_debug_add_bus() from the PCI core just after registering the bus type.
Most of dma-debug is already generic; this just adds reporting of pending
dma-allocations on driver unload for arches other than powerpc, sh, and
x86.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
-rw-r--r-- | arch/powerpc/kernel/dma.c | 3 | ||||
-rw-r--r-- | arch/sh/drivers/pci/pci.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/pci-dma.c | 3 | ||||
-rw-r--r-- | drivers/pci/pci-driver.c | 2 |
4 files changed, 1 insertions, 9 deletions
diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c index 155170d70324..dbfc7056d7df 100644 --- a/arch/powerpc/kernel/dma.c +++ b/arch/powerpc/kernel/dma.c | |||
@@ -357,9 +357,6 @@ EXPORT_SYMBOL_GPL(dma_get_required_mask); | |||
357 | 357 | ||
358 | static int __init dma_init(void) | 358 | static int __init dma_init(void) |
359 | { | 359 | { |
360 | #ifdef CONFIG_PCI | ||
361 | dma_debug_add_bus(&pci_bus_type); | ||
362 | #endif | ||
363 | #ifdef CONFIG_IBMVIO | 360 | #ifdef CONFIG_IBMVIO |
364 | dma_debug_add_bus(&vio_bus_type); | 361 | dma_debug_add_bus(&vio_bus_type); |
365 | #endif | 362 | #endif |
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index e5b7437ab4af..8256626bc53c 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c | |||
@@ -160,8 +160,6 @@ static int __init pcibios_init(void) | |||
160 | for (hose = hose_head; hose; hose = hose->next) | 160 | for (hose = hose_head; hose; hose = hose->next) |
161 | pcibios_scanbus(hose); | 161 | pcibios_scanbus(hose); |
162 | 162 | ||
163 | dma_debug_add_bus(&pci_bus_type); | ||
164 | |||
165 | pci_initialized = 1; | 163 | pci_initialized = 1; |
166 | 164 | ||
167 | return 0; | 165 | return 0; |
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index ab5d9dd668d2..43f58632f123 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c | |||
@@ -155,9 +155,6 @@ static int __init pci_iommu_init(void) | |||
155 | { | 155 | { |
156 | struct iommu_table_entry *p; | 156 | struct iommu_table_entry *p; |
157 | 157 | ||
158 | #ifdef CONFIG_PCI | ||
159 | dma_debug_add_bus(&pci_bus_type); | ||
160 | #endif | ||
161 | x86_init.iommu.iommu_init(); | 158 | x86_init.iommu.iommu_init(); |
162 | 159 | ||
163 | for (p = __iommu_table; p < __iommu_table_end; p++) { | 160 | for (p = __iommu_table; p < __iommu_table_end; p++) { |
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index c125d53033c6..7a02f94fd231 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -1667,7 +1667,7 @@ static int __init pci_driver_init(void) | |||
1667 | if (ret) | 1667 | if (ret) |
1668 | return ret; | 1668 | return ret; |
1669 | #endif | 1669 | #endif |
1670 | 1670 | dma_debug_add_bus(&pci_bus_type); | |
1671 | return 0; | 1671 | return 0; |
1672 | } | 1672 | } |
1673 | postcore_initcall(pci_driver_init); | 1673 | postcore_initcall(pci_driver_init); |