diff options
author | Colin Cross <ccross@android.com> | 2013-03-13 17:16:02 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2013-03-13 17:16:02 -0700 |
commit | 0b203ab4aacdb6e6dfb8c277aa290f0a02428e6f (patch) | |
tree | 9bab760a750d9cf4504d92603ee7fc82beeb2e38 /arch/arm/mm/dma-mapping.c | |
parent | a276def548828763cf5ac228adf8c1ca73f8d4d3 (diff) | |
parent | e28c3f2b514b5581e15614f7cf976131092cf4b6 (diff) | |
download | kernel_samsung_tuna-0b203ab4aacdb6e6dfb8c277aa290f0a02428e6f.zip kernel_samsung_tuna-0b203ab4aacdb6e6dfb8c277aa290f0a02428e6f.tar.gz kernel_samsung_tuna-0b203ab4aacdb6e6dfb8c277aa290f0a02428e6f.tar.bz2 |
Merge tag 'v3.0.68' into android-3.0
This is the 3.0.68 stable release
Conflicts:
kernel/cgroup.c
Change-Id: I067982d25e18e3a12de93a5eb6429b8829d7ca11
Diffstat (limited to 'arch/arm/mm/dma-mapping.c')
-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); } |