David Miller wrote:
From: Kristoffer Glembo <kristoffer@xxxxxxxxxxx>
Date: Mon, 16 Nov 2009 10:51:07 +0100
@@ -524,7 +536,16 @@ static dma_addr_t pci32_map_page(struct device *dev, struct page *page,
struct dma_attrs *attrs)
{
/* IIep is write-through, not flushing. */
- return page_to_phys(page) + offset;
+ return virt_to_phys(page_address(page)) + offset;
+}
What's wrong with page_to_phys()?
page_to_phys() is what must be used, because it is legal to DMA to or
from a highmem page, and for those page_address(page) does not
necessaily evaluate fully.
After pulling the latest sparc-next dma_map_single began returning
bogus addresses. I just saw that page_address was being used everywhere
else in ioport.c (including sbus_map_page) and switched to that since
page_to_phys was returning incorrect addresses when passed SKB pages.
So if page_address is wrong I will have to investigate what it is that
really is broken.
I will clean up the code according to your other feedback as well.
Thanks,
Kristoffer
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html