diff options
author | Christoph Hellwig <hch@lst.de> | 2018-09-25 16:16:55 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-09-25 18:12:26 -0400 |
commit | 1a0afc14b5da329765d6ecd4a79f546b9363ad8c (patch) | |
tree | 760667df33be493811fe60f7e1eb1b6190ed962a | |
parent | 9406a49fd1f4379409ed87b29fdaa259b0441912 (diff) |
Revert "dma-mapping: clear dev->dma_ops in arch_teardown_dma_ops"
This reverts commit 46053c73685411915d3de50c5a0045beef32806b.
This change breaks architectures setting up dma_ops in their own magic
way and not using arch_setup_dma_ops, so revert it.
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r-- | arch/arm64/include/asm/dma-mapping.h | 5 | ||||
-rw-r--r-- | arch/arm64/mm/dma-mapping.c | 5 | ||||
-rw-r--r-- | include/linux/dma-mapping.h | 5 |
3 files changed, 11 insertions, 4 deletions
diff --git a/arch/arm64/include/asm/dma-mapping.h b/arch/arm64/include/asm/dma-mapping.h index 0a2d13332545..b7847eb8a7bb 100644 --- a/arch/arm64/include/asm/dma-mapping.h +++ b/arch/arm64/include/asm/dma-mapping.h | |||
@@ -39,6 +39,11 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, | |||
39 | const struct iommu_ops *iommu, bool coherent); | 39 | const struct iommu_ops *iommu, bool coherent); |
40 | #define arch_setup_dma_ops arch_setup_dma_ops | 40 | #define arch_setup_dma_ops arch_setup_dma_ops |
41 | 41 | ||
42 | #ifdef CONFIG_IOMMU_DMA | ||
43 | void arch_teardown_dma_ops(struct device *dev); | ||
44 | #define arch_teardown_dma_ops arch_teardown_dma_ops | ||
45 | #endif | ||
46 | |||
42 | /* do not use this function in a driver */ | 47 | /* do not use this function in a driver */ |
43 | static inline bool is_device_dma_coherent(struct device *dev) | 48 | static inline bool is_device_dma_coherent(struct device *dev) |
44 | { | 49 | { |
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index cdcb73db9ea2..072c51fb07d7 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c | |||
@@ -862,6 +862,11 @@ out_err: | |||
862 | dev_name(dev)); | 862 | dev_name(dev)); |
863 | } | 863 | } |
864 | 864 | ||
865 | void arch_teardown_dma_ops(struct device *dev) | ||
866 | { | ||
867 | dev->dma_ops = NULL; | ||
868 | } | ||
869 | |||
865 | #else | 870 | #else |
866 | 871 | ||
867 | static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, | 872 | static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, |
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index bd81e74cca7b..d23fc45c8208 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -665,10 +665,7 @@ static inline void arch_setup_dma_ops(struct device *dev, u64 dma_base, | |||
665 | #endif | 665 | #endif |
666 | 666 | ||
667 | #ifndef arch_teardown_dma_ops | 667 | #ifndef arch_teardown_dma_ops |
668 | static inline void arch_teardown_dma_ops(struct device *dev) | 668 | static inline void arch_teardown_dma_ops(struct device *dev) { } |
669 | { | ||
670 | dev->dma_ops = NULL; | ||
671 | } | ||
672 | #endif | 669 | #endif |
673 | 670 | ||
674 | static inline unsigned int dma_get_max_seg_size(struct device *dev) | 671 | static inline unsigned int dma_get_max_seg_size(struct device *dev) |