On Sat, 23 Apr 2005, James Bottomley wrote: > As long as the sg list hasn't gone through dma_map_sg, then you can rely > on its elements being contiguous in physical space. Once it's gone > through dma_map_sg, it's elements are contiguous in the bus space beyond > the IOMMU, so no longer (possibly) even physically contiguous. Thanks for the info. Let me see, if I got you right. Say, we've got an sg with 2 elements: first 2 * PAGE_SIZE long, offset 0, pointing to page #0, second PAGE_SIZE long, offset 0, page #3. Say, dma_map_sg returned 1, so, it mapped all those 3 (physically discontiguous) pages to a contiguous bus address range. And now sg_dma_len() returns 3 * PAGE_SIZE. But, I hope, the .page, .length, and .offset elements stayed unchanged, so, one can still walk elements 0 and 1, calculating a sum of sg[i].length and thus arrive to the required page, right? I'll redo the patch. Thanks Guennadi --- Guennadi Liakhovetski - : send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html