From: Gerald Schaefer Date: Mon, 22 Apr 2013 17:27:17 +0000 (+0200) Subject: s390/pci: return correct dma address for offset > PAGE_SIZE X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=186f50fa568a221fdabd6753341c2de4abd24b78;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Martin Schwidefsky --- 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, int flags = ZPCI_PTE_VALID; dma_addr_t dma_addr; - WARN_ON_ONCE(offset > PAGE_SIZE); - /* This rounds up number of pages based on size and offset */ nr_pages = iommu_num_pages(pa, size, PAGE_SIZE); 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, if (!dma_update_trans(zdev, pa, dma_addr, size, flags)) { atomic64_add(nr_pages, (atomic64_t *) &zdev->fmb->mapped_pages); - return dma_addr + offset; + return dma_addr + (offset & ~PAGE_MASK); } out_free: