From: Grazvydas Ignotas Date: Tue, 30 Jun 2015 22:38:10 +0000 (+0300) Subject: ARM: dma-mapping: avoid speculative prefetching fix X-Git-Tag: sz_173~15 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=8f3b5e57de448bfd744a174b6611ce38bf52c776;hp=08bd71afb74edbf7b9308328aca50f7018e6edca ARM: dma-mapping: avoid speculative prefetching fix This partially reverts 2ffe2da3e71652d4f4cae19539b5c78c2a239136. Cortex-A8 doesn't seem to be doing any speculative data prefetching, there is no mention of this in the manual (unlike as for A9), only instruction prefetch is mentioned. For us this fix is only causing useless performance penalty, avoid it. The 2.6.27 kernel we used before didn't have this fix and all seemed to be fine. --- diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S index 39e3fb3db801..39539209be86 100644 --- a/arch/arm/mm/cache-v7.S +++ b/arch/arm/mm/cache-v7.S @@ -329,9 +329,10 @@ ENDPROC(v7_dma_flush_range) */ ENTRY(v7_dma_map_area) add r1, r1, r0 - teq r2, #DMA_FROM_DEVICE - beq v7_dma_inv_range - b v7_dma_clean_range + cmp r2, #DMA_TO_DEVICE + beq v7_dma_clean_range + bcs v7_dma_inv_range + b v7_dma_flush_range ENDPROC(v7_dma_map_area) /* @@ -341,9 +342,6 @@ ENDPROC(v7_dma_map_area) * - dir - DMA direction */ ENTRY(v7_dma_unmap_area) - add r1, r1, r0 - teq r2, #DMA_TO_DEVICE - bne v7_dma_inv_range mov pc, lr ENDPROC(v7_dma_unmap_area)