aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/pci
diff options
context:
space:
mode:
authorGerald Schaefer <gerald.schaefer@de.ibm.com>2013-04-22 13:27:17 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-04-23 04:18:16 -0400
commit186f50fa568a221fdabd6753341c2de4abd24b78 (patch)
treeaec34a12d243f9819f1debc49a6f91481af6b6fd /arch/s390/pci
parent63dd9b44ac926d3250c1e8dfcb309c37c870fe21 (diff)
s390/pci: return correct dma address for offset > PAGE_SIZE
For offset > PAGE_SIZE, s390_dma_map_pages() will issue a warning and return a wrong dma address. This patch removes the warning and fixes the dma return address calculation. 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')
-rw-r--r--arch/s390/pci/pci_dma.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/s390/pci/pci_dma.c b/arch/s390/pci/pci_dma.c
index 60e4999e6b67..f8e69d5bc0a9 100644
--- a/arch/s390/pci/pci_dma.c
+++ b/arch/s390/pci/pci_dma.c
@@ -269,8 +269,6 @@ static dma_addr_t s390_dma_map_pages(struct device *dev, struct page *page,
269 int flags = ZPCI_PTE_VALID; 269 int flags = ZPCI_PTE_VALID;
270 dma_addr_t dma_addr; 270 dma_addr_t dma_addr;
271 271
272 WARN_ON_ONCE(offset > PAGE_SIZE);
273
274 /* This rounds up number of pages based on size and offset */ 272 /* This rounds up number of pages based on size and offset */
275 nr_pages = iommu_num_pages(pa, size, PAGE_SIZE); 273 nr_pages = iommu_num_pages(pa, size, PAGE_SIZE);
276 iommu_page_index = dma_alloc_iommu(zdev, nr_pages); 274 iommu_page_index = dma_alloc_iommu(zdev, nr_pages);
@@ -292,7 +290,7 @@ static dma_addr_t s390_dma_map_pages(struct device *dev, struct page *page,
292 290
293 if (!dma_update_trans(zdev, pa, dma_addr, size, flags)) { 291 if (!dma_update_trans(zdev, pa, dma_addr, size, flags)) {
294 atomic64_add(nr_pages, (atomic64_t *) &zdev->fmb->mapped_pages); 292 atomic64_add(nr_pages, (atomic64_t *) &zdev->fmb->mapped_pages);
295 return dma_addr + offset; 293 return dma_addr + (offset & ~PAGE_MASK);
296 } 294 }
297 295
298out_free: 296out_free: