Skip to content

Commit ffe3dfd

Browse files
Christoph Hellwigmpe
authored andcommitted
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. Signed-off-by: Christoph Hellwig <hch@lst.de> Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 2d6ad41 commit ffe3dfd

6 files changed

Lines changed: 0 additions & 38 deletions

File tree

‎arch/powerpc/include/asm/device.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,4 @@ struct pdev_archdata {
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‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,5 @@ static inline void set_dma_offset(struct device *dev, dma_addr_t off)
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‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ struct machdep_calls {
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‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ struct pci_controller_ops {
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‎

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -318,35 +318,6 @@ int dma_set_mask(struct device *dev, u64 dma_mask)
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‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ int dma_mmap_attrs(struct device *dev, struct vm_area_struct *vma,
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)
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)

0 commit comments

Comments
 (0)