From: Jan Andersson Date: Sat, 30 Dec 2006 00:50:04 +0000 (-0800) Subject: [PATCH] sparc32: add offset in pci_map_sg() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dbc1333a347745bd55844649c19eb7d28f383a84;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [PATCH] sparc32: add offset in pci_map_sg() 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 Cc: "David S. Miller" Cc: William Lee Irwin III Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index cbbc98846b00..00a39760877b 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c @@ -726,7 +726,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++; }