]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.20.2/missing-critical-phys_to_virt-in-lib-swiotlb.c.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.20.2 / missing-critical-phys_to_virt-in-lib-swiotlb.c.patch
CommitLineData
2bb74eb3 1From stable-bounces@linux.kernel.org Sun Feb 4 12:37:49 2007
d3573c90
GKH
2From: David Moore <dcm@acm.org>
3Date: Sun, 04 Feb 2007 13:39:40 -0500
2bb74eb3
GKH
4Subject: Missing critical phys_to_virt in lib/swiotlb.c
5To: stable@kernel.org
6Cc: discuss@x86-64.org, Jan Beulich <jbeulich@novell.com>, David Moore <dcm@MIT.EDU>, akpm@linux-foundation.org, linux1394-devel <linux1394-devel@lists.sourceforge.net>
7Message-ID: <45C643BF.80204@s5r6.in-berlin.de>
8
d3573c90 9From: David Moore <dcm@acm.org>
2bb74eb3 10
d3573c90 11Missing critical phys_to_virt in lib/swiotlb.c
2bb74eb3 12
d3573c90
GKH
13Adds missing call to phys_to_virt() in the
14lib/swiotlb.c:swiotlb_sync_sg() function. Without this change, a kernel
15panic will always occur whenever a SWIOTLB bounce buffer from a
16scatter-gather list gets synced. Affected are especially Intel x86_64
17machines with more than about 3 GB RAM.
2bb74eb3 18
d3573c90
GKH
19Signed-off-by: David Moore <dcm@acm.org>
20Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2bb74eb3
GKH
21Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
22
23---
24 lib/swiotlb.c | 2 +-
25 1 file changed, 1 insertion(+), 1 deletion(-)
26
27--- linux-2.6.20.1.orig/lib/swiotlb.c
28+++ linux-2.6.20.1/lib/swiotlb.c
29@@ -750,7 +750,7 @@ swiotlb_sync_sg(struct device *hwdev, st
30
31 for (i = 0; i < nelems; i++, sg++)
32 if (sg->dma_address != SG_ENT_PHYS_ADDRESS(sg))
33- sync_single(hwdev, (void *) sg->dma_address,
34+ sync_single(hwdev, phys_to_virt(sg->dma_address),
35 sg->dma_length, dir, target);
36 }
37