Skip to content

Commit

Permalink
[POWERPC] Set archdata.dma_data for direct DMA in cell_dma_dev_setup()
Browse files Browse the repository at this point in the history
Store the direct_dma_offset in each device's dma_data in the case
where we're using the direct DMA ops.

We need to make sure we setup the ppc_md.pci_dma_dev_setup() callback
if we're using a non-zero offset.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Jan 25, 2008
1 parent 9d5f492 commit 110f95c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions arch/powerpc/platforms/cell/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,10 @@ static void cell_dma_dev_setup(struct device *dev)
struct cbe_iommu *iommu;
struct dev_archdata *archdata = &dev->archdata;

/* If we run without iommu, no need to do anything */
if (get_pci_dma_ops() == &dma_direct_ops)
if (get_pci_dma_ops() == &dma_direct_ops) {
archdata->dma_data = (void *)dma_direct_offset;
return;
}

/* Current implementation uses the first window available in that
* node's iommu. We -might- do something smarter later though it may
Expand Down Expand Up @@ -690,6 +691,9 @@ static int __init cell_iommu_init_disabled(void)

dma_direct_offset += base;

if (dma_direct_offset != 0)
ppc_md.pci_dma_dev_setup = cell_pci_dma_dev_setup;

printk("iommu: disabled, direct DMA offset is 0x%lx\n",
dma_direct_offset);

Expand Down

0 comments on commit 110f95c

Please sign in to comment.