History

powerpc/dma: stop overriding dma_get_required_mask

The ppc_md and pci_controller_ops methods are unused now and can be removed. The dma_nommu implementation is generic to the generic one except for using max_pfn instead of calling into the memblock API, and all other dma_map_ops instances implement a method of their own.

Christoph Hellwig committed 7 years ago

Commit ffe3dfd1 parent 2d6ad416 files · +0 −38Browse files

Unified · Split

6 files
  1. arch/powerpc/include/asm/device.h +0 −2
  2. arch/powerpc/include/asm/dma-mapping.h +0 −2
  3. arch/powerpc/include/asm/machdep.h +0 −2
  4. arch/powerpc/include/asm/pci-bridge.h +0 −1
  5. arch/powerpc/kernel/dma.c +0 −29
  6. kernel/dma/mapping.c +0 −2
arch/powerpc/include/asm/device.h+0−2
@@ -59,6 +59,4 @@ struct pdev_archdata { · 58 unmodified lines
5959 u64 dma_mask;
6060 };
6161
62−#define ARCH_HAS_DMA_GET_REQUIRED_MASK
63−
6462 #endif /* _ASM_POWERPC_DEVICE_H */
arch/powerpc/include/asm/dma-mapping.h+0−2
@@ -112,7 +112,5 @@ static inline void set_dma_offset(struct device *dev, dma_addr_t off) · 111 unmodified lines
112112
113113 #define HAVE_ARCH_DMA_SET_MASK 1
114114
115−extern u64 __dma_get_required_mask(struct device *dev);
116−
117115 #endif /* __KERNEL__ */
118116 #endif /* _ASM_DMA_MAPPING_H */
arch/powerpc/include/asm/machdep.h+0−2
@@ -47,9 +47,7 @@ struct machdep_calls { · 46 unmodified lines
4747 #endif
4848 #endif /* CONFIG_PPC64 */
4949
50− /* Platform set_dma_mask and dma_get_required_mask overrides */
5150 int (*dma_set_mask)(struct device *dev, u64 dma_mask);
52− u64 (*dma_get_required_mask)(struct device *dev);
5351
5452 int (*probe)(void);
5553 void (*setup_arch)(void); /* Optional, may be NULL */
arch/powerpc/include/asm/pci-bridge.h+0−1
@@ -46,7 +46,6 @@ struct pci_controller_ops { · 45 unmodified lines
4646 #endif
4747
4848 int (*dma_set_mask)(struct pci_dev *pdev, u64 dma_mask);
49− u64 (*dma_get_required_mask)(struct pci_dev *pdev);
5049
5150 void (*shutdown)(struct pci_controller *hose);
5251 };
arch/powerpc/kernel/dma.c+0−29
@@ -318,35 +318,6 @@ int dma_set_mask(struct device *dev, u64 dma_mask) · 317 unmodified lines
318318 }
319319 EXPORT_SYMBOL(dma_set_mask);
320320
321−u64 __dma_get_required_mask(struct device *dev)
322−{
323− const struct dma_map_ops *dma_ops = get_dma_ops(dev);
324−
325− if (unlikely(dma_ops == NULL))
326− return 0;
327−
328− if (dma_ops->get_required_mask)
329− return dma_ops->get_required_mask(dev);
330−
331− return DMA_BIT_MASK(8 * sizeof(dma_addr_t));
332−}
333−
334−u64 dma_get_required_mask(struct device *dev)
335−{
336− if (ppc_md.dma_get_required_mask)
337− return ppc_md.dma_get_required_mask(dev);
338−
339− if (dev_is_pci(dev)) {
340− struct pci_dev *pdev = to_pci_dev(dev);
341− struct pci_controller *phb = pci_bus_to_host(pdev->bus);
342− if (phb->controller_ops.dma_get_required_mask)
343− return phb->controller_ops.dma_get_required_mask(pdev);
344− }
345−
346− return __dma_get_required_mask(dev);
347−}
348−EXPORT_SYMBOL_GPL(dma_get_required_mask);
349−
350321 static int __init dma_init(void)
351322 {
352323 #ifdef CONFIG_IBMVIO
kernel/dma/mapping.c+0−2
@@ -207,7 +207,6 @@ int dma_mmap_attrs(struct device *dev, struct vm_area_struct *vma, · 206 unmodified lines
207207 }
208208 EXPORT_SYMBOL(dma_mmap_attrs);
209209
210−#ifndef ARCH_HAS_DMA_GET_REQUIRED_MASK
211210 static u64 dma_default_get_required_mask(struct device *dev)
212211 {
213212 u32 low_totalram = ((max_pfn - 1) << PAGE_SHIFT);
@@ -238,7 +237,6 @@ u64 dma_get_required_mask(struct device *dev) · 24 unmodified lines
238237 return dma_default_get_required_mask(dev);
239238 }
240239 EXPORT_SYMBOL_GPL(dma_get_required_mask);
241−#endif
242240
243241 #ifndef arch_dma_alloc_attrs
244242 #define arch_dma_alloc_attrs(dev) (true)