|
|
@@ -2543,7 +2543,12 @@ static int map_sg(struct device *dev, struct scatterlist *sglist,
|
|
|
|
|
|
/* Everything is mapped - write the right values into s->dma_address */
|
|
|
for_each_sg(sglist, s, nelems, i) {
|
|
|
- s->dma_address += address + s->offset;
|
|
|
+ /*
|
|
|
+ * Add in the remaining piece of the scatter-gather offset that
|
|
|
+ * was masked out when we were determining the physical address
|
|
|
+ * via (sg_phys(s) & PAGE_MASK) earlier.
|
|
|
+ */
|
|
|
+ s->dma_address += address + (s->offset & ~PAGE_MASK);
|
|
|
s->dma_length = s->length;
|
|
|
}
|
|
|
|