[PATCH] ARM: fix highmem with VIPT cache and DMA

Nicolas Pitre nico at fluxnic.net
Mon Apr 12 11:36:20 EDT 2010


On Mon, 12 Apr 2010, saeed bishara wrote:

> Nico, thanks for the patch.
> I've ported it for 2.6.32.9 kernel, can you have a look at the
> attached patch?

That patch is bad.

|diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
|index b9590a7..5286d71 100644
|--- a/arch/arm/mm/dma-mapping.c
|+++ b/arch/arm/mm/dma-mapping.c
|@@ -602,6 +602,11 @@ static void dma_cache_maint_contiguous(struct page *page, unsigned long offset,
| 			vaddr += offset;
| 			inner_op(vaddr, vaddr + size);
| 			kunmap_high(page);
|+		} else if (cache_is_vipt()) {
|+			pte_t saved_pte;
|+			vaddr = kmap_high_l1_vipt(page, &saved_pte);
|+			inner_op(vaddr, vaddr + size);
|+			kunmap_high_l1_vipt(page, saved_pte);
| 		}
| 	}

You should add 'offset' to 'vaddr' before passing it to inner_op(), just 
like it is done 6 lines above it.

Also you left out the addition of the unconditional flush in 
v6_copy_user_highpage_nonaliasing() which is needed now that 
kunmap_atomic() doesn't flush the cache anymore on ARMv6.


Nicolas



More information about the linux-arm-kernel mailing list