diff options
-rw-r--r-- | arch/x86/kernel/pci-nommu.c | 27 | ||||
-rw-r--r-- | include/asm-generic/dma-mapping-common.h | 6 |
2 files changed, 22 insertions, 11 deletions
diff --git a/arch/x86/kernel/pci-nommu.c b/arch/x86/kernel/pci-nommu.c index c0a4222bf62b..a3933d4330cd 100644 --- a/arch/x86/kernel/pci-nommu.c +++ b/arch/x86/kernel/pci-nommu.c | |||
@@ -79,12 +79,29 @@ static void nommu_free_coherent(struct device *dev, size_t size, void *vaddr, | |||
79 | free_pages((unsigned long)vaddr, get_order(size)); | 79 | free_pages((unsigned long)vaddr, get_order(size)); |
80 | } | 80 | } |
81 | 81 | ||
82 | static void nommu_sync_single_for_device(struct device *dev, | ||
83 | dma_addr_t addr, size_t size, | ||
84 | enum dma_data_direction dir) | ||
85 | { | ||
86 | flush_write_buffers(); | ||
87 | } | ||
88 | |||
89 | |||
90 | static void nommu_sync_sg_for_device(struct device *dev, | ||
91 | struct scatterlist *sg, int nelems, | ||
92 | enum dma_data_direction dir) | ||
93 | { | ||
94 | flush_write_buffers(); | ||
95 | } | ||
96 | |||
82 | struct dma_map_ops nommu_dma_ops = { | 97 | struct dma_map_ops nommu_dma_ops = { |
83 | .alloc_coherent = dma_generic_alloc_coherent, | 98 | .alloc_coherent = dma_generic_alloc_coherent, |
84 | .free_coherent = nommu_free_coherent, | 99 | .free_coherent = nommu_free_coherent, |
85 | .map_sg = nommu_map_sg, | 100 | .map_sg = nommu_map_sg, |
86 | .map_page = nommu_map_page, | 101 | .map_page = nommu_map_page, |
87 | .is_phys = 1, | 102 | .sync_single_for_device = nommu_sync_single_for_device, |
103 | .sync_sg_for_device = nommu_sync_sg_for_device, | ||
104 | .is_phys = 1, | ||
88 | }; | 105 | }; |
89 | 106 | ||
90 | void __init no_iommu_init(void) | 107 | void __init no_iommu_init(void) |
diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h index 5406a601185c..e694263445f7 100644 --- a/include/asm-generic/dma-mapping-common.h +++ b/include/asm-generic/dma-mapping-common.h | |||
@@ -103,7 +103,6 @@ static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t addr, | |||
103 | if (ops->sync_single_for_cpu) | 103 | if (ops->sync_single_for_cpu) |
104 | ops->sync_single_for_cpu(dev, addr, size, dir); | 104 | ops->sync_single_for_cpu(dev, addr, size, dir); |
105 | debug_dma_sync_single_for_cpu(dev, addr, size, dir); | 105 | debug_dma_sync_single_for_cpu(dev, addr, size, dir); |
106 | flush_write_buffers(); | ||
107 | } | 106 | } |
108 | 107 | ||
109 | static inline void dma_sync_single_for_device(struct device *dev, | 108 | static inline void dma_sync_single_for_device(struct device *dev, |
@@ -116,7 +115,6 @@ static inline void dma_sync_single_for_device(struct device *dev, | |||
116 | if (ops->sync_single_for_device) | 115 | if (ops->sync_single_for_device) |
117 | ops->sync_single_for_device(dev, addr, size, dir); | 116 | ops->sync_single_for_device(dev, addr, size, dir); |
118 | debug_dma_sync_single_for_device(dev, addr, size, dir); | 117 | debug_dma_sync_single_for_device(dev, addr, size, dir); |
119 | flush_write_buffers(); | ||
120 | } | 118 | } |
121 | 119 | ||
122 | static inline void dma_sync_single_range_for_cpu(struct device *dev, | 120 | static inline void dma_sync_single_range_for_cpu(struct device *dev, |
@@ -132,7 +130,6 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev, | |||
132 | ops->sync_single_range_for_cpu(dev, addr, offset, size, dir); | 130 | ops->sync_single_range_for_cpu(dev, addr, offset, size, dir); |
133 | debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir); | 131 | debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir); |
134 | 132 | ||
135 | flush_write_buffers(); | ||
136 | } else | 133 | } else |
137 | dma_sync_single_for_cpu(dev, addr, size, dir); | 134 | dma_sync_single_for_cpu(dev, addr, size, dir); |
138 | } | 135 | } |
@@ -150,7 +147,6 @@ static inline void dma_sync_single_range_for_device(struct device *dev, | |||
150 | ops->sync_single_range_for_device(dev, addr, offset, size, dir); | 147 | ops->sync_single_range_for_device(dev, addr, offset, size, dir); |
151 | debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir); | 148 | debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir); |
152 | 149 | ||
153 | flush_write_buffers(); | ||
154 | } else | 150 | } else |
155 | dma_sync_single_for_device(dev, addr, size, dir); | 151 | dma_sync_single_for_device(dev, addr, size, dir); |
156 | } | 152 | } |
@@ -165,7 +161,6 @@ dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, | |||
165 | if (ops->sync_sg_for_cpu) | 161 | if (ops->sync_sg_for_cpu) |
166 | ops->sync_sg_for_cpu(dev, sg, nelems, dir); | 162 | ops->sync_sg_for_cpu(dev, sg, nelems, dir); |
167 | debug_dma_sync_sg_for_cpu(dev, sg, nelems, dir); | 163 | debug_dma_sync_sg_for_cpu(dev, sg, nelems, dir); |
168 | flush_write_buffers(); | ||
169 | } | 164 | } |
170 | 165 | ||
171 | static inline void | 166 | static inline void |
@@ -179,7 +174,6 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, | |||
179 | ops->sync_sg_for_device(dev, sg, nelems, dir); | 174 | ops->sync_sg_for_device(dev, sg, nelems, dir); |
180 | debug_dma_sync_sg_for_device(dev, sg, nelems, dir); | 175 | debug_dma_sync_sg_for_device(dev, sg, nelems, dir); |
181 | 176 | ||
182 | flush_write_buffers(); | ||
183 | } | 177 | } |
184 | 178 | ||
185 | #define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a, s, r, NULL) | 179 | #define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a, s, r, NULL) |