diff options
| -rw-r--r-- | arch/powerpc/kernel/vio.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index 94aa7b011b27..d3694498f3af 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c | |||
| @@ -492,14 +492,14 @@ static void *vio_dma_iommu_alloc_coherent(struct device *dev, size_t size, | |||
| 492 | struct vio_dev *viodev = to_vio_dev(dev); | 492 | struct vio_dev *viodev = to_vio_dev(dev); |
| 493 | void *ret; | 493 | void *ret; |
| 494 | 494 | ||
| 495 | if (vio_cmo_alloc(viodev, roundup(size, IOMMU_PAGE_SIZE))) { | 495 | if (vio_cmo_alloc(viodev, roundup(size, PAGE_SIZE))) { |
| 496 | atomic_inc(&viodev->cmo.allocs_failed); | 496 | atomic_inc(&viodev->cmo.allocs_failed); |
| 497 | return NULL; | 497 | return NULL; |
| 498 | } | 498 | } |
| 499 | 499 | ||
| 500 | ret = dma_iommu_ops.alloc_coherent(dev, size, dma_handle, flag); | 500 | ret = dma_iommu_ops.alloc_coherent(dev, size, dma_handle, flag); |
| 501 | if (unlikely(ret == NULL)) { | 501 | if (unlikely(ret == NULL)) { |
| 502 | vio_cmo_dealloc(viodev, roundup(size, IOMMU_PAGE_SIZE)); | 502 | vio_cmo_dealloc(viodev, roundup(size, PAGE_SIZE)); |
| 503 | atomic_inc(&viodev->cmo.allocs_failed); | 503 | atomic_inc(&viodev->cmo.allocs_failed); |
| 504 | } | 504 | } |
| 505 | 505 | ||
| @@ -513,7 +513,7 @@ static void vio_dma_iommu_free_coherent(struct device *dev, size_t size, | |||
| 513 | 513 | ||
| 514 | dma_iommu_ops.free_coherent(dev, size, vaddr, dma_handle); | 514 | dma_iommu_ops.free_coherent(dev, size, vaddr, dma_handle); |
| 515 | 515 | ||
| 516 | vio_cmo_dealloc(viodev, roundup(size, IOMMU_PAGE_SIZE)); | 516 | vio_cmo_dealloc(viodev, roundup(size, PAGE_SIZE)); |
| 517 | } | 517 | } |
| 518 | 518 | ||
| 519 | static dma_addr_t vio_dma_iommu_map_page(struct device *dev, struct page *page, | 519 | static dma_addr_t vio_dma_iommu_map_page(struct device *dev, struct page *page, |
| @@ -572,6 +572,7 @@ static int vio_dma_iommu_map_sg(struct device *dev, struct scatterlist *sglist, | |||
| 572 | if (unlikely(!ret)) { | 572 | if (unlikely(!ret)) { |
| 573 | vio_cmo_dealloc(viodev, alloc_size); | 573 | vio_cmo_dealloc(viodev, alloc_size); |
| 574 | atomic_inc(&viodev->cmo.allocs_failed); | 574 | atomic_inc(&viodev->cmo.allocs_failed); |
| 575 | return ret; | ||
| 575 | } | 576 | } |
| 576 | 577 | ||
| 577 | for (sgl = sglist, count = 0; count < ret; count++, sgl++) | 578 | for (sgl = sglist, count = 0; count < ret; count++, sgl++) |
