diff options
Diffstat (limited to 'lib/dma-debug.c')
| -rw-r--r-- | lib/dma-debug.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/dma-debug.c b/lib/dma-debug.c index d9b08e0f7f55..ba8b67039d13 100644 --- a/lib/dma-debug.c +++ b/lib/dma-debug.c | |||
| @@ -587,7 +587,7 @@ out_unlock: | |||
| 587 | return count; | 587 | return count; |
| 588 | } | 588 | } |
| 589 | 589 | ||
| 590 | const struct file_operations filter_fops = { | 590 | static const struct file_operations filter_fops = { |
| 591 | .read = filter_read, | 591 | .read = filter_read, |
| 592 | .write = filter_write, | 592 | .write = filter_write, |
| 593 | }; | 593 | }; |
| @@ -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"); |
| @@ -909,6 +913,9 @@ static void check_sync(struct device *dev, | |||
| 909 | ref->size); | 913 | ref->size); |
| 910 | } | 914 | } |
| 911 | 915 | ||
| 916 | if (entry->direction == DMA_BIDIRECTIONAL) | ||
| 917 | goto out; | ||
| 918 | |||
| 912 | if (ref->direction != entry->direction) { | 919 | if (ref->direction != entry->direction) { |
| 913 | err_printk(dev, entry, "DMA-API: device driver syncs " | 920 | err_printk(dev, entry, "DMA-API: device driver syncs " |
| 914 | "DMA memory with different direction " | 921 | "DMA memory with different direction " |
| @@ -919,9 +926,6 @@ static void check_sync(struct device *dev, | |||
| 919 | dir2name[ref->direction]); | 926 | dir2name[ref->direction]); |
| 920 | } | 927 | } |
| 921 | 928 | ||
| 922 | if (entry->direction == DMA_BIDIRECTIONAL) | ||
| 923 | goto out; | ||
| 924 | |||
| 925 | if (to_cpu && !(entry->direction == DMA_FROM_DEVICE) && | 929 | if (to_cpu && !(entry->direction == DMA_FROM_DEVICE) && |
| 926 | !(ref->direction == DMA_TO_DEVICE)) | 930 | !(ref->direction == DMA_TO_DEVICE)) |
| 927 | err_printk(dev, entry, "DMA-API: device driver syncs " | 931 | err_printk(dev, entry, "DMA-API: device driver syncs " |
| @@ -944,7 +948,6 @@ static void check_sync(struct device *dev, | |||
| 944 | 948 | ||
| 945 | out: | 949 | out: |
| 946 | put_hash_bucket(bucket, &flags); | 950 | put_hash_bucket(bucket, &flags); |
| 947 | |||
| 948 | } | 951 | } |
| 949 | 952 | ||
| 950 | void debug_dma_map_page(struct device *dev, struct page *page, size_t offset, | 953 | void debug_dma_map_page(struct device *dev, struct page *page, size_t offset, |
