Commit:     84631f37cc405dd6dcd566f9fa4e8a3ca2f03f76
Parent:     53024fe250a0f044b114844a01456902bce40ade
Author:     Michael Ellerman <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 17 17:35:53 2007 +1100
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Thu Dec 20 16:15:49 2007 +1100

    [POWERPC] Implement pci_set_dma_mask() in terms of the dma_ops
    PowerPC currently doesn't implement pci_set_dma_mask(), which means drivers
    calling it will get the generic version in drivers/pci/pci.c.
    The powerpc dma mapping ops include a dma_set_mask() hook, which luckily is
    not implemented by anyone - so there is no bug in the fact that the hook
    is currently never called.
    However in future we'll add implementation(s) of dma_set_mask(), and so we
    need pci_set_dma_mask() to call the hook.
    To save adding a hook to the dma mapping ops, pci-set_consistent_dma_mask()
    simply calls the dma_set_mask() hook and then copies the new mask into
    Signed-off-by: Michael Ellerman <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
 arch/powerpc/kernel/pci_64.c      |   16 ++++++++++++++++
 include/asm-powerpc/dma-mapping.h |    3 +++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index bf06926..f5c4628 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -69,6 +69,22 @@ struct dma_mapping_ops *get_pci_dma_ops(void)
+int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
+       return dma_set_mask(&dev->dev, mask);
+int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
+       int rc;
+       rc = dma_set_mask(&dev->dev, mask);
+       dev->dev.coherent_dma_mask = dev->dma_mask;
+       return rc;
 static void fixup_broken_pcnet32(struct pci_dev* dev)
        if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
diff --git a/include/asm-powerpc/dma-mapping.h 
index ff52013..e974876 100644
--- a/include/asm-powerpc/dma-mapping.h
+++ b/include/asm-powerpc/dma-mapping.h
@@ -87,6 +87,9 @@ static inline int dma_supported(struct device *dev, u64 mask)
        return dma_ops->dma_supported(dev, mask);
+/* We have our own implementation of pci_set_dma_mask() */
 static inline int dma_set_mask(struct device *dev, u64 dma_mask)
        struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to