Commit 3405c257 authored by Daniel Axtens's avatar Daniel Axtens Committed by Michael Ellerman

powerpc/pci: add dma_set_mask to pci_controller_ops

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: default avatarDaniel Axtens <dja@axtens.net>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 92ae0353
...@@ -36,6 +36,8 @@ struct pci_controller_ops { ...@@ -36,6 +36,8 @@ struct pci_controller_ops {
int nvec, int type); int nvec, int type);
void (*teardown_msi_irqs)(struct pci_dev *dev); void (*teardown_msi_irqs)(struct pci_dev *dev);
#endif #endif
int (*dma_set_mask)(struct pci_dev *dev, u64 dma_mask);
}; };
/* /*
......
...@@ -248,6 +248,14 @@ int dma_set_mask(struct device *dev, u64 dma_mask) ...@@ -248,6 +248,14 @@ int dma_set_mask(struct device *dev, u64 dma_mask)
{ {
if (ppc_md.dma_set_mask) if (ppc_md.dma_set_mask)
return ppc_md.dma_set_mask(dev, dma_mask); return ppc_md.dma_set_mask(dev, dma_mask);
if (dev_is_pci(dev)) {
struct pci_dev *pdev = to_pci_dev(dev);
struct pci_controller *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); return __dma_set_mask(dev, dma_mask);
} }
EXPORT_SYMBOL(dma_set_mask); EXPORT_SYMBOL(dma_set_mask);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment