]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00181680-1 No audio when play 3 streams after 3~10 seconds sometimes
authorb02247 <b02247@freescale.com>
Wed, 9 May 2012 09:30:41 +0000 (17:30 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:14:05 +0000 (14:14 +0200)
sdma: bd is bufferable dma buffer, interrupt handler can not get correct
      data after sdma script updated. Which will cause there is no interrupt
      after failed period number times in the interrupt handler.
This is a workaround.

Signed-off-by: b02247 <b02247@freescale.com>
arch/arm/include/asm/dma-mapping.h
arch/arm/mm/dma-mapping.c

index 635c940cd060de9efe3dfab945a406a18f4d0ff6..5eaa7a2f424040de1b7fa918e1b126d6ce792b19 100644 (file)
@@ -172,6 +172,19 @@ static inline void dma_free_noncoherent(struct device *dev, size_t size,
 {
 }
 
+/**
+ * dma_alloc_noncached - allocate consistent memory for DMA
+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
+ * @size: required memory size
+ * @handle: bus-specific DMA address
+ *
+ * Allocate some uncached, unbuffered memory for a device for
+ * performing DMA.  This function allocates pages, and will
+ * return the CPU-viewed address, and sets @handle to be the
+ * device-viewed address.
+ */
+extern void *dma_alloc_noncached(struct device *, size_t, dma_addr_t *, gfp_t);
+
 /**
  * dma_alloc_coherent - allocate consistent memory for DMA
  * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
index 0f0baddf4eb91a87d6617af8bf23a317409fef7b..feb83cb5e993f96550ec7ca2ee63291b4ac20978 100644 (file)
@@ -328,6 +328,23 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
        return addr;
 }
 
+/*
+ * Allocate DMA-coherent memory space and return both the kernel remapped
+ * virtual and bus address for that space.
+ */
+void *
+dma_alloc_noncached(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp)
+{
+       void *memory;
+
+       if (dma_alloc_from_coherent(dev, size, handle, &memory))
+               return memory;
+
+       return __dma_alloc(dev, size, handle, gfp,
+                          pgprot_noncached(pgprot_kernel));
+}
+EXPORT_SYMBOL(dma_alloc_noncached);
+
 /*
  * Allocate DMA-coherent memory space and return both the kernel remapped
  * virtual and bus address for that space.