Skip to content

Commit

Permalink
Allocate non-coherent DMA pages in stream mode
Browse files Browse the repository at this point in the history
  • Loading branch information
JJL772 committed Jun 5, 2024
1 parent ff0e137 commit b10e607
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions common/driver/dma_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ size_t dmaAllocBuffers ( struct DmaDevice *dev, struct DmaBufferList *list,
uint32_t x;
uint32_t sl;
uint32_t sli;

dma_addr_t dmaHandle = {0};
struct DmaBuffer * buff;

// Determine number of sub-lists
Expand Down Expand Up @@ -106,12 +106,12 @@ size_t dmaAllocBuffers ( struct DmaDevice *dev, struct DmaBufferList *list,

// Streaming buffer type, standard kernel memory
else if ( list->dev->cfgMode & BUFF_STREAM ) {
buff->buffAddr = dma_alloc_coherent(list->dev->device, list->dev->cfgSize, &buff->buffHandle, GFP_KERNEL);
dev_info(dev->device, "dmaAllocBuffers: BUFF_STREAM\n");

// Check for mapping error
if (buff->buffAddr == NULL) {
dev_err(dev->device,"dmaAllocBuffers: dma_alloc_coherent failed\n");
}
buff->buffAddr = dma_alloc_pages(list->dev->device, list->dev->cfgSize, &dmaHandle, direction, GFP_KERNEL);

if (buff->buffAddr == NULL)
dev_err(dev->device, "dmaAllocBuffers: dma_alloc_pages failed\n");
}

// ACP type with permanent handle mapping, dma capable kernel memory
Expand Down

0 comments on commit b10e607

Please sign in to comment.