|
@@ -2426,7 +2426,7 @@ static int idt_init_pci(struct idt_ntb_dev *ndev)
|
|
|
struct pci_dev *pdev = ndev->ntb.pdev;
|
|
|
int ret;
|
|
|
|
|
|
- /* Initialize the bit mask of DMA */
|
|
|
+ /* Initialize the bit mask of PCI/NTB DMA */
|
|
|
ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
|
|
|
if (ret != 0) {
|
|
|
ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
|
|
@@ -2447,6 +2447,12 @@ static int idt_init_pci(struct idt_ntb_dev *ndev)
|
|
|
dev_warn(&pdev->dev,
|
|
|
"Cannot set consistent DMA highmem bit mask\n");
|
|
|
}
|
|
|
+ ret = dma_coerce_mask_and_coherent(&ndev->ntb.dev,
|
|
|
+ dma_get_mask(&pdev->dev));
|
|
|
+ if (ret != 0) {
|
|
|
+ dev_err(&pdev->dev, "Failed to set NTB device DMA bit mask\n");
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
|
|
|
/*
|
|
|
* Enable the device advanced error reporting. It's not critical to
|