summaryrefslogtreecommitdiffstats
path: root/arch/s390/pci/pci_dma.c
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2016-06-03 19:05:38 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2016-06-13 15:58:24 +0200
commit8ee2db3cf1dc02ff9f2c65ac8bd7f478ba79abbe (patch)
tree18202aa8e0d9e2e55948c4a8a3b0215b93c3835b /arch/s390/pci/pci_dma.c
parent53b1bc9aba525a599721565507d9e3aebae80a1d (diff)
downloadlinux-stable-8ee2db3cf1dc02ff9f2c65ac8bd7f478ba79abbe.tar.gz
linux-stable-8ee2db3cf1dc02ff9f2c65ac8bd7f478ba79abbe.tar.bz2
linux-stable-8ee2db3cf1dc02ff9f2c65ac8bd7f478ba79abbe.zip
s390/pci: ensure to not cross a dma segment boundary
When we use the iommu_area_alloc helper to get dma addresses we specify the boundary_size parameter but not the offset (called shift in this context). As long as the offset (start_dma) is a multiple of the boundary we're ok (on current machines start_dma always seems to be 4GB). Don't leave this to chance and specify the offset for iommu_area_alloc. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Reviewed-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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/s390/pci/pci_dma.c b/arch/s390/pci/pci_dma.c
index 494eb832bcc5..070f1ae5cfad 100644
--- a/arch/s390/pci/pci_dma.c
+++ b/arch/s390/pci/pci_dma.c
@@ -226,7 +226,8 @@ static unsigned long __dma_alloc_iommu(struct device *dev,
boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1,
PAGE_SIZE) >> PAGE_SHIFT;
return iommu_area_alloc(zdev->iommu_bitmap, zdev->iommu_pages,
- start, size, 0, boundary_size, 0);
+ start, size, zdev->start_dma >> PAGE_SHIFT,
+ boundary_size, 0);
}
static unsigned long dma_alloc_iommu(struct device *dev, int size)