@@ -36,6 +36,8 @@ struct pci_controller_ops {
int nvec, int type);
void (*teardown_msi_irqs)(struct pci_dev *dev);
#endif
+
+ int (*dma_set_mask)(struct pci_dev *dev, u64 dma_mask);
};
/*
@@ -246,8 +246,19 @@ int __dma_set_mask(struct device *dev, u64 dma_mask)
int dma_set_mask(struct device *dev, u64 dma_mask)
{
+ struct pci_dev *pdev;
+ struct pci_controller *phb;
+
if (ppc_md.dma_set_mask)
return ppc_md.dma_set_mask(dev, dma_mask);
+
+ if (dev_is_pci(dev)) {
+ pdev = to_pci_dev(dev);
+ phb = pci_bus_to_host(pdev->bus);
+ if (phb->controller_ops.dma_set_mask)
+ return phb->controller_ops.dma_set_mask(pdev, dma_mask);
+ }
+
return __dma_set_mask(dev, dma_mask);
}
EXPORT_SYMBOL(dma_set_mask);
Some systems only need to deal with DMA masks for PCI devices. For these systems, we can avoid the need for a platform hook and instead use a pci controller based hook. Signed-off-by: Daniel Axtens <dja@axtens.net> --- arch/powerpc/include/asm/pci-bridge.h | 2 ++ arch/powerpc/kernel/dma.c | 11 +++++++++++ 2 files changed, 13 insertions(+)