From: Keir Fraser Date: Sat, 21 Jul 2007 11:37:24 +0000 (-0700) Subject: Fix swiotlb_sync_single_range() X-Git-Tag: v2.6.23-rc1~187 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df336d1c7b6fd510fa6d3a028f999e7586c7026e;p=pandora-kernel.git Fix swiotlb_sync_single_range() If the swiotlb maps a multi-slab region, swiotlb_sync_single_range() can be invoked to sync a sub-region which does not include the first slab. Unfortunately io_tlb_orig_addr[] is only initialised for the first slab, and hence the call to sync_single() will read a garbage orig_addr in this case. This patch fixes the issue by initialising all mapped slabs in io_tlb_orig_addr[]. It also correctly adjusts the buffer pointer in sync_single() to handle the case that the given dma_addr is not aligned on a slab boundary. Signed-off-by: Keir Fraser Cc: "Luck, Tony" Acked-by: Andi Kleen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed