The current pci_map_sg API is a bit unclear what it is allowed to modify in the passed scatterlist when coalescing entries. Clarify the pci_map_sg API to prevent it from modifying the page, offset, and length fields in the scatterlist. Signed-off-by: Brian King --- linux-2.6-bjking1/Documentation/DMA-API.txt | 5 +++-- linux-2.6-bjking1/Documentation/DMA-mapping.txt | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff -puN Documentation/DMA-mapping.txt~dma_mapping_clarification Documentation/DMA-mapping.txt --- linux-2.6/Documentation/DMA-mapping.txt~dma_mapping_clarification 2006-02-06 13:05:52.000000000 -0600 +++ linux-2.6-bjking1/Documentation/DMA-mapping.txt 2006-02-06 13:05:52.000000000 -0600 @@ -513,7 +513,10 @@ consecutive sglist entries can be merged ends and the second one starts on a page boundary - in fact this is a huge advantage for cards which either cannot do scatter-gather or have very limited number of scatter-gather entries) and returns the actual number -of sg entries it mapped them to. On failure 0 is returned. +of sg entries it mapped them to. The implementation is free to do this +by modifying the scatterlist fields specified for DMA. The scatterlist +fields used as an input to this function (i.e. page, offset, and length) +will NOT be modified. On failure 0 is returned. Then you should loop count times (note: this can be less than nents times) and use sg_dma_address() and sg_dma_len() macros where you previously diff -puN Documentation/DMA-API.txt~dma_mapping_clarification Documentation/DMA-API.txt --- linux-2.6/Documentation/DMA-API.txt~dma_mapping_clarification 2006-02-06 13:06:17.000000000 -0600 +++ linux-2.6-bjking1/Documentation/DMA-API.txt 2006-02-06 13:07:40.000000000 -0600 @@ -318,8 +318,9 @@ than passed in if the block laye elements of the scatter/gather list are physically adjacent and thus may be mapped with a single entry). -Please note that the sg cannot be mapped again if it has been mapped once. -The mapping process is allowed to destroy information in the sg. +Please note that the sg can be mapped again, as long as it is unmapped +first. The mapping process is only allowed to modify the scatterlist +fields related to DMA. As with the other mapping interfaces, dma_map_sg can fail. When it does, 0 is returned and a driver must take appropriate action. It is _