diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2007-10-25 03:13:32 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-10-25 03:13:32 -0400 |
commit | e88a39dee10d3a506ed8c4ba78cde0dd76a6fc83 (patch) | |
tree | 64712b8913a3571f383bcf966e12ffe66d899114 /arch/x86/kernel/pci-gart_64.c | |
parent | 82861924a5f26208c8421a799a4e8724d48eb560 (diff) |
x86: pci-gart fix
map_sg could copy the last sg element to another position (if merging
some elements). It breaks sg chaining. This copies only
dma_address/length instead of the whole sg element.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'arch/x86/kernel/pci-gart_64.c')
-rw-r--r-- | arch/x86/kernel/pci-gart_64.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c index c56e9ee64964..ae7e0161ce46 100644 --- a/arch/x86/kernel/pci-gart_64.c +++ b/arch/x86/kernel/pci-gart_64.c | |||
@@ -338,7 +338,6 @@ static int __dma_map_cont(struct scatterlist *start, int nelems, | |||
338 | 338 | ||
339 | BUG_ON(s != start && s->offset); | 339 | BUG_ON(s != start && s->offset); |
340 | if (s == start) { | 340 | if (s == start) { |
341 | *sout = *s; | ||
342 | sout->dma_address = iommu_bus_base; | 341 | sout->dma_address = iommu_bus_base; |
343 | sout->dma_address += iommu_page*PAGE_SIZE + s->offset; | 342 | sout->dma_address += iommu_page*PAGE_SIZE + s->offset; |
344 | sout->dma_length = s->length; | 343 | sout->dma_length = s->length; |
@@ -365,7 +364,7 @@ static inline int dma_map_cont(struct scatterlist *start, int nelems, | |||
365 | { | 364 | { |
366 | if (!need) { | 365 | if (!need) { |
367 | BUG_ON(nelems != 1); | 366 | BUG_ON(nelems != 1); |
368 | *sout = *start; | 367 | sout->dma_address = start->dma_address; |
369 | sout->dma_length = start->length; | 368 | sout->dma_length = start->length; |
370 | return 0; | 369 | return 0; |
371 | } | 370 | } |