diff options
author | Gerald Schaefer <gerald.schaefer@de.ibm.com> | 2014-02-18 13:47:17 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2014-02-21 02:48:27 -0500 |
commit | 5ec6d4918a45952e99b1b36c93372d79d6927c57 (patch) | |
tree | dbe20b17bd575cbc14cb1967b954c01686083896 /arch/s390/pci/pci_dma.c | |
parent | 423edb6fce67133d4524513954af943a75bb6ef5 (diff) |
s390/pci/dma: use correct segment boundary size
The boundary size for iommu_area_alloc() is currently set to a constant
value. This is wrong, we shouldn't use a constant value but rather the
return value of dma_get_seg_boundary(), since a device driver can override
the default.
Reviewed-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/pci/pci_dma.c')
-rw-r--r-- | arch/s390/pci/pci_dma.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/s390/pci/pci_dma.c b/arch/s390/pci/pci_dma.c index 60c11a629d96..f91c03119804 100644 --- a/arch/s390/pci/pci_dma.c +++ b/arch/s390/pci/pci_dma.c | |||
@@ -206,11 +206,13 @@ static void dma_cleanup_tables(struct zpci_dev *zdev) | |||
206 | zdev->dma_table = NULL; | 206 | zdev->dma_table = NULL; |
207 | } | 207 | } |
208 | 208 | ||
209 | static unsigned long __dma_alloc_iommu(struct zpci_dev *zdev, unsigned long start, | 209 | static unsigned long __dma_alloc_iommu(struct zpci_dev *zdev, |
210 | int size) | 210 | unsigned long start, int size) |
211 | { | 211 | { |
212 | unsigned long boundary_size = 0x1000000; | 212 | unsigned long boundary_size; |
213 | 213 | ||
214 | boundary_size = ALIGN(dma_get_seg_boundary(&zdev->pdev->dev) + 1, | ||
215 | PAGE_SIZE) >> PAGE_SHIFT; | ||
214 | return iommu_area_alloc(zdev->iommu_bitmap, zdev->iommu_pages, | 216 | return iommu_area_alloc(zdev->iommu_bitmap, zdev->iommu_pages, |
215 | start, size, 0, boundary_size, 0); | 217 | start, size, 0, boundary_size, 0); |
216 | } | 218 | } |