Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4a8df1507eaeefc9739e3762db606caa08edba98
Commit:     4a8df1507eaeefc9739e3762db606caa08edba98
Parent:     0e0b47abb71a2c4aed5895c01f41827dbd8a981c
Author:     Michael Ellerman <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 16:37:04 2008 +1100
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Fri Feb 8 19:52:40 2008 +1100

    [POWERPC] Fix potential cell IOMMU bug when switching back to default DMA 
ops
    
    If we get a 64-bit dma mask we switch to the fixed ops and call
    cell_dma_dev_setup().  If the driver then switches back to a 32-bit dma
    mask for any reason we don't call cell_dma_dev_setup() again, which
    has the potential to leave bogus data in dev->archdata.dma_data.
    
    Signed-off-by: Michael Ellerman <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/cell/iommu.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/platforms/cell/iommu.c 
b/arch/powerpc/platforms/cell/iommu.c
index 1f7b254..5cdcd36 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -841,19 +841,18 @@ static int dma_set_mask_and_switch(struct device *dev, 
u64 dma_mask)
        if (!dev->dma_mask || !dma_supported(dev, dma_mask))
                return -EIO;
 
-       if (dma_mask == DMA_BIT_MASK(64)) {
-               if (cell_iommu_get_fixed_address(dev) == OF_BAD_ADDR)
-                       dev_dbg(dev, "iommu: 64-bit OK, but bad addr\n");
-               else {
-                       dev_dbg(dev, "iommu: 64-bit OK, using fixed ops\n");
-                       set_dma_ops(dev, &dma_iommu_fixed_ops);
-                       cell_dma_dev_setup(dev);
-               }
+       if (dma_mask == DMA_BIT_MASK(64) &&
+               cell_iommu_get_fixed_address(dev) != OF_BAD_ADDR)
+       {
+               dev_dbg(dev, "iommu: 64-bit OK, using fixed ops\n");
+               set_dma_ops(dev, &dma_iommu_fixed_ops);
        } else {
                dev_dbg(dev, "iommu: not 64-bit, using default ops\n");
                set_dma_ops(dev, get_pci_dma_ops());
        }
 
+       cell_dma_dev_setup(dev);
+
        *dev->dma_mask = dma_mask;
 
        return 0;
-
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  http://vger.kernel.org/majordomo-info.html

Reply via email to