]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sparc32: add offset in pci_map_sg()
authorJan Andersson <jan.andersson@ieee.org>
Wed, 24 Jan 2007 23:10:10 +0000 (00:10 +0100)
committerAdrian Bunk <bunk@stusta.de>
Wed, 24 Jan 2007 23:10:10 +0000 (00:10 +0100)
Add sg->offset to sg->dvma_address in pci_map_sg() on sparc32.  Without the
offset, transfers to buffers that do not begin on a page boundary will not
work as expected.

Signed-off-by: Jan Andersson <jan.andersson@ieee.org>
Acked-By: David Miller <davem@davemloft.net>
arch/sparc/kernel/ioport.c

index d39c9f2062717c84c7ec4ae5b7b31d8afca33d54..aa07df5bcffe2818aa99ac4147f32fd62b10d357 100644 (file)
@@ -581,7 +581,8 @@ int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents,
        /* IIep is write-through, not flushing. */
        for (n = 0; n < nents; n++) {
                if (page_address(sg->page) == NULL) BUG();
-               sg->dvma_address = virt_to_phys(page_address(sg->page));
+               sg->dvma_address =
+                       virt_to_phys(page_address(sg->page)) + sg->offset;
                sg->dvma_length = sg->length;
                sg++;
        }