On Tue, May 10, 2005 at 08:13:48AM -0400, Dan Malek wrote:
On May 10, 2005, at 7:17 AM, Pantelis Antoniou wrote:
quoted
This patch replace iopa use with virt_to_phys.
Not gonna work .....
When you map uncached on 8xx you get a new vmalloc()
space. The virt_to_xxx macros don't work on those addresses.
You need to use the dma_consistent() function, stash the
real physical address it returns and then use it where
appropriate.
That and the use of virt_to_* and friends is deprecated by
the DMA API. You'll never get that upstream even if it were
a case where it did work. That's a good thing to know for
anybody doing other drivers...
-Matt
Matt Porter wrote:
On Tue, May 10, 2005 at 08:13:48AM -0400, Dan Malek wrote:
quoted
On May 10, 2005, at 7:17 AM, Pantelis Antoniou wrote:
quoted
This patch replace iopa use with virt_to_phys.
Not gonna work .....
When you map uncached on 8xx you get a new vmalloc()
space. The virt_to_xxx macros don't work on those addresses.
You need to use the dma_consistent() function, stash the
real physical address it returns and then use it where
appropriate.
That and the use of virt_to_* and friends is deprecated by
the DMA API. You'll never get that upstream even if it were
a case where it did work. That's a good thing to know for
anybody doing other drivers...
-Matt
OK then.
What's the recommended function to call to go from a
virtual -> physical address, but without doing a cache
flush/invalidate?
Regards
Pantelis
On May 10, 2005, at 9:14 AM, Pantelis Antoniou wrote:
What's the recommended function to call to go from a
virtual -> physical address, but without doing a cache
flush/invalidate?
It doesn't have anything to do with cache flush/invalidate,
it has to do with the way the memory is mapped to a different
VM space. You do not (and in some cases can't) perform
invalidate/flush on uncached addresses.
What we need to do is fix up the CPM allocation functions,
so when it does the dma_alloc_consistent (or whatever the
name is today) it keeps both the physical and virtual addresses.
When we call cpm_hostalloc(), it has to return both the physical
and virtual addresses, and the driver must take note of them.
I had this in the drivers at one time in 2.4, I don't know where
it went ......
The drivers themselves must do the dma_consistent_alloc
on large buffers, and also keep track of both physical and
virtual addresses. Again, this was done once before ....
Thanks.
-- Dan