Skip to content

Commit

Permalink
changing GFP_DMA32 to GFP_DMA
Browse files Browse the repository at this point in the history
Using GFP_DMA for DMA allocations in a kernel code that runs on a 32-bit system should not inherently cause an error just because of the flag's usage. The GFP_DMA flag is used to indicate that the allocated memory is DMA-able, and it's generally used for devices that require direct access to physical memory without going through the CPU's caching mechanisms. This flag is not specifically tied to 32-bit or 64-bit addressing; it's more about the requirements of the device and the DMA (Direct Memory Access) system.
  • Loading branch information
ruck314 committed Feb 24, 2024
1 parent ed9ef5b commit 62dc642
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions common/driver/axis_gen2.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,8 @@ void AxisG2_Init(struct DmaDevice *dev) {
hwData->writeHandle = virt_to_phys(hwData->writeAddr);
} else {
// Allocate coherent DMA buffers for read and write operations
hwData->readAddr = dma_alloc_coherent(dev->device, size, &(hwData->readHandle), GFP_DMA32 | GFP_KERNEL);
hwData->writeAddr = dma_alloc_coherent(dev->device, size, &(hwData->writeHandle), GFP_DMA32 | GFP_KERNEL);
hwData->readAddr = dma_alloc_coherent(dev->device, size, &(hwData->readHandle), GFP_DMA | GFP_KERNEL);
hwData->writeAddr = dma_alloc_coherent(dev->device, size, &(hwData->writeHandle), GFP_DMA | GFP_KERNEL);
}

// Log buffer addresses
Expand Down
2 changes: 1 addition & 1 deletion common/driver/dma_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ size_t dmaAllocBuffers ( struct DmaDevice *dev, struct DmaBufferList *list,
// Coherent buffer, map dma coherent buffers
if ( list->dev->cfgMode & BUFF_COHERENT ) {
buff->buffAddr =
dma_alloc_coherent(list->dev->device, list->dev->cfgSize, &(buff->buffHandle), GFP_DMA32 | GFP_KERNEL);
dma_alloc_coherent(list->dev->device, list->dev->cfgSize, &(buff->buffHandle), GFP_DMA | GFP_KERNEL);
}

// Streaming buffer type, standard kernel memory
Expand Down

0 comments on commit 62dc642

Please sign in to comment.