diff options
Diffstat (limited to 'drivers/virtio/virtio_pci_legacy.c')
-rw-r--r-- | drivers/virtio/virtio_pci_legacy.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/virtio/virtio_pci_legacy.c b/drivers/virtio/virtio_pci_legacy.c index 8c4e61783441..6d9e5173d5fa 100644 --- a/drivers/virtio/virtio_pci_legacy.c +++ b/drivers/virtio/virtio_pci_legacy.c | |||
@@ -212,10 +212,18 @@ int virtio_pci_legacy_probe(struct virtio_pci_device *vp_dev) | |||
212 | return -ENODEV; | 212 | return -ENODEV; |
213 | } | 213 | } |
214 | 214 | ||
215 | rc = dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(64)); | 215 | rc = dma_set_mask(&pci_dev->dev, DMA_BIT_MASK(64)); |
216 | if (rc) | 216 | if (rc) { |
217 | rc = dma_set_mask_and_coherent(&pci_dev->dev, | 217 | rc = dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(32)); |
218 | DMA_BIT_MASK(32)); | 218 | } else { |
219 | /* | ||
220 | * The virtio ring base address is expressed as a 32-bit PFN, | ||
221 | * with a page size of 1 << VIRTIO_PCI_QUEUE_ADDR_SHIFT. | ||
222 | */ | ||
223 | dma_set_coherent_mask(&pci_dev->dev, | ||
224 | DMA_BIT_MASK(32 + VIRTIO_PCI_QUEUE_ADDR_SHIFT)); | ||
225 | } | ||
226 | |||
219 | if (rc) | 227 | if (rc) |
220 | dev_warn(&pci_dev->dev, "Failed to enable 64-bit or 32-bit DMA. Trying to continue, but this might not work.\n"); | 228 | dev_warn(&pci_dev->dev, "Failed to enable 64-bit or 32-bit DMA. Trying to continue, but this might not work.\n"); |
221 | 229 | ||