Commit 09f1ef35 authored by Raptor Engineering Development Team's avatar Raptor Engineering Development Team
Browse files

opvxa24xx: Set DMA mask back to 32 bits

The original 14 bit workaround is no longer needed after fixing a presumed
interrupt-related timing race condition via the high latency CPU power
saving state workaround (GIT hash 1e031dff)
parent 87936c83
......@@ -2398,23 +2398,8 @@ static int __devinit a24xx_init_one(struct pci_dev *pdev, const struct pci_devic
wc->index = index;
/* The closed-source proprietary OpenVox firmware / HDL on this card is *badly* broken.
* It will try to read from unauthorized host addresses via DMA if more than 26 or so address bits are used,
* and even then it's unknown how reliable the card will be with that many address bits actually in use.
*
* Due to the closed firmware source, it's unknown if this is intentional or just wild DMA resulting from bugs
* in the firmware / HDL. In any case, x86 allows these through with unknown / undefined effect, whereas POWER
* blocks them and throws an EEH (the correct behavior in this instance). The side effect is that on POWER
* we lose the card on each wild DMA, as recovery without module reload and service restart is not guaranteed.
*
* Since we only need a ~1k DMA buffer, constrain the card's physical DMA address to the lower 14 bits...
* On POWER systems, this usually results in a PCI physical address of 0x0000000000001000.
*
* NOTE: This workaround only reduces the EEH frequency, it does not fully resolve the issue. Raptor has had
* good success in significantly reducing (if not outright elmininating) these issues with a combination of both
* this workaround and forcing the PCIe link speed to v1.x transfer rates (2.5GT/s).
*/
if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(14)) || dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(14))) {
// Set the DMA mask appropriately
if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)) || dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32))) {
if (wc_dev->freeregion) {
release_mem_region(wc_dev->mem_region, wc_dev->mem_len);
iounmap((void *)wc_dev->mem32);
......@@ -2437,16 +2422,6 @@ static int __devinit a24xx_init_one(struct pci_dev *pdev, const struct pci_devic
return -ENOMEM;
}
if (wc_dev->writedma & (~DMA_BIT_MASK(14))) {
dma_free_coherent(&pdev->dev, wc_dev->dma_buffer_size, (void *)wc_dev->writechunk, wc_dev->writedma);
if (wc_dev->freeregion) {
release_mem_region(wc_dev->mem_region, wc_dev->mem_len);
iounmap((void *)wc_dev->mem32);
dev_warn(&wc_dev->dev->dev, "opvxa24xx: dma_alloc_coherent() gave a physical address %p outside of the requested range, aborting!\n", (void *)wc_dev->writedma);
return -EIO;
}
}
if(debug) {
printk("opvxa24xx: dma buffer allocated at %p, pci(0x%016x), size %d bytes\n", wc_dev->writechunk, wc_dev->writedma, wc_dev->dma_buffer_size);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment