diff options
Diffstat (limited to 'lib/dma-debug.c')
-rw-r--r-- | lib/dma-debug.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/dma-debug.c b/lib/dma-debug.c index ce6b7eabf674..cf906201aecf 100644 --- a/lib/dma-debug.c +++ b/lib/dma-debug.c | |||
@@ -259,7 +259,7 @@ static struct dma_debug_entry *hash_bucket_find(struct hash_bucket *bucket, | |||
259 | * times. Without a hardware IOMMU this results in the | 259 | * times. Without a hardware IOMMU this results in the |
260 | * same device addresses being put into the dma-debug | 260 | * same device addresses being put into the dma-debug |
261 | * hash multiple times too. This can result in false | 261 | * hash multiple times too. This can result in false |
262 | * positives being reported. Therfore we implement a | 262 | * positives being reported. Therefore we implement a |
263 | * best-fit algorithm here which returns the entry from | 263 | * best-fit algorithm here which returns the entry from |
264 | * the hash which fits best to the reference value | 264 | * the hash which fits best to the reference value |
265 | * instead of the first-fit. | 265 | * instead of the first-fit. |
@@ -670,12 +670,13 @@ static int device_dma_allocations(struct device *dev) | |||
670 | return count; | 670 | return count; |
671 | } | 671 | } |
672 | 672 | ||
673 | static int dma_debug_device_change(struct notifier_block *nb, | 673 | static int dma_debug_device_change(struct notifier_block *nb, unsigned long action, void *data) |
674 | unsigned long action, void *data) | ||
675 | { | 674 | { |
676 | struct device *dev = data; | 675 | struct device *dev = data; |
677 | int count; | 676 | int count; |
678 | 677 | ||
678 | if (global_disable) | ||
679 | return 0; | ||
679 | 680 | ||
680 | switch (action) { | 681 | switch (action) { |
681 | case BUS_NOTIFY_UNBOUND_DRIVER: | 682 | case BUS_NOTIFY_UNBOUND_DRIVER: |
@@ -697,6 +698,9 @@ void dma_debug_add_bus(struct bus_type *bus) | |||
697 | { | 698 | { |
698 | struct notifier_block *nb; | 699 | struct notifier_block *nb; |
699 | 700 | ||
701 | if (global_disable) | ||
702 | return; | ||
703 | |||
700 | nb = kzalloc(sizeof(struct notifier_block), GFP_KERNEL); | 704 | nb = kzalloc(sizeof(struct notifier_block), GFP_KERNEL); |
701 | if (nb == NULL) { | 705 | if (nb == NULL) { |
702 | pr_err("dma_debug_add_bus: out of memory\n"); | 706 | pr_err("dma_debug_add_bus: out of memory\n"); |