Skip to content

Commit

Permalink
dma_set_mask_and_coherent is deprecated in favor of separate calls to…
Browse files Browse the repository at this point in the history
… dma_set_mask and dma_set_coherent_mask separately

using separate calls provides greater clarity, flexibility, and compatibility with future kernel versions, while potentially offering performance benefits and easing debugging efforts
  • Loading branch information
ruck314 committed Feb 22, 2024
1 parent 208080c commit f193f36
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions data_dev/driver/src/data_dev_top.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,20 @@ int DataDev_Probe(struct pci_dev *pcidev, const struct pci_device_id *dev_id) {
AxiVersion_SetUserReset(dev->base + AVER_OFF,false);

// 128bit desc, = 64-bit address map
if ( (readl(dev->reg) & 0x10000) != 0) {
if ((readl(dev->reg) & 0x10000) != 0) {
// Get the AXI Address width (in units of bits)
axiWidth = (readl(dev->reg+0x34) >> 8) & 0xFF;
if ( !dma_set_mask_and_coherent(dev->device, DMA_BIT_MASK(axiWidth)) ) {
dev_info(dev->device,"Init: Using %d-bit DMA mask.\n",axiWidth);
axiWidth = (readl(dev->reg + 0x34) >> 8) & 0xFF;

if (!dma_set_mask(dev->device, DMA_BIT_MASK(axiWidth))) {
dev_info(dev->device, "Init: Using %d-bit DMA mask.\n", axiWidth);

if (!dma_set_coherent_mask(dev->device, DMA_BIT_MASK(axiWidth))) {
dev_info(dev->device, "Init: Using %d-bit coherent DMA mask.\n", axiWidth);
} else {
dev_warn(dev->device, "Init: Failed to set coherent DMA mask.\n");
}
} else {
dev_warn(dev->device,"Init: Failed to set DMA mask.\n");
dev_warn(dev->device, "Init: Failed to set DMA mask.\n");
}
}

Expand Down

0 comments on commit f193f36

Please sign in to comment.