]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
powerpc: Call dma_debug_add_bus for PCI and VIO buses
authorAnton Blanchard <anton@samba.org>
Sun, 24 Jun 2012 18:25:28 +0000 (18:25 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 10 Jul 2012 09:18:57 +0000 (19:18 +1000)
The DMA API debug code has hooks to verify all DMA entries have been
freed at time of hot unplug. We need to call dma_debug_add_bus for
this to work.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/vio.h
arch/powerpc/kernel/dma.c
arch/powerpc/kernel/vio.c

index b19adf751dd954c492b7afc062a76df896ef6b61..df81cb72d1e08a805a94fe267b9dcc712a199459 100644 (file)
@@ -44,6 +44,8 @@
  */
 #define VIO_CMO_MIN_ENT 1562624
 
+extern struct bus_type vio_bus_type;
+
 struct iommu_table;
 
 /*
index b1ec983dcec8954ada2bf1cd9937c9d52706b333..289be751cd756b71220d90fb7d3820824976bd83 100644 (file)
@@ -11,6 +11,8 @@
 #include <linux/gfp.h>
 #include <linux/memblock.h>
 #include <linux/export.h>
+#include <linux/pci.h>
+#include <asm/vio.h>
 #include <asm/bug.h>
 #include <asm/abs_addr.h>
 #include <asm/machdep.h>
@@ -205,7 +207,13 @@ EXPORT_SYMBOL_GPL(dma_get_required_mask);
 
 static int __init dma_init(void)
 {
-       dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES);
+       dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES);
+#ifdef CONFIG_PCI
+       dma_debug_add_bus(&pci_bus_type);
+#endif
+#ifdef CONFIG_IBMVIO
+       dma_debug_add_bus(&vio_bus_type);
+#endif
 
        return 0;
 }
index 3bb5be5da31c0ec743537cd07d4fd97761d9f616..7a421e8fe7cad2159547c32e4b3a3530540ff93c 100644 (file)
@@ -37,8 +37,6 @@
 #include <asm/page.h>
 #include <asm/hvcall.h>
 
-static struct bus_type vio_bus_type;
-
 static struct vio_dev vio_bus_device  = { /* fake "parent" device */
        .name = "vio",
        .type = "",
@@ -1580,7 +1578,7 @@ static int vio_hotplug(struct device *dev, struct kobj_uevent_env *env)
        return 0;
 }
 
-static struct bus_type vio_bus_type = {
+struct bus_type vio_bus_type = {
        .name = "vio",
        .dev_attrs = vio_dev_attrs,
        .uevent = vio_hotplug,