mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
char: xillybus: Allow 64-bit DMA on PCIe interface
Until now, only 32-bit DMA addressing was allowed, following a report on some old Intel machine that dropped 64-bit PCIe packets, even though pci_set_dma_mask() was successful with DMA_BIT_MASK(64). But then came TI's Keystone II chip (ARM Cortex A15 + DSPs), which refuses 32-bit DMA addressing (for good reasons). So 64-bit DMA is allowed as a fallback option. Signed-off-by: Eli Billauer <eli.billauer@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f39c4280a3
commit
6497a87573
@ -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
|
* Some (old and buggy?) hardware drops 64-bit addressed PCIe packets,
|
||||||
* is the right thing. But some unclever PCIe drivers report it's OK
|
* even when the PCIe driver claims that a 64-bit mask is OK. On the
|
||||||
* when the hardware drops those 64-bit PCIe packets. So trust
|
* other hand, on some architectures, 64-bit addressing is mandatory.
|
||||||
* nobody and use 32 bits DMA addressing in any case.
|
* So go for the 64-bit mask only when failing is the other option.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
|
if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
|
||||||
endpoint->dma_using_dac = 0;
|
endpoint->dma_using_dac = 0;
|
||||||
|
} else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
|
||||||
|
endpoint->dma_using_dac = 1;
|
||||||
} else {
|
} else {
|
||||||
dev_err(endpoint->dev, "Failed to set DMA mask. Aborting.\n");
|
dev_err(endpoint->dev, "Failed to set DMA mask. Aborting.\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user