diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 13:09:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 13:09:16 -0400 |
commit | 92d15c2ccbb3e31a3fc71ad28fdb55e1319383c0 (patch) | |
tree | 8d83c0dc3c6b935d8367e331872f242b742f0a8a /arch/sparc/mm/io-unit.c | |
parent | f20bf6125605acbbc7eb8c9420d7221c91aa83eb (diff) | |
parent | 644bd2f048972d75eb1979b1fdca257d528ce687 (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block: (63 commits)
Fix memory leak in dm-crypt
SPARC64: sg chaining support
SPARC: sg chaining support
PPC: sg chaining support
PS3: sg chaining support
IA64: sg chaining support
x86-64: enable sg chaining
x86-64: update pci-gart iommu to sg helpers
x86-64: update nommu to sg helpers
x86-64: update calgary iommu to sg helpers
swiotlb: sg chaining support
i386: enable sg chaining
i386 dma_map_sg: convert to using sg helpers
mmc: need to zero sglist on init
Panic in blk_rq_map_sg() from CCISS driver
remove sglist_len
remove blk_queue_max_phys_segments in libata
revert sg segment size ifdefs
Fixup u14-34f ENABLE_SG_CHAINING
qla1280: enable use_sg_chaining option
...
Diffstat (limited to 'arch/sparc/mm/io-unit.c')
-rw-r--r-- | arch/sparc/mm/io-unit.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c index 7c89893b1fe8..375b4db63704 100644 --- a/arch/sparc/mm/io-unit.c +++ b/arch/sparc/mm/io-unit.c | |||
@@ -11,8 +11,8 @@ | |||
11 | #include <linux/mm.h> | 11 | #include <linux/mm.h> |
12 | #include <linux/highmem.h> /* pte_offset_map => kmap_atomic */ | 12 | #include <linux/highmem.h> /* pte_offset_map => kmap_atomic */ |
13 | #include <linux/bitops.h> | 13 | #include <linux/bitops.h> |
14 | #include <linux/scatterlist.h> | ||
14 | 15 | ||
15 | #include <asm/scatterlist.h> | ||
16 | #include <asm/pgalloc.h> | 16 | #include <asm/pgalloc.h> |
17 | #include <asm/pgtable.h> | 17 | #include <asm/pgtable.h> |
18 | #include <asm/sbus.h> | 18 | #include <asm/sbus.h> |
@@ -144,8 +144,9 @@ static void iounit_get_scsi_sgl(struct scatterlist *sg, int sz, struct sbus_bus | |||
144 | spin_lock_irqsave(&iounit->lock, flags); | 144 | spin_lock_irqsave(&iounit->lock, flags); |
145 | while (sz != 0) { | 145 | while (sz != 0) { |
146 | --sz; | 146 | --sz; |
147 | sg[sz].dvma_address = iounit_get_area(iounit, (unsigned long)page_address(sg[sz].page) + sg[sz].offset, sg[sz].length); | 147 | sg->dvma_address = iounit_get_area(iounit, (unsigned long)page_address(sg->page) + sg->offset, sg->length); |
148 | sg[sz].dvma_length = sg[sz].length; | 148 | sg->dvma_length = sg->length; |
149 | sg = sg_next(sg); | ||
149 | } | 150 | } |
150 | spin_unlock_irqrestore(&iounit->lock, flags); | 151 | spin_unlock_irqrestore(&iounit->lock, flags); |
151 | } | 152 | } |
@@ -173,11 +174,12 @@ static void iounit_release_scsi_sgl(struct scatterlist *sg, int sz, struct sbus_ | |||
173 | spin_lock_irqsave(&iounit->lock, flags); | 174 | spin_lock_irqsave(&iounit->lock, flags); |
174 | while (sz != 0) { | 175 | while (sz != 0) { |
175 | --sz; | 176 | --sz; |
176 | len = ((sg[sz].dvma_address & ~PAGE_MASK) + sg[sz].length + (PAGE_SIZE-1)) >> PAGE_SHIFT; | 177 | len = ((sg->dvma_address & ~PAGE_MASK) + sg->length + (PAGE_SIZE-1)) >> PAGE_SHIFT; |
177 | vaddr = (sg[sz].dvma_address - IOUNIT_DMA_BASE) >> PAGE_SHIFT; | 178 | vaddr = (sg->dvma_address - IOUNIT_DMA_BASE) >> PAGE_SHIFT; |
178 | IOD(("iounit_release %08lx-%08lx\n", (long)vaddr, (long)len+vaddr)); | 179 | IOD(("iounit_release %08lx-%08lx\n", (long)vaddr, (long)len+vaddr)); |
179 | for (len += vaddr; vaddr < len; vaddr++) | 180 | for (len += vaddr; vaddr < len; vaddr++) |
180 | clear_bit(vaddr, iounit->bmap); | 181 | clear_bit(vaddr, iounit->bmap); |
182 | sg = sg_next(sg); | ||
181 | } | 183 | } |
182 | spin_unlock_irqrestore(&iounit->lock, flags); | 184 | spin_unlock_irqrestore(&iounit->lock, flags); |
183 | } | 185 | } |