]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[PATCH] sparc32: add offset in pci_map_sg()
authorJan Andersson <jan.andersson@ieee.org>
Tue, 2 Jan 2007 08:09:25 +0000 (00:09 -0800)
committerChris Wright <chrisw@sous-sol.org>
Wed, 10 Jan 2007 19:05:21 +0000 (11:05 -0800)
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>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: William Lee Irwin III <wli@holomorphy.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
arch/sparc/kernel/ioport.c

index 54d51b404603091e377f1e311df323b64caffc12..7efb262decf810272e01ca5300b039f360a82158 100644 (file)
@@ -728,7 +728,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++) {
                BUG_ON(page_address(sg->page) == NULL);
-               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++;
        }