Re: About dma_sync_single_for_{cpu,device}

2012-07-31 Thread Karl Beldan
On 7/31/12, Russell King - ARM Linux wrote: > On Tue, Jul 31, 2012 at 09:31:13PM +0200, Karl Beldan wrote: >> On 7/31/12, Russell King - ARM Linux wrote: >> > On Tue, Jul 31, 2012 at 08:45:57AM +0200, Karl Beldan wrote: >> >> I was expecting the following to work: >> >> addr = dma_map_single(de

Re: About dma_sync_single_for_{cpu,device}

2012-07-31 Thread Russell King - ARM Linux
On Tue, Jul 31, 2012 at 09:31:13PM +0200, Karl Beldan wrote: > On 7/31/12, Russell King - ARM Linux wrote: > > On Tue, Jul 31, 2012 at 08:45:57AM +0200, Karl Beldan wrote: > >> I was expecting the following to work: > >>addr = dma_map_single(dev, buffer, size, DMA_TO_DEVICE); > >>dma_sync_

Re: About dma_sync_single_for_{cpu,device}

2012-07-31 Thread Karl Beldan
On 7/31/12, Russell King - ARM Linux wrote: > On Tue, Jul 31, 2012 at 08:45:57AM +0200, Karl Beldan wrote: >> I was expecting the following to work: >> addr = dma_map_single(dev, buffer, size, DMA_TO_DEVICE); >> dma_sync_single_for_device(dev, buffer, pattern_size, DMA_FROM_DEVICE); >>

Re: About dma_sync_single_for_{cpu,device}

2012-07-31 Thread Russell King - ARM Linux
On Tue, Jul 31, 2012 at 08:45:57AM +0200, Karl Beldan wrote: > I was expecting the following to work: > addr = dma_map_single(dev, buffer, size, DMA_TO_DEVICE); > dma_sync_single_for_device(dev, buffer, pattern_size, DMA_FROM_DEVICE); > dev_send(buffer); > // wait for irq (d

Re: About dma_sync_single_for_{cpu,device}

2012-07-31 Thread Karl Beldan
On Tue, Jul 31, 2012 at 09:34:01AM +0200, Clemens Ladisch wrote: > Karl Beldan wrote: > > On 7/31/12, Clemens Ladisch wrote: > >> Karl Beldan wrote: > >>> To tx a chunk of data from the SoC => network device, we : > >>> - prepare a buffer with a leading header embedding a pattern, > >>> - trigger

Re: About dma_sync_single_for_{cpu,device}

2012-07-31 Thread Clemens Ladisch
Karl Beldan wrote: > On 7/31/12, Clemens Ladisch wrote: >> Karl Beldan wrote: >>> To tx a chunk of data from the SoC => network device, we : >>> - prepare a buffer with a leading header embedding a pattern, >>> - trigger the xfer and wait for an irq >>> // The device updates the pattern and then t

Re: About dma_sync_single_for_{cpu,device}

2012-07-31 Thread Karl Beldan
On 7/31/12, Clemens Ladisch wrote: > Karl Beldan wrote: >> To tx a chunk of data from the SoC => network device, we : >> - prepare a buffer with a leading header embedding a pattern, >> - trigger the xfer and wait for an irq >> // The device updates the pattern and then triggers an irq >> - upon i

Re: About dma_sync_single_for_{cpu,device}

2012-07-31 Thread Clemens Ladisch
Karl Beldan wrote: > To tx a chunk of data from the SoC => network device, we : > - prepare a buffer with a leading header embedding a pattern, > - trigger the xfer and wait for an irq > // The device updates the pattern and then triggers an irq > - upon irq we check the pattern for the xfer comple

Re: About dma_sync_single_for_{cpu,device}

2012-07-30 Thread Karl Beldan
Hi, (This is an email originally addressed to the linux-kernel mailing-list.) On our board we've got an MV78200 and a network device between which we xfer memory chunks via the ddram with an external dma controller. To handle these xfers we're using the dma API. To tx a chunk of data from the

Re: About dma_sync_single_for_{cpu,device}

2012-07-30 Thread karl . beldan
On Mon, Jul 30, 2012 at 10:24:01PM +0200, karl.bel...@gmail.com wrote: > I was expecting the following to work: > addr = dma_map_single(dev, buffer, size, DMA_TO_DEVICE); Sorry, I forgot this (invalidate): dma_sync_single_for_device(dev, buffer, pattern_size, DMA_FROM_DEVICE); >