From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [PATCH 1/7] Set archdata.dma_data for direct DMA in cell_dma_dev_setup() From: Benjamin Herrenschmidt To: Michael Ellerman In-Reply-To: <2949748ba6ad7e14f0768ac3889267e42c050d7a.1200894155.git.michael@ellerman.id.au> References: <2949748ba6ad7e14f0768ac3889267e42c050d7a.1200894155.git.michael@ellerman.id.au> Content-Type: text/plain Date: Mon, 21 Jan 2008 17:20:01 +1100 Message-Id: <1200896401.7222.103.camel@pasglop> Mime-Version: 1.0 Cc: linuxppc-dev@ozlabs.org, Arnd Bergmann , cbe-oss-dev@ozlabs.org Reply-To: benh@kernel.crashing.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, 2008-01-21 at 16:42 +1100, Michael Ellerman wrote: > 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 Acked-by: Benjamin Herrenschmidt > --- > arch/powerpc/platforms/cell/iommu.c | 8 ++++++-- > 1 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c > index bceb5e1..9682b63 100644 > --- a/arch/powerpc/platforms/cell/iommu.c > +++ b/arch/powerpc/platforms/cell/iommu.c > @@ -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 > @@ -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); >