diff options
Diffstat (limited to 'kernel/drivers/char/xillybus')
-rw-r--r-- | kernel/drivers/char/xillybus/Kconfig | 2 | ||||
-rw-r--r-- | kernel/drivers/char/xillybus/xillybus_pcie.c | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/kernel/drivers/char/xillybus/Kconfig b/kernel/drivers/char/xillybus/Kconfig index b53bdf12d..b302684d8 100644 --- a/kernel/drivers/char/xillybus/Kconfig +++ b/kernel/drivers/char/xillybus/Kconfig @@ -24,7 +24,7 @@ config XILLYBUS_PCIE config XILLYBUS_OF tristate "Xillybus over Device Tree" - depends on OF_ADDRESS && OF_IRQ + depends on OF_ADDRESS && OF_IRQ && HAS_DMA help Set to M if you want Xillybus to find its resources from the Open Firmware Flattened Device Tree. If the target is an embedded diff --git a/kernel/drivers/char/xillybus/xillybus_pcie.c b/kernel/drivers/char/xillybus/xillybus_pcie.c index d8266bc2a..941830021 100644 --- a/kernel/drivers/char/xillybus/xillybus_pcie.c +++ b/kernel/drivers/char/xillybus/xillybus_pcie.c @@ -193,14 +193,16 @@ static int xilly_probe(struct pci_dev *pdev, } /* - * In theory, an attempt to set the DMA mask to 64 and dma_using_dac=1 - * is the right thing. But some unclever PCIe drivers report it's OK - * when the hardware drops those 64-bit PCIe packets. So trust - * nobody and use 32 bits DMA addressing in any case. + * Some (old and buggy?) hardware drops 64-bit addressed PCIe packets, + * even when the PCIe driver claims that a 64-bit mask is OK. On the + * other hand, on some architectures, 64-bit addressing is mandatory. + * So go for the 64-bit mask only when failing is the other option. */ if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { endpoint->dma_using_dac = 0; + } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { + endpoint->dma_using_dac = 1; } else { dev_err(endpoint->dev, "Failed to set DMA mask. Aborting.\n"); return -ENODEV; |