Skip to content

Commit

Permalink
ARM: 6187/1: The v6_dma_inv_range() function must preserve data on SMP
Browse files Browse the repository at this point in the history
A recent patch for DMA cache maintenance on ARM11MPCore added a write
for ownership trick to the v6_dma_inv_range() function. Such operation
destroys data already present in the buffer. However, this function is
used with with dma_sync_single_for_device() which is supposed to
preserve the existing data transfered into the buffer. This patch adds a
combination of read/write for ownership to preserve the original data.

Reported-by: Ronen Shitrit <rshitrit@marvell.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Catalin Marinas authored and Russell King committed Jul 1, 2010
1 parent a5e9d38 commit ca57926
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/arm/mm/cache-v6.S
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ v6_dma_inv_range:
#endif
1:
#ifdef CONFIG_SMP
str r0, [r0] @ write for ownership
ldr r2, [r0] @ read for ownership
str r2, [r0] @ write for ownership
#endif
#ifdef HARVARD_CACHE
mcr p15, 0, r0, c7, c6, 1 @ invalidate D line
Expand Down

0 comments on commit ca57926

Please sign in to comment.