diff options
author | Pawit Pornkitprasan <p.pawit@gmail.com> | 2013-02-13 15:03:34 +0700 |
---|---|---|
committer | Pawit Pornkitprasan <p.pawit@gmail.com> | 2013-02-13 15:03:58 +0700 |
commit | 5f9dde0757e557d16685d29b21a6055025ec252e (patch) | |
tree | 5f34dae1bcf94f1865c18ba9aced566abeb855b7 /arch/arm/mm | |
parent | 6b5ed324376aa451c3a51e367148da41c21ae36a (diff) | |
parent | a96dbfbcb58afeec72c2a0a03d205e0e1457ea3d (diff) | |
download | kernel_samsung_aries-5f9dde0757e557d16685d29b21a6055025ec252e.zip kernel_samsung_aries-5f9dde0757e557d16685d29b21a6055025ec252e.tar.gz kernel_samsung_aries-5f9dde0757e557d16685d29b21a6055025ec252e.tar.bz2 |
Merge 3.0.63
Change-Id: I9a9716dcb833c128a649864690169473ec4739e1
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/dma-mapping.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index f96d2c7..5663650 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -467,25 +467,27 @@ static void dma_cache_maint_page(struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, void (*op)(const void *, size_t, int)) { + unsigned long pfn; + size_t left = size; + + pfn = page_to_pfn(page) + offset / PAGE_SIZE; + offset %= PAGE_SIZE; + /* * A single sg entry may refer to multiple physically contiguous * pages. But we still need to process highmem pages individually. * If highmem is not configured then the bulk of this loop gets * optimized out. */ - size_t left = size; do { size_t len = left; void *vaddr; + page = pfn_to_page(pfn); + if (PageHighMem(page)) { - if (len + offset > PAGE_SIZE) { - if (offset >= PAGE_SIZE) { - page += offset / PAGE_SIZE; - offset %= PAGE_SIZE; - } + if (len + offset > PAGE_SIZE) len = PAGE_SIZE - offset; - } vaddr = kmap_high_get(page); if (vaddr) { vaddr += offset; @@ -502,7 +504,7 @@ static void dma_cache_maint_page(struct page *page, unsigned long offset, op(vaddr, len, dir); } offset = 0; - page++; + pfn++; left -= len; } while (left); } |