diff options
author | Steve French <sfrench@us.ibm.com> | 2008-02-06 11:04:00 -0500 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2008-02-06 11:04:00 -0500 |
commit | f315ccb3e679f271583f2a4f463ad9b65665b751 (patch) | |
tree | 44eb52102587d7b0bb592464cef6ec04bcac8b90 /arch/ia64/hp/common/sba_iommu.c | |
parent | ead03e30b050d6dda769e7e9b071c5fa720bf8d2 (diff) | |
parent | 551e4fb2465b87de9d4aa1669b27d624435443bb (diff) |
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'arch/ia64/hp/common/sba_iommu.c')
-rw-r--r-- | arch/ia64/hp/common/sba_iommu.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c index 45bf04eb7d70..a94445422cc6 100644 --- a/arch/ia64/hp/common/sba_iommu.c +++ b/arch/ia64/hp/common/sba_iommu.c | |||
@@ -1265,7 +1265,7 @@ sba_fill_pdir( | |||
1265 | * the sglist do both. | 1265 | * the sglist do both. |
1266 | */ | 1266 | */ |
1267 | static SBA_INLINE int | 1267 | static SBA_INLINE int |
1268 | sba_coalesce_chunks( struct ioc *ioc, | 1268 | sba_coalesce_chunks(struct ioc *ioc, struct device *dev, |
1269 | struct scatterlist *startsg, | 1269 | struct scatterlist *startsg, |
1270 | int nents) | 1270 | int nents) |
1271 | { | 1271 | { |
@@ -1275,6 +1275,7 @@ sba_coalesce_chunks( struct ioc *ioc, | |||
1275 | struct scatterlist *dma_sg; /* next DMA stream head */ | 1275 | struct scatterlist *dma_sg; /* next DMA stream head */ |
1276 | unsigned long dma_offset, dma_len; /* start/len of DMA stream */ | 1276 | unsigned long dma_offset, dma_len; /* start/len of DMA stream */ |
1277 | int n_mappings = 0; | 1277 | int n_mappings = 0; |
1278 | unsigned int max_seg_size = dma_get_max_seg_size(dev); | ||
1278 | 1279 | ||
1279 | while (nents > 0) { | 1280 | while (nents > 0) { |
1280 | unsigned long vaddr = (unsigned long) sba_sg_address(startsg); | 1281 | unsigned long vaddr = (unsigned long) sba_sg_address(startsg); |
@@ -1314,6 +1315,9 @@ sba_coalesce_chunks( struct ioc *ioc, | |||
1314 | > DMA_CHUNK_SIZE) | 1315 | > DMA_CHUNK_SIZE) |
1315 | break; | 1316 | break; |
1316 | 1317 | ||
1318 | if (dma_len + startsg->length > max_seg_size) | ||
1319 | break; | ||
1320 | |||
1317 | /* | 1321 | /* |
1318 | ** Then look for virtually contiguous blocks. | 1322 | ** Then look for virtually contiguous blocks. |
1319 | ** | 1323 | ** |
@@ -1441,7 +1445,7 @@ int sba_map_sg(struct device *dev, struct scatterlist *sglist, int nents, int di | |||
1441 | ** w/o this association, we wouldn't have coherent DMA! | 1445 | ** w/o this association, we wouldn't have coherent DMA! |
1442 | ** Access to the virtual address is what forces a two pass algorithm. | 1446 | ** Access to the virtual address is what forces a two pass algorithm. |
1443 | */ | 1447 | */ |
1444 | coalesced = sba_coalesce_chunks(ioc, sglist, nents); | 1448 | coalesced = sba_coalesce_chunks(ioc, dev, sglist, nents); |
1445 | 1449 | ||
1446 | /* | 1450 | /* |
1447 | ** Program the I/O Pdir | 1451 | ** Program the I/O Pdir |
@@ -1871,7 +1875,7 @@ ioc_show(struct seq_file *s, void *v) | |||
1871 | return 0; | 1875 | return 0; |
1872 | } | 1876 | } |
1873 | 1877 | ||
1874 | static struct seq_operations ioc_seq_ops = { | 1878 | static const struct seq_operations ioc_seq_ops = { |
1875 | .start = ioc_start, | 1879 | .start = ioc_start, |
1876 | .next = ioc_next, | 1880 | .next = ioc_next, |
1877 | .stop = ioc_stop, | 1881 | .stop = ioc_stop, |