Skip to content

Commit a865119

Browse files
Christoph Hellwigbjorn-helgaas
authored andcommitted
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)
1 parent d6488ac commit a865119

4 files changed

Lines changed: 1 addition & 9 deletions

File tree

‎arch/powerpc/kernel/dma.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,6 @@ EXPORT_SYMBOL_GPL(dma_get_required_mask);
357357

358358
static int __init dma_init(void)
359359
{
360-
#ifdef CONFIG_PCI
361-
dma_debug_add_bus(&pci_bus_type);
362-
#endif
363360
#ifdef CONFIG_IBMVIO
364361
dma_debug_add_bus(&vio_bus_type);
365362
#endif

‎arch/sh/drivers/pci/pci.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,6 @@ static int __init pcibios_init(void)
160160
for (hose = hose_head; hose; hose = hose->next)
161161
pcibios_scanbus(hose);
162162

163-
dma_debug_add_bus(&pci_bus_type);
164-
165163
pci_initialized = 1;
166164

167165
return 0;

‎arch/x86/kernel/pci-dma.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,6 @@ static int __init pci_iommu_init(void)
155155
{
156156
struct iommu_table_entry *p;
157157

158-
#ifdef CONFIG_PCI
159-
dma_debug_add_bus(&pci_bus_type);
160-
#endif
161158
x86_init.iommu.iommu_init();
162159

163160
for (p = __iommu_table; p < __iommu_table_end; p++) {

‎drivers/pci/pci-driver.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1667,7 +1667,7 @@ static int __init pci_driver_init(void)
16671667
if (ret)
16681668
return ret;
16691669
#endif
1670-
1670+
dma_debug_add_bus(&pci_bus_type);
16711671
return 0;
16721672
}
16731673
postcore_initcall(pci_driver_init);

0 commit comments

Comments
 (0)